text:
x/build/cmd/coordinator: active gomote sessions and coordinator deploys are mutually exclusive

There are times when people need to investigate issues that require configuration or environment that is hard to reproduce locally, and they use gomote instances for such debugging sessions.
A limitation of the current implementation of this system is that all remote buildlets are lost when cmd/coordinator restarts. This limitation is documented in doc/remote-buildlet.txt:

Currently, if the coordinator dies or restarts, all buildlets are lost.

An unfortunate consequence is that this can reduce the window of time when cmd/coordinator can be re-deployed without disrupting investigative done by others.
This can generally be worked around by coordinating with people who are using gomotes to find a good time for a deploy, but it scales poorly when there are more concurrent investigations being done, especially during business hours.
This is the tracking issue to track how much of a problem it is and investigate ways to improve this situation if it ends up becoming a bottleneck.
/cc @cagedmantis @toothrot @andybons

An ultimate solution would be a mechanism that makes it possible to redeploy coordinator without losing gomote sessions, or at least makes it possible to re-connect to them without their state getting lost.
Short of that solution, if finding a deploy window starts to become difficult to do and starts to block other work, then perhaps some sort of a queue can be arranged so that a future deploy can be scheduled in advance, and people don't start new gomote sessions just as older ones wrap up.
In my experience this isn't a huge problem that warrants spending a lot of time on yet, but I just wanted to share some initial thoughts.

An interim solution could be to break out the gomote ssh proxy endpoint into its own service, as it likely needs to be deployed less frequently than the coordinator itself. This would still require some persistent state to be managed across coordinator deploys, though.

authors: dmitshur toothrot


text:
Proposal: create a plugin from byte array.

It would be nice to create a Plugin from general byte array, not only from file system path.

What does that mean? Can you show an example of how it might work?

For now we could create a plugin with
plugin.Open("/some/path")
But what if we received a plugin from network. We should save it first to filesystem and only than open.
It might work like this
var arr []byte
...
plugin.Open(arr)
Also with this kind of the creation it becomes possible to guarantee data integrity.

The way that plugins are currently implemented requires the plugin to be in a separate file.  If we added this new feature, it would be implemented by writing the byte array out to a file first.  Given that implementation constraint, I'm not sure this is very useful.

source: gharchive/issue

repo: golang/go

license_type: permissive

license_source: github-api


text:
request: Move from Github

don't do this to us. move to a free software

fuck you github

There is something to be said for hosting our code on platforms which are open source, such as gitlab or gitorious. However there is also the inconveniences that go with moving everything as well.

The canonical location for the Go Project repositoritories is https://go.googlesource.com which is powered by gitiles, which is open source (github is just a mirror). Patches and codereviews are handled at gerrit, which is open source.
The only part of the project that is actually primarily github based is the issue tracker.
One can 1) get the source code and 2) contribute to the project (including sending patches and fixing bugs) without having a github account. You'll have to browse the github issue tracker if you're looking for issues to fix, but you can do that without an account. You can't create a new issue without a github account; and I agree that this is unfortunate.
In general, the project is much less dependant on github that it seems. Request to move away from github has been rejected in the past, and this issue doesn't seem to add much of interest to the discussion, so I'm closing this issue.

authors: ALTree beoran ciami7


text:
cmd/link/internal/ld: TestAbstractOriginSanity consistently failing on windows-amd64-longtest builder

2021-04-21T02:39:25-c33ced6/windows-amd64-longtest
2021-04-21T01:45:15-190cb93/windows-amd64-longtest
2021-04-21T00:54:01-c187443/windows-amd64-longtest
2021-04-21T00:53:48-faa4fa1/windows-amd64-longtest
2021-04-20T23:47:34-1c26843/windows-amd64-longtest
2021-04-20T23:41:54-e12b0af/windows-amd64-longtest
2021-04-20T22:47:50-48e3d92/windows-amd64-longtest
2021-04-20T18:34:56-77860ad/windows-amd64-longtest
--- FAIL: TestAbstractOriginSanity (15.02s)
    dwarf_test.go:124: build: # cmd/link/internal/ld/testdata/httptest/main
        runtime.abort: nosplit stack overflow
        	792	assumed on entry to runtime.callbackasm<1> (nosplit)
        	784	on entry to runtime.callbackasm1<0> (nosplit)
        	552	after runtime.callbackasm1<0> (nosplit) uses 232
        	544	on entry to runtime.cgocallback<0> (nosplit)
        	512	after runtime.cgocallback<0> (nosplit) uses 32
        	504	on entry to runtime.cgocallbackg<0> (nosplit)
        	472	after runtime.cgocallbackg<0> (nosplit) uses 32
        	464	on entry to runtime.cgocallbackg<1> (nosplit)
        	328	after runtime.cgocallbackg<1> (nosplit) uses 136
        	320	on entry to runtime.exitsyscall<1> (nosplit)
        	256	after runtime.exitsyscall<1> (nosplit) uses 64
        	248	on entry to runtime.casgstatus<1> (nosplit)
        	152	after runtime.casgstatus<1> (nosplit) uses 96
        	144	on entry to runtime.nanotime1<0> (nosplit)
        	136	on entry to runtime.nanotimeQPC<1> (nosplit)
        	96	after runtime.nanotimeQPC<1> (nosplit) uses 40
        	88	on entry to runtime.stdcall1<0> (nosplit)
        	72	after runtime.stdcall1<0> (nosplit) uses 16
        	64	on entry to runtime.stdcall<1> (nosplit)
        	16	after runtime.stdcall<1> (nosplit) uses 48
        	8	on entry to runtime.asmcgocall<0> (nosplit)
        	0	on entry to gosave_systemstack_switch<53> (nosplit)
        	-8	on entry to runtime.abort<0> (nosplit)

    dwarf_test.go:125: build error: exit status 2
FAIL

The first failure in the logs was at CL 311830 (CC @cherrymui, @dr2chase, @thanm).

@mknyszek

This is confusing -- I see
    	544	on entry to runtime.cgocallback<0> (nosplit)
    	512	after runtime.cgocallback<0> (nosplit) uses 32
    	504	on entry to runtime.cgocallbackg<0> (nosplit)
    	472	after runtime.cgocallbackg<0> (nosplit) uses 32

which makes it look as though runtime.cgocallbackg<0> is calling itself?  Maybe I am reading this incorrectly.

@thanm I think that's cgocallback (asm) calling cgocallbackg (Go).
Sigh. I think we need to find more places to save on nosplit stack. I already did a bit of a hack in nanotime on Windows to avoid a wrapper.

I reapplied the disabled CL. It is no longer failing.

This same test is once again persistently failing as of CL 312429 (or perhaps CL 312191, but I think the former is much more likely).

FWIW I chose to fix forward here rather than roll-back, because the old code was pretty broken. I don't mind rolling back, though, if this takes a while to land though.

https://golang.org/cl/312669 fixed the issue (longtest trybot passed). Thanks Cherry!

authors: bcmills cherrymui mknyszek thanm


text:
cmd/compile: incorrect arm/arm64 simplification rules

Both arm and arm64 have rules like:
(SUBshiftLL x (SLLconst x [c]) [d]) && c==d => (MOVDconst [0])

This actually encodes the identity x - x<<c<<c == 0, which is incorrect. It should be
(SUBshiftLL (SLLconst x [c]) x [d]) && c==d => (MOVDconst [0])

Which encodes the correct identity x<<c - x<<c == 0.
It turns out to be quite hard to trigger this bad rule, as x<<c<<c is almost always reduced by the generic rewrite pass. But here's a case which gets through:
package main

func f(x uint64) uint64 {
	s := "\x05"
	c := s[0]
	return x - x<<c<<5
}

func main() {
	println(f(5))
}

This should print some giant number (18446744073709546501), but on arm64 it prints 0.
@cherryyz

@gopherbot please open backport issues.


text:
x/oauth2/google/internal/externalaccount: frequent failures in AWS credential tests

greplogs --dashboard -md -l -e '--- FAIL: TestAwsCredential'
2021-11-03T09:23:34-ba495a6-6458b2e/android-amd64-emu
2021-11-03T00:49:50-ba495a6-a4b2c57/freebsd-amd64-race
2021-11-02T23:05:17-ba495a6-eb63cbd/linux-amd64-race
2021-11-02T17:31:50-ba495a6-4e7dd9f/linux-386-clang
2021-11-02T06:19:33-ba495a6-4633b2d/freebsd-amd64-race
2021-10-27T20:42:29-6b3c2da-644555d/windows-arm64-10
2021-10-26T01:18:46-6b3c2da-49fda9e/windows-amd64-race
2021-10-25T16:07:11-6b3c2da-c6e82e5/windows-amd64-2016
2021-10-22T14:05:31-6b3c2da-ff8115d/windows-arm64-10
2021-10-15T18:07:49-6b3c2da-8331f25/linux-ppc64le-buildlet
2021-10-14T17:38:39-6b3c2da-011fd00/freebsd-386-12_2
2021-10-11T19:15:23-6b3c2da-52078fa/windows-arm64-10
2021-10-07T18:11:41-6b3c2da-2ac3bdf/solaris-amd64-oraclerel
2021-10-05T17:10:45-2bc19b1-5140ad1/linux-ppc64-buildlet
2021-10-05T00:29:40-2bc19b1-81b7ec1/windows-amd64-longtest
2021-10-04T22:46:23-2bc19b1-17674e2/linux-arm64-packet
2021-08-04T16:42:14-a41e5a7-e90f402/linux-ppc64-buildlet
2021-05-14T00:56:52-81ed05c-12d383c/js-wasm
2021-04-27T02:39:52-5e61552-434e12f/linux-amd64-race
2021-04-12T18:32:27-2e8d934-07b2fee/linux-amd64-jessie
2021-04-02T13:30:18-22b0ada-b165085/openbsd-amd64-68
2021-03-22T19:09:53-cd4f82c-a93849b/dragonfly-amd64
2021-03-10T21:25:35-9bb9049-6e04188/aix-ppc64
2021-02-18T20:24:05-ba52d33-1a7e9af/openbsd-amd64-64
2021-02-16T17:42:55-6667018-098504c/linux-arm
2021-02-11T01:10:35-6667018-930c2c9/openbsd-386-64
2021-02-10T19:26:28-6667018-e9c9683/openbsd-386-64
2021-02-09T05:28:50-0101308-e0ac989/windows-arm-zx2c4
2021-02-09T01:22:45-0101308-cea4e21/plan9-arm
2021-02-08T23:32:14-0101308-dc725bf/openbsd-amd64-64
2021-02-04T20:43:04-0101308-5cf057d/windows-arm-zx2c4
2021-02-04T14:27:49-0101308-6a64f5f/android-amd64-emu
2021-02-04T14:27:44-0101308-c3e1c38/openbsd-amd64-62
2021-02-02T22:36:08-0101308-58dc445/openbsd-amd64-62

@codyoss, I can't really even tell what's going wrong in these tests — the logs don't seem to indicate the nature of the problem. Could you take a look?

I will take a peek.

authors: bcmills codyoss


text:
doc: document idiomatic way to ensure that type satisfies a generic constraint

What version of Go are you using (go version)?

// This playground uses a development build of Go:
// devel go1.18-16d6a5233a Tue Jan 25 00:39:08 2022 +0000

What did you do?
https://gotipplay.golang.org/p/RX-7wE7yCzp
package main

// traditional golang interface
type I interface {
	Fn() int
}

// generic interface
type TI[T any] interface {
	Fn() T
}

// generic constraint
type CI[T any] interface {
	~struct {
		Thing int
	}
	Fn() T
}

//
// Implementation
//

type Concrete struct {
	Thing int
}

func (c Concrete) Fn() int {
	return c.Thing
}

// ok
var _ I = Concrete{}

// ok
var _ TI[int] = Concrete{}

// error: interface contains type constraints
var _ CI[int] = Concrete{}

// this doesn't seem very idiomatic
func SatisfiesCI[C CI[int]](c C) {}

func init() {
	SatisfiesCI(Concrete{})
}

Description
The current FAQ describes the idiomatic way to ensure your type satisfies an interface. I find I use this idiom a lot to make sure I don't accidentally break concrete implementations of things that are only used by a few consumers of a library, but not necessarily in the library itself (... or maybe I'm too lazy to write a test for it :shipit:).
As I was migrating a project to see what it would look like under generics, I made some of the interfaces generic and that worked fine. Unfortunately, this sort of check doesn't work with constraints, and there doesn't seem to be a good way to ensure that your type satisfies the constraint other than creating a function to do so.
I get why you can't assign to a constraint interface -- you can't create variables that "are a constraint".
It would be good for someone more experienced with generics to decide on an idiomatic way to do this sort of 'constraint assertion', and make sure it ends up in the FAQ. It's possible there isn't a non-clunky way right now, and that this issue would need to be deferred until more experience is had with generics.
It's also possible I missed an earlier issue/discussion that asked for this, in which case I apologize (but I did look!).

Would this work?
https://gotipplay.golang.org/p/EKwVbjuZYEK
var _ any = TI[int](Concrete{})

No, that's for TI, which is just a generic interface. The constraint is CI.

CC @ianlancetaylor maybe?

The best I can come up with is
func SatisfiesCI[_ CI[int]]() {}
var _ = SatisfiesCI[Concrete]

Anybody have any other ideas?

This?
https://gotipplay.golang.org/p/lq3GDh15HpB
type _ interface {
	CI[int]
	Concrete
}

@ydnar I don't see how that ensures that Concrete satisfies the constraint CI[int].  That will work if you substitute any other type for Concrete.

This version does it in a single declaration, but you still have to give the declaration a real name:
type SatisfiesCI[_ CI[int]] struct {
	_ *SatisfiesCI[Concrete]
}

One of my first tries at this tried to define a variable with an anonymous struct and assign it, but I quickly discovered you can't add a type parameter to an anonymous struct so that didn't work... and it's a lot of punctuation.
// this doesn't work
var _ = struct[x CI[int]{_ x}{Concrete{}}

ianlancetaylor's single definition is better than the functional definition.. but it's not terribly obvious what it's doing (though maybe that's why it should be named?). Though, I guess is the standard idiom really all that obvious if you haven't seen it before either?
One could add a general 'Satisfies' function to the constraints package? But I don't believe there's a way to make a function that would work for all types/constraints without some C++-style meta-madness. But if there were, then you could write something like:
var _ constraints.Satisfies[CI[int], Concrete]

func SatisfiesCI[_ CI[int]]() {}
var _ = SatisfiesCI[Concrete]

I've been using this one from Ian with a specific flavor. I create the SatisfiesXXX function right next to the constraint, so it's really obvious why it exists even with complex generic parameters. It gives a nice error message, and in particular is really easy to understand at the point the error is generated because it's just two names, similar to the original idiom.

type SatisfiesCI[_ CI[int]] struct {
	_ *SatisfiesCI[Concrete]
}

I found that the single-declaration version that Ian came up with is really difficult to write correctly, really difficult to read, and particularly if there are a few generic parameters you're doing a lot of duplication of text.

Moving to Backlog.

Just hit this issue. We're looking at implementing some container/collection classes, and I wanted to be able to enforce that a particular generic type implementation satisfies a specific generic interface.
For example, I might want to be able to assert that both ConcurrentSliceSet[E] and SliceSet[E] implement Set[E].
I can write something like var _ Set[string] = (*SliceSet[string](nil)) (assuming string satisfies E), but that's obviously not ideal. Maybe now we have generics it's time to revisit whether Go needs some specific interface assertion syntax?

Inspired by type alias syntax (type T = U), what if the language permitted assertions using an == or ~= operator? e.g.:
type T int

type T == fmt.Stringer
type T == error

func (v T) String() string {
	return strconv.Itoa(v)
}

func (v T) Error() string {
	return v.String()
}

authors: ianlancetaylor lpar mknyszek virtuald ydnar


text:
x/tools/cmd/bundle: fails to rename references to embedded generic structs

What version of Go are you using?

go version go1.20.5 linux/amd64
x/tools/bundle version: v0.9.3

What did you do?
I ran the command bundle -o bundled.go ./lib where lib is a folder containing a single file with this code (see link)
What did you expect to see?
I expected bundle to produce this code (see link).  Note in particular line 22:
	x := s.lib_Stack.Pop()

What did you see instead?
bundle produced this code (see link) which does not compile:
./prog.go:22:9: s.Stack undefined (type *lib_StackTwo[T] has no field or method Stack)

The problem is that bundle failed to rename the field selector referring to the embedded generic struct Stack in line 22:
	x := s.Stack.Pop()

I have had similar problems running bundle on other programs featuring embedded generic structs.

@adonovan @golang/tools-team

I suspect this TypeName pointer comparison is the issue. We'll need to adapt it to test whether two types have the same generic declaration, even if one of them is an instantiation of the other. A quick workaround might be to check something like obj == from || is[*types.TypeName](obj) && obj.Pos() == from.Pos() instead.

Thanks. I have implemented a variation the suggested workaround that seems to do the trick, see this code, lines 213-228.

Thanks. I have implemented a variation of the suggested workaround that seems to do the trick. I would be happy to share it if you think it could be of interest. Would it be ok to put the modified source code of bundle on the Go playground?

I have implemented a variation of the suggested workaround that seems to do the trick. I would be happy to share it if you think it could be of interest.

Thanks, please do share it. The best way to share patches is by sending a Gerrit CL or GitHub PR, whichever is easiest. You can find instructions for both here: https://go.dev/doc/contribute#sending_a_change_github.


text:
unicode: upgrade to Unicode 15.1.0

Go version
go version go1.21.5 linux/amd64
Output of go env in your module/workspace:
not applicable

What did you do?
https://go.dev/play/p/9biSMo4sTqo
What did you see happen?
15.0.0
What did you expect to see?
15.1.0

cc @golang/security @robpike

All three CLs to complete the upgrade to 15.1.0 are completed

authors: cagedmantis weebney


text:
cmd/cgo: gdb on darwin cannot find symbols for cgo compiled objects

What steps will reproduce the problem?
1. Compile a program using Go 1.2 on Mac OS 10.9 that uses CGO.  Set CC = a version of
GCC from home brew - http://brew.sh
2. Launch the program with gdb for debugging

What is the expected output?
gdb loads the symbols from the file and is able to step through the file

What do you see instead?
Following output from GDB:
GNU gdb (GDB) 7.6.2
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin13.0.2".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>;...
Reading symbols from /Users/lukemauldin/dev/goexternal/src/tf/vncclient/vncclient...
warning:
`/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build264520081/tf/vncclient/vncrecord/_obj/_cgo_export.o':
can't open to read symbols: No such file or directory.

warning:
`/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build264520081/tf/vncclient/vncrecord/_obj/vnccallback_c.o':
can't open to read symbols: No such file or directory.

warning:
`/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build264520081/tf/vncclient/vncrecord/_obj/vncrecord.cgo2.o':
can't open to read symbols: No such file or directory.

warning:
`/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build825245175/runtime/cgo/_obj/gcc_amd64.o':
can't open to read symbols: No such file or directory.

warning:
`/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build825245175/runtime/cgo/_obj/gcc_darwin_amd64.o':
can't open to read symbols: No such file or directory.

warning:
`/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build825245175/runtime/cgo/_obj/gcc_setenv.o':
can't open to read symbols: No such file or directory.

warning:
`/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build825245175/runtime/cgo/_obj/gcc_util.o':
can't open to read symbols: No such file or directory.
(no debugging symbols found)...done.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Mac OS X 10.9

Which version are you using?  (run 'go version')
go version go1.2 darwin/amd64

Please provide any additional information below.
Debugging a program that does not directly use CGO works as expected.  GDB is able to
debug the same program on a Linux environment.

I can verify that this is still an issue on OS X using a the dev toolchain within Xcode.

I just hit this with the macOS dev tools, too. Maybe a regression if it used to work per https://github.com/golang/go/issues/6942#issuecomment-66089212?

Getting this issue too with the standard compiler. @jmhodges did you figure out a solution to this?

Same here. Any known workaround at this point? Thanks.

Same here. Any known workaround at this point? Thanks.

authors: LukeMauldin jmhodges leaanthony mikepulaski tiferrei


text:
cmd/go/internal/work/security: add -ftls-model=(.*) to safelist

Go version
go version go1.23.1 linux/amd64
Output of go env in your module/workspace:
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.1'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/root/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/build/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build198491779=/tmp/go-build -gno-record-gcc-switches'

What did you do?
Added -ftls-model=local-dynamic to a # cgo CFLAGS:  directive to work-around issues with initial-exec thread-local storage model on alpine with musl.
What did you see happen?
CGO_ENABLED=1 go build -v -o steampipe_postgres_fdw.a  -tags "netgo" -buildmode=c-archive ../*.go
runtime/cgo
os/user
command-line-arguments
command-line-arguments: invalid flag in #cgo CFLAGS: -ftls-model=local-dynamic

What did you expect to see?
Build should work normally.
Work-around: define CGO_CFLAGS_ALLOW='-ftls-model=(.*)' environment variable.

Related Issues and Documentation

cmd/go: allow flags in CGO_LDFLAGS environment variable not in security allowlist #42565 (closed)
cmd/cgo: after upgrade from 1.9.2 to 1.10, cgo compile fails with "invalid flag in #cgo LDFLAGS: -Wl,-z,relro" #24124 (closed)
x/tools/gopls: negated build flag causes error #59346
cmd/go: add more options to security whitelist #23937 (closed)
cmd/go: Build information embedded by Go 1.18 impairs build reproducibility with cgo flags #52372 (closed)
cls #67514 (closed)
cmd/go: allow passing -U flag in cgo CFLAGS #34730 (closed)

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@golang/tools-team

Is there a list of valid values of ftls-model? Could we make the regexp more restrictive? I think it should at least be '-ftls-model=([a-z-]*)' assuming that all the valid values match? (Doing a quick search they seem to?)

According to GCC docs, valid values are: global-dynamic, local-dynamic, initial-exec and local-exec.

Okay, then I think we should we add -ftls-model=(global-dynamic|local-dynamic|initial-exec|local-exec)

authors: gabyhelp matloob mknyszek pdecat


text:
x/net/websocket: support DialTimeout

As with net.Dial, websocket should support a timeout during Dial.

Given the existing DialConfig, perhaps the timeout should be expressed there and used if
present, replacing Dial with DialTimeout:

  https://code.google.com/p/go/source/browse/websocket/client.go?repo=net#77

A Dialer seems preferable. As it is, there's no way to Dial a domain socket, which is another limitation I've hit.
Is there anyone who can approve a patch to add a Dialer to the Config?

Although, one can dial manually and pass the conn to NewClient, which seems a fine workaround. Perhaps a Dialer is not needed whatsoever.

I would prefer passing a net.Conn over using a Dialer too. Otherwise those clients are hard to use in tests.

authors: CSEMike nightlyone


text:
runtime/pprof: tests "out of memory" on Plan 9

The runtime/pprof trace_parser_test.go and trace_test.go
test files were added in CL 2039.
TestTraceDoubleStart, TestTrace, TestTraceStres and
TestTraceSymbolize are failing on Plan 9 ("out of memory").
However, only TestTrace is failing when the tests are run individually.
cpu% go test -run TestTraceDoubleStart
PASS
ok  	runtime/pprof	0.052s
cpu% go test -run TestTrace
fatal error: trace: out of memory
goroutine 7 [running]:
runtime.throw(0x196ac8, 0x14)
	/usr/go/src/runtime/panic.go:508 +0x71 fp=0x10397ddc sp=0x10397dd0
runtime.traceFlush(0x0, 0x0)
	/usr/go/src/runtime/trace.go:511 +0x1f0 fp=0x10397e08 sp=0x10397ddc
runtime.traceEvent(0x10d, 0x10397ec0, 0x2, 0x2)
	/usr/go/src/runtime/trace.go:411 +0x68a fp=0x10397eb0 sp=0x10397e08
runtime.traceGoCreate(0x1037a0a0, 0x21680)
	/usr/go/src/runtime/trace.go:734 +0x99 fp=0x10397ee0 sp=0x10397eb0
runtime.StartTrace(0x0, 0x0)
	/usr/go/src/runtime/trace.go:151 +0x146 fp=0x10397f3c sp=0x10397ee0
runtime/pprof.StartTrace(0x3038dbc0, 0x103ec420, 0x0, 0x0)
	/usr/go/src/runtime/pprof/pprof.go:624 +0x57 fp=0x10397f5c sp=0x10397f3c
runtime/pprof_test.TestTraceDoubleStart(0x103ec3c0)
	/usr/go/src/runtime/pprof/trace_test.go:38 +0x60 fp=0x10397fb4 sp=0x10397f5c
testing.tRunner(0x103ec3c0, 0x252300)
	/usr/go/src/testing/testing.go:448 +0xb6 fp=0x10397fe8 sp=0x10397fb4
runtime.goexit()
	/usr/go/src/runtime/asm_386.s:2408 +0x1 fp=0x10397fec sp=0x10397fe8
created by testing.RunTests
	/usr/go/src/testing/testing.go:556 +0x881
goroutine 1 [chan receive]:
testing.RunTests(0x1cc818, 0x2522a0, 0xc, 0xc, 0x1)
	/usr/go/src/testing/testing.go:557 +0x8bb
testing.(*M).Run(0x103cc060, 0x268040)
	/usr/go/src/testing/testing.go:486 +0x5d
main.main()
	runtime/pprof/_test/_testmain.go:76 +0x176
exit status: 'pprof.test 16942: 2'
FAIL	runtime/pprof	3.325s
cpu% go test -run TestTraceStress
PASS
ok  	runtime/pprof	4.844s
cpu% go test -run TestTraceSymbolize
PASS
ok  	runtime/pprof	9.812s

I need help figuring out why it helps.
I've double checked that tracer does not leak. I've run TestTraceStress in tight loop for a minute, memory consumption is several megs larger than w/o tracing, but otherwise grows the same way.
David, can you log all calls to sysAlloc, total memory consumption and errno value?

The issue doesn't seem to be related to runtime/pprof specifically.
It seems sysAlloc always fail after sysFree, when this pattern happens:
sysFree (0x30493000, 65536, 0x275f80)
sysFree (0x304a3000, 65536, 0x275f80)
sysFree (0x30483000, 65536, 0x275f80)
sysAlloc (65536, 0x275f80)

For example: TestTraceDoubleStart fails when executed after TestTraceStartStop:
cpu% go test -v -short
sysReserve(0x300000, 806363136, 0xdfffee27)
sbrk(806363136)
sbrk return 0x281000
sysAlloc (262144, 0x275f80)
sbrk(262144)
sbrk return 0x30383000
sysAlloc return 0x30383000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x303c3000
sysAlloc return 0x303c3000
sysAlloc (719996, 0x275f70)
sbrk(719996)
sbrk return 0x303d3000
sysAlloc return 0x303d3000
=== RUN TestMemoryProfiler
--- PASS: TestMemoryProfiler (0.02s)
=== RUN TestCPUProfile
--- PASS: TestCPUProfile (0.00s)
=== RUN TestCPUProfileMultithreaded
--- PASS: TestCPUProfileMultithreaded (0.00s)
=== RUN TestCPUProfileWithFork
sysAlloc (1605672, 0x275f80)
sbrk(1605672)
sbrk return 0x30483000
sysAlloc return 0x30483000
--- PASS: TestCPUProfileWithFork (15.30s)
=== RUN TestGoroutineSwitch
--- SKIP: TestGoroutineSwitch (0.14s)
	pprof_test.go:96: profile too short: [0x0 0x3 0x0 0x2710 0x0 0x0 0x1 0x0]
	pprof_test.go:98: ignoring failure on plan9; see golang.org/issue/6047
=== RUN TestMathBigDivide
--- PASS: TestMathBigDivide (0.00s)
=== RUN TestBlockProfile
--- PASS: TestBlockProfile (0.21s)
=== RUN TestTraceStartStop
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x3060c000
sysAlloc return 0x3060c000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x3061c000
sysAlloc return 0x3061c000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x3062c000
sysAlloc return 0x3062c000
sysFree (0x3061c000, 65536, 0x275f80)
sysFree (0x3062c000, 65536, 0x275f80)
sysFree (0x3060c000, 65536, 0x275f80)
--- PASS: TestTraceStartStop (0.14s)
=== RUN TestTraceDoubleStart
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return nil
sysAlloc return 0x0
fatal error: trace: out of memory

goroutine 46 [running]:
runtime.throw(0x19ac08, 0x14)
	/usr/go/src/runtime/panic.go:508 +0x71 fp=0x16840de0 sp=0x16840dd4
runtime.traceFlush(0x0, 0x0)
	/usr/go/src/runtime/trace.go:511 +0x1f0 fp=0x16840e0c sp=0x16840de0
runtime.traceEvent(0x10d, 0x16840ec4, 0x2, 0x2)
	/usr/go/src/runtime/trace.go:411 +0x68a fp=0x16840eb4 sp=0x16840e0c
runtime.traceGoCreate(0x103820a0, 0x21940)
	/usr/go/src/runtime/trace.go:734 +0x99 fp=0x16840ee4 sp=0x16840eb4
runtime.StartTrace(0x0, 0x0)
	/usr/go/src/runtime/trace.go:151 +0x146 fp=0x16840f40 sp=0x16840ee4
runtime/pprof.StartTrace(0x303a1458, 0x103e5560, 0x0, 0x0)
	/usr/go/src/runtime/pprof/pprof.go:624 +0x30 fp=0x16840f5c sp=0x16840f40
runtime/pprof_test.TestTraceDoubleStart(0x103e5500)
	/usr/go/src/runtime/pprof/trace_test.go:51 +0x6c fp=0x16840fb4 sp=0x16840f5c
testing.tRunner(0x103e5500, 0x259320)
	/usr/go/src/testing/testing.go:448 +0xb4 fp=0x16840fe8 sp=0x16840fb4
runtime.goexit()
	/usr/go/src/runtime/asm_386.s:2408 +0x1 fp=0x16840fec sp=0x16840fe8
created by testing.RunTests
	/usr/go/src/testing/testing.go:556 +0x833

goroutine 1 [chan receive]:
testing.RunTests(0x1d1018, 0x2592c0, 0xc, 0xc, 0x1)
	/usr/go/src/testing/testing.go:557 +0x86b
testing.(*M).Run(0x103c4060, 0x26f060)
	/usr/go/src/testing/testing.go:486 +0x5d
main.main()
	runtime/pprof/_test/_testmain.go:76 +0x176
exit status: 'pprof.test 23897: 2'
FAIL	runtime/pprof	15.970s

TestTraceDoubleStart succeed when ran individually:
cpu% go test -run TestTraceDoubleStart
sysReserve(0x300000, 806363136, 0xdfffee27)
sbrk(806363136)
sbrk return 0x281000
sysAlloc (262144, 0x275f80)
sbrk(262144)
sbrk return 0x30383000
sysAlloc return 0x30383000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x303c3000
sysAlloc return 0x303c3000
sysAlloc (719996, 0x275f70)
sbrk(719996)
sbrk return 0x303d3000
sysAlloc return 0x303d3000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x30483000
sysAlloc return 0x30483000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x30493000
sysAlloc return 0x30493000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x304a3000
sysAlloc return 0x304a3000
sysFree (0x30493000, 65536, 0x275f80)
sysFree (0x304a3000, 65536, 0x275f80)
sysFree (0x30483000, 65536, 0x275f80)
PASS
ok  	runtime/pprof	0.109s

TestTrace always fails:
cpu% go test -run TestTrace
sysReserve(0x300000, 806363136, 0xdfffee27)
sbrk(806363136)
sbrk return 0x281000
sysAlloc (262144, 0x275f80)
sbrk(262144)
sbrk return 0x30383000
sysAlloc return 0x30383000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x303c3000
sysAlloc return 0x303c3000
sysAlloc (719996, 0x275f70)
sbrk(719996)
sbrk return 0x303d3000
sysAlloc return 0x303d3000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x30483000
sysAlloc return 0x30483000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x30493000
sysAlloc return 0x30493000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x304a3000
sysAlloc return 0x304a3000
sysFree (0x30493000, 65536, 0x275f80)
sysFree (0x304a3000, 65536, 0x275f80)
sysFree (0x30483000, 65536, 0x275f80)
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return nil
sysAlloc return 0x0
fatal error: trace: out of memory

goroutine 7 [running]:
runtime.throw(0x19ac08, 0x14)
	/usr/go/src/runtime/panic.go:508 +0x71 fp=0x1039fde0 sp=0x1039fdd4
runtime.traceFlush(0x0, 0x0)
	/usr/go/src/runtime/trace.go:511 +0x1f0 fp=0x1039fe0c sp=0x1039fde0
runtime.traceEvent(0x10d, 0x1039fec4, 0x2, 0x2)
	/usr/go/src/runtime/trace.go:411 +0x68a fp=0x1039feb4 sp=0x1039fe0c
runtime.traceGoCreate(0x103820a0, 0x21940)
	/usr/go/src/runtime/trace.go:734 +0x99 fp=0x1039fee4 sp=0x1039feb4
runtime.StartTrace(0x0, 0x0)
	/usr/go/src/runtime/trace.go:151 +0x146 fp=0x1039ff40 sp=0x1039fee4
runtime/pprof.StartTrace(0x30394bc0, 0x103e4420, 0x0, 0x0)
	/usr/go/src/runtime/pprof/pprof.go:624 +0x30 fp=0x1039ff5c sp=0x1039ff40
runtime/pprof_test.TestTraceDoubleStart(0x103e43c0)
	/usr/go/src/runtime/pprof/trace_test.go:51 +0x6c fp=0x1039ffb4 sp=0x1039ff5c
testing.tRunner(0x103e43c0, 0x259320)
	/usr/go/src/testing/testing.go:448 +0xb4 fp=0x1039ffe8 sp=0x1039ffb4
runtime.goexit()
	/usr/go/src/runtime/asm_386.s:2408 +0x1 fp=0x1039ffec sp=0x1039ffe8
created by testing.RunTests
	/usr/go/src/testing/testing.go:556 +0x833

goroutine 1 [chan receive]:
testing.RunTests(0x1d1018, 0x2592c0, 0xc, 0xc, 0x1)
	/usr/go/src/testing/testing.go:557 +0x86b
testing.(*M).Run(0x103c4060, 0x26f060)
	/usr/go/src/testing/testing.go:486 +0x5d
main.main()
	runtime/pprof/_test/_testmain.go:76 +0x176
exit status: 'pprof.test 24086: 2'
FAIL	runtime/pprof	0.284s

There is at least one buf in mem_plan9.go that can lead to memory corruption (the same memory returned by sysAlloc twice).
The following line in sysFree:
n += (n + memRound) &^ memRound
doubles n value: n += n
But even if you replace it with
n = (n + memRound) &^ memRound
It is still incorrect, because sysAlloc does not round n to page size, but sysFree does. So freeing won't happen for blocks that are not multiple of _PAGESIZE.
I would do the following. It has much simpler invariants: both bloc and n are always page-rounded:
--- a/src/runtime/mem_plan9.go
+++ b/src/runtime/mem_plan9.go
@@ -9,21 +9,24 @@ import "unsafe"
var bloc uintptr
var memlock mutex
-const memRound = _PAGESIZE - 1
+func memRound(p uintptr) uintptr {

  return (p + _PAGESIZE - 1) &^ (_PAGESIZE - 1)

+}
func initBloc() {

  bloc = uintptr(unsafe.Pointer(&end))

  bloc = memRound(uintptr(unsafe.Pointer(&end)))

}
func sbrk(n uintptr) unsafe.Pointer {
lock(&memlock)
// Plan 9 sbrk from /sys/src/libc/9sys/sbrk.c

  bl := (bloc + memRound) &^ memRound

  bl := bloc

  n = memRound(n)
  if brk_(unsafe.Pointer(bl+n)) < 0 {
          unlock(&memlock)
          return nil
  }

  bloc = bl + n

  bloc += n
  unlock(&memlock)
  return unsafe.Pointer(bl)

}
@@ -42,7 +45,7 @@ func sysFree(v unsafe.Pointer, n uintptr, stat *uint64) {
// from tiny/mem.c
// Push pointer back if this is a free
// of the most recent sysAlloc.

  n += (n + memRound) &^ memRound

  n = memRound(n)
  if bloc == uintptr(v)+n {
          bloc -= n
  }

I see that in your scenario the corruption thing actually happens:
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x30493000
sysAlloc return 0x30493000
10000
sysAlloc (65536, 0x275f80)
sbrk(65536)
sbrk return 0x304a3000
sysAlloc return 0x304a3000
sysFree (0x30493000, 65536, 0x275f80)
sysFree (0x304a3000, 65536, 0x275f80)
sysFree (0x30483000, 65536, 0x275f80)
The first sysFree(0x30493000) will move bloc to 0x30493000 even if it is not the last allocated block.
However, this does not seem to explain why brk fails.
Are you sure that brk can be used for shrinking at all? Can you do brk(0x20000000); brk(0x10000000); brk(0x15000000) at startup?

Thanks. Your fix seems to fix the corruption issue
and brk doesn't fail anymore.
After your fix, all the tests passes successfully.
=== RUN TestTraceStartStop
--- PASS: TestTraceStartStop (0.10s)
=== RUN TestTraceDoubleStart
--- PASS: TestTraceDoubleStart (0.00s)
=== RUN TestTrace
--- PASS: TestTrace (0.00s)
=== RUN TestTraceStress
--- PASS: TestTraceStress (4.36s)
=== RUN TestTraceSymbolize
--- PASS: TestTraceSymbolize (1.47s)

I think brk can be used for shrinking as well.


text:
containerRef is not working

this._scrollRef.scrollTop = 0;

If the code is readme, it will not work.
this._scrollRef._container.scrollTop = 0;

It works if you replace the code as above.

+1 - Same issue here

authors: ecfy hogenishi

repo: goldenyz/react-perfect-scrollbar

license: mit

license_source: bigquery


text:
Detect changes in permission schemes and apply those changes to DB object

Currently, the permission scheme is only applied to objects when they are created. If a scheme is modified, it won't affect existing objects
It would be nice to detect changes in the scheme and to apply them on all existing objects
In addition, a "sync grants" functionality would be useful to go w/ this

Should the permission schemes act as a declarative end-state, where an obevo deployment will always "upsert" privileges to match those in the permission scheme? E.g. going through all the objects, and making sure it has exactly what is declared in the permission schemes, nothing else, on every deployment? (or something to that effect)

authors: gs-husam shantstepanian

repo: goldmansachs/obevo


text:
docker examples

The quickstart page uses this broken links: https://github.com/golemcloud/golem-services/blob/main/docker-examples/docker-compose.yaml (docker-compose.yaml does not exist)

The actual docker-compose files in the docker-examples do not run per the given instructions reproduced below, given the required link correction:

curl -sSL https://raw.githubusercontent.com/golemcloud/golem-services/main/docker-examples/docker-compose-sqlite.yaml> docker-compose.yaml
docker-compose up
WARN[0000] The "REDIS_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "REDIS_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "SHARD_MANAGER_HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "SHARD_MANAGER_GRPC_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "SHARD_MANAGER_GRPC_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "GOLEM_SERVICE_GRPC_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "GOLEM_SERVICE_HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "GOLEM_SERVICE_HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "GOLEM_SERVICE_HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "GOLEM_SERVICE_GRPC_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "GOLEM_SERVICE_GRPC_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "REDIS_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "GOLEM_SERVICE_GRPC_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "WORKER_EXECUTOR_GRPC_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "WORKER_EXECUTOR_HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "SHARD_MANAGER_GRPC_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "WORKER_EXECUTOR_HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "WORKER_EXECUTOR_HTTP_PORT" variable is not set. Defaulting to a blank string.
validating /Users/johncoleman/golemcloud/docker-compose.yaml: services.golem-service.ports array items[0,1] must be unique

It would be useful to provide script to configure the ports which presumably would fix these issues, or just provide some sensible defaults such that the docker-compose is readily executable.

Thanks for reporting this

@JohnSColeman  If you could refer README while we update the quick start guide to get things going.
We are in the process of refining the documentation and site updates. Once again, thanks for proposing solutions/raising issues.

https://github.com/golemcloud/golem-services/blob/main/README.md

Documentation has been updated

authors: JohnSColeman afsalthaj vigoo

repo: golemcloud/golem-services


text:
6.0.43 is stable

Hello,
I believe https://community.ui.com/releases/UniFi-Network-Controller-6-0-43/b28bb453-927a-4dd8-82f7-40af28505510
6.0.43 is official and stable, you still have .41 as stable for 6.0 😀 Thanks

I can indeed confirm 6.0.43 has became stable. It was indeed release candidate before, but became stable now. @goofball222 Can you help update it? Thanks a lot!

I can indeed confirm 6.0.43 has became stable. It was indeed release candidate before, but became stable now. @goofball222 Can you help update it? Thanks a lot!

Commit 0452084 updates 6.0/official to 6.0.43 and closes this issue.

Commit 0452084 updates 6.0/official to 6.0.43 and closes this issue.


text:
Help regarding prediction of target variables for the year 2022

I have been trying to run an experiment where I'm trying to predict the target variables of graphcast for the year 2022. I am fetching my input data from CDS. The time taken to calculate forcings for a single day is taking me a very long time(2 hours plus). I don't think I'm following the right approach. How can i run this experiment quickly? For compute, I have a server which has access to 5 NVIDIA 100 GPUs. Any help would be greatly appreciated!

I keep getting this error while trying to make predictions using the /data4/home/rohitsuresh/graphcast_/model/params/params-GraphCast_operational-ERA5-HRES_1979-2021-resolution_0.25-pressure_levels_13-mesh_2to6-precipitation_output_only.npz model. My inputs, targets and forcings are all in the same resoltion as well
The error:
ValueError: 'grid2mesh_gnn/~_networks_builder/encoder_nodes_grid_nodes_mlp/~/linear_0/w' with retrieved shape (184, 512) does not match shape=[186, 512] dtype=dtype(bfloat16)

I was adding precipitation as an input.

repo: google-deepmind/graphcast


text:
Android Basics: xml-layouts

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-xml-layouts?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-xml-layouts#3
In which task and step of the codelab can this issue be found?
Add cost of service text field
Build the layout in XML
Describe the problem
Sentence before code:
Nice job! It doesn't do much yet, but you've got a good start and have edited some XML. The XML for your layout should look something like this.
android:padding="16dp" is added
Sentence before code:
At this point, your XML should look like this.
android:padding="16dp" is missing in final code with no clue for deleting it
Steps to reproduce?

Go to URL and find padding
Click on the latest appearance
See error in the final code appearance is missing

Versions
Android Studio version:  website study materials
API version of the emulator: website study materials
Additional information
Include screenshots if they would be useful in clarifying the problem.

@OlafusS5
The issue that you presented to us is important, and I thank you for bringing it to our attention. Actions are taken to fix it:
`
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context=".MainActivity">
<EditText
    android:id="@+id/plain_text_input"
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:inputType="text"/>

</androidx.constraintlayout.widget.ConstraintLayout>`


text:
Android Basics: xml-layouts

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-xml-layouts?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-xml-layouts#4
In which task and step of the codelab can this issue be found?
RadioGroup
Describe the problem
It is a typo in example you use for the last option okay an in the code OK
Steps to reproduce?
does not apply
Versions
does not apply
Additional information

@basd82
Thank you for reaching out to us. The typo is fixed and  will be published soon:


text:
Environment variable values containing a "=" are cut off

TL;DR
Using the env_vars input parameter, environment variable values that contain equals signs are cut off. This started to happen last week when the parsing method changed from indexOf to split.
Expected behavior
Given the input FOO=bar=baz. the value of FOO should be bar=baz.
Observed behavior
The value is bar.
Action YAML
- name: Deploy
  uses: google-github-actions/deploy-cloud-functions@v0.7.0
  with:
    env_vars: CONN=DefaultEndpointsProtocol=https;AccountName=foo;AccountKey=bar

Additional information
If split is preferred over indexOf, the following code should have the desired effect:
let [k, v] = pair.split((/=(.*)/), 2);

Thanks! I think that should solve it for our use case. It looks like it may remove consecutive and trailing equals signs though. This could cause problems with passwords for example, or base64 padding (if there are any decoders that care about that).
The most intuitive behavior to me would be to replicate the gcloud tool, which leaves everything after the first equals sign intact.

@coolstuff-mikael good point - updated the PR to use indexOf.

authors: coolstuff-mikael sethvargo


text:
[depth_from_video_in_the_wild]Bad depth  results on custom data.

Hello great work @gariel-google and team!
I tried training the model without any pretrained weights on about 5300 images for about 35 epochs and also provided possibly mobile masks for the moving objects as shown

I got the following loss graph

But the result of depth inference is :

The result without training and directly infering on cityscapes pretrained weights provided in the repo is little better.

I took the inference code from struct2depth and replaced their model with depth_from_video_in_the_wild's model
When I plot the egomotion with the trained model, it looks ok.
Can I know what might have gone wrong while training?
Any suggestion is greatly appreciated.
Thanks.

@poornimajd hi can you please share how you replaced the model in the inference code Struct2depth to get those results ? Thanks !

Hello @ikramabdel ,Its been a while since I did the inference,but I hope the following snippet works
`import numpy as np
import tensorflow as tf
from depth_from_video_in_the_wild import model
import cv2
import matplotlib.pyplot as plt
train_model = model.Model(img_height=None, img_width=None, batch_size=None, is_training=False)
sess = tf.Session()
saver = tf.train.Saver()
saver.restore(sess, './depth_from_video_in_the_wild/cityscapes_learned_intrinsics/model.ckpt')
image = cv2.imread('./depth_from_video_in_the_wild/rgb_image_93.jpgl.png')
inputs = cv2.resize(image, (416, 128))[np.newaxis,:]
depth = train_model.inference_depth(inputs, sess)
dd=(depth[0]*256)
cv2.imwrite('./depth_from_video_in_the_wild/depth.png',dd)
plt.figure(figsize=(20, 10))
plt.imshow(image)
plt.figure(figsize=(20, 10))
plt.imshow(1/depth[0,:,:,0], cmap='plasma')`

Hello @ikramabdel ,Its been a while since I did the inference,but I hope the following snippet works
import numpy as np
import tensorflow as tf
from depth_from_video_in_the_wild import model
import cv2
import matplotlib.pyplot as plt
train_model = model.Model(img_height=None, img_width=None, batch_size=None, is_training=False)
sess = tf.Session()
saver = tf.train.Saver()
saver.restore(sess, './depth_from_video_in_the_wild/cityscapes_learned_intrinsics/model.ckpt')
image = cv2.imread('./depth_from_video_in_the_wild/rgb_image_93.jpgl.png')
inputs = cv2.resize(image, (416, 128))[np.newaxis,:]
depth = train_model.inference_depth(inputs, sess)
dd=(depth[0]*256)
cv2.imwrite('./depth_from_video_in_the_wild/depth.png',dd)
plt.figure(figsize=(20, 10))
plt.imshow(image)
plt.figure(figsize=(20, 10))
plt.imshow(1/depth[0,:,:,0], cmap='plasma')

Thank for replying, how do you get a model.ckpt? i am loading model and the graph

authors: ikramabdel poornimajd

repo: google-research/google-research


text:
In CI, jinja has a dependency on MarkupSafe

I have it installed in my system, but it's not installed in the VM for CI.
I can just do a pip3 install in CI, but I think @dml wanted to avoid venv / pip3 / requirements.txt.

I have added markupsafe as a submodule, which resolves the issue.

repo: google/CFU-Playground


text:
Some keys can not be tapped on non English keyboard.

Hi,
I tried the EarlGrey, if you want to test non-English app, some keys can not be tapped, like "space". I tried with "fr", the space key should be "espace".
Besides of that, EarlGrey is great, thanks for making this.

@lestathc you should be able to type any language string using grey_replaceText() now. Please do give it a try.

In my case, I could put some Japanese into search field with grey_replaceText() .

I have added support for cyrillic letters in my fork of this repo.
This was done as a proof of concept only.
I will probably refactor this code to make support for different languages more scalable and then merge the fork back. I just have no time for this at the moment
You may take a look at this PR: https://github.com/Usipov/EarlGrey/pull/1/files

That's super awesome. I was planning to do the following to add support:

Allow custom gShiftLabels to be set, with an override option.
Allow custom modifier key identifiers - space, delete return etc.
Allow custom more, numbers & more, letters & Next Keyboard key identifiers.
Allow the ability for checking capitalization with the custom language.

Would that satisfy all the requirements?

@tirodkar, no, that's wouldn't
some characters require long tap and a following swipe gesture

authors: KazuCocoa Usipov lestathc tirodkar

repo: google/EarlGrey


text:
Add jetstream_request_success_count metric

Scrape results after running the following command:
seq 100 | xargs -P 100 -n 1 curl --request POST --header "Content-type: application/json" -s localhost:8000/generate --data '{
    "prompt": "Can you provide a comprehensive and detailed overview of the history and development of artificial intelligence.",
    "max_tokens": 200
}'

# HELP jetstream_request_success_count_total Number of requests successfully completed
# TYPE jetstream_request_success_count_total counter
jetstream_request_success_count_total{id="maxengine-server-5b6c99588c-z4ldf"} 100.0

@FanhaiLu1 could you help review the PR since Zijun is OOO, thanks!

source: gharchive/pull-request

repo: google/JetStream


text:
[Remote Debugging] regression: opening websites via port forwarding results in errors

Inspecting and opening locally hosted websites with the DevTools "remote devices" via port forwarding that does not work reliably anymore since Chrome 70. Opening a website on an android device connected via USB via the "remote devices" features results in errors ERR_CONNECTION_REFUSED sometimes ERR_EMPTY_RESPONSE.
Installing an older version of Chrome (tested with version 69) resolves the issues, indicating that this is a regression introduced in the public version 70 release of Chrome.
More info and comments regarding this issue can be found on this reddit thread.

Closing in favor of existing bug report at chromium bug tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=896603

repo: google/WebFundamentals


text:
Add Inside look at modern web browser part 1

Adding new /update post
Target Live Date: 2018-09-05

[x] This has been reviewed and approved by @Meggin and others in separate google doc
[x] I have run npm test locally and all tests pass.
[x] I have added the appropriate type-something label.
[x] I've staged the site and manually verified that my content displays correctly.

CC: @petele

Whoops!
There were 3 warnings that will prevent this PR from being merged. Please take a look, and either fix, or provide a justification for why they can't be fixed.
WARNINGS
src/content/en/updates/2018/09/inside-browser-part1.md#L8 - Unknown tag 'inside-browser' found, use an existing tag, or add it to 'src/data/commonTags.json'.
src/content/en/updates/2018/09/inside-browser-part1.md#L173 - Common typo found: 'omnibox' Should it be 'address bar'? See: https://developers.google.com/style/word-list#omnibox
src/content/en/updates/2018/09/inside-browser-part1.md#L80 - Line must be at most 100 characters

:+1:

:+1:

:+1:

:tada: This has been pushed live to https://developers.google.com/web/

authors: WebFundBot kosamari


text:
[Pager] Unwanted scrolling during configuration updates

Description
When using a pager in an activity that handles orientation configuration changes, the pager is unable to maintain its scroll position and may even change its current page.
pager.webm
Steps to reproduce
Add android:configChanges="orientation" to the activity declaration in the manifest.
Minimal repro:
class LauncherActivity : ComponentActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            HorizontalPager(2, Modifier, rememberPagerState(2)) { page ->
                BasicText(page.toString(), Modifier, TextStyle.Default.copy(fontSize = 50.sp))
            }
        }
    }

}

Expected behavior
The pager should retain its offset and page across orientation changes

Thank you. We are tracking it as a bug in Compose UI here - https://issuetracker.google.com/issues/236391559

authors: andkulikov jan-berge-ommedal

repo: google/accompanist


text:
Improve FhirEngine Search performance for sorting

Describe the bug
When loading around 7k patients ordered by Patient.Name, the db query takes around 25s
Without sorting the query takes around 35ms
This is when using
fhirEngine.search<Patient> {
        filter(Patient.ACTIVE, { value = of(true) })
        sort(Patient.NAME, Order.ASCENDING)
        count = PaginationConstant.DEFAULT_PAGE_SIZE
        from = currentPage * PaginationConstant.DEFAULT_PAGE_SIZE
      }

that generates SQL query
SELECT a.resourceUuid, a.serializedResource
FROM ResourceEntity a
         LEFT JOIN StringIndexEntity b
                   ON a.resourceType = b.resourceType AND a.resourceUuid = b.resourceUuid AND b.index_name = 'name'
WHERE a.resourceType = 'Patient'
  AND a.resourceUuid IN (SELECT resourceUuid
                         FROM TokenIndexEntity
                         WHERE resourceType = 'Patient'
                           AND index_name = 'active'
                           AND index_value = 'true')
ORDER BY b.index_value ASC
LIMIT 20 OFFSET 0

Tested out that removing the ORDER BY b.index_value ASC reduces the latency of the query to milliseconds
Expected behavior
The usecase of loading resources with sort should be more performant
Additional context
Here's a link to the resources db containing around 7k patients, that can be used for testing
https://drive.google.com/file/d/1TgPw36BFI8BijsUPc1JkQE3l3RXANYzT/view?usp=drive_link
Would you like to work on the issue?
Please state if this issue should be assigned to you or who you think could help to solve this issue.

Can you tell me how does it perform without filter of active Patients ?

It is worth noting that the above latency difference is observable even on non-device sqlite db browsers like SQLiteStudio.

Can you tell me how does it perform without filter of active Patients ?

Removing the subquery that performs this filter has no impact on the performance.

One improvement I can think of is removing a.resourceType = b.resourceType clause in JOIN statement as we are filtering resourceType using WHERE clause. But not sure if this is feasible or even if it's gonna improve the performance

Removing this does improve the performance as well, executing the query in milliseconds cc LZRS

thank you very much for catching this @LZRS! very happy for the improvement in @MJ1998 's pr.
just one comment for clarification and potential future work: https://github.com/google/android-fhir/pull/2553#issuecomment-2142169138

repo: google/android-fhir


text:
Cloud Functions

Hi All,
Before deploying the function, what should the index.js file contain?
Here is what I indicated for the package.json :
  "name": "argon",
  "version": "0.0.1",
  "description": "DCM Reporting to BigQuery connector",
  "main": "app.js",
  "engines": {
    "node": ">=10"
  },
  "scripts": {
    "start": "node app.js",
    "start-dev": "nodemon app.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Google Inc.",
  "license": "Apache-2.0",
  "dependencies": {
    "@google-cloud/bigquery": "^2.0.6",
    "google-auth-library": "^3.0.1",
    "hapi": "^18.0.0",
    "luxon": "^1.10.0"
  },
  "devDependencies": {
    "eslint": "^5.12.1",
    "eslint-config-google": "^0.11.0",
    "nodemon": "^1.18.9"
  }
}
but I don't know what to write in the index.js
Do you have an idea?

Thanks a lot !

Thanks for your help!

Hi Paul,
You can now pull the latest version (3.4.0), which fixes Cloud Function deployments via index.js.
Do let me know how it goes!
Thanks,
Arvind

authors: achembarpu paulakcelrod

repo: google/argon


text:
Fixed typos in README.md

Fixes #<issue_number_goes_here>

It's a good idea to open an issue first for discussion.

[x] Tests pass
[x] Appropriate changes to README are included in PR

Thanks for your contribution!

repo: google/attention-center


text:
Support customizations to get and set scroll position

Fixes #1812: Create a DesignScrollCallbacks customization where a developer can set two scroll callbacks. First, a setScrollableState callback that is called to get a ScrollableState object. This object can be used to set the scroll position. Second, a scrollStateChanged callback that is called whenever the scroll state changes, providing the scroll position, max scroll position, frame size and content size.

Going to put this on hold until https://github.com/google/automotive-design-compose/pull/1852 is in. Since I am manually implementing scrolling, I'm able to get the exact scroll position and expose it. However for LazyVerticalGrid, I only have access to LazyGridState, which derives from ScrollableState. This has access to functions that set the scroll position and get the scroll offset of the first visible item, but nothing to get the actual pixel scroll position. Calculating that would be fairly complicated since items in a grid view can be different sizes and have different column/row spans. I'm going to wait to see if that data is really necessary to expose.

This change will require some documentation, but I would like to get some feedback before adding it in case the API changes.

I added comments, and will add more in the documentation.

repo: google/automotive-design-compose


text:
Use inlineSourceMaps for better test coverage checks

General testing improvement... we can now see more accurate coverage numbers and missing lines.
Previously:

Now

(note this is just one test). We can see now it covers the .ts files instead of .js files.
Signed-off-by: campionfellin campionfellin@gmail.com

[x] npm run test succeeds.
[x] npm run lint succeeds.
[ ] Appropriate changes to README are included in PR.

But won't this add source maps to the version published to npm? We probably want this tsconfig option just to be applied when testing.

I think that should be fine. What would the problem be in publishing source maps to npm?

Also, thanks for the PRs! I sometimes forget to say thanks.

Np! It is a good learning opportunity for me!

authors: campionfellin grant

repo: google/clasp


text:
Fix typo in docs/typescript.md

Fixes #<issue_number_goes_here> (it's a good idea to open an issue first for discussion)

Small change :)
replace(browers, browsers)

[x] npm run test succeeds.
[x] npm run lint succeeds.
[ ] Appropriate changes to README are included in PR.

Another typo was found!

Corrected!

Thanks!

authors: campionfellin takanakahiko


text:
Null argument for Array.prototype.indexOf

Calling Array.prototype.indexOf on an array of a non-nullable type with a parameter null is currently forbidden:
/** @type {Array<string>} */ var arr = [];
var i = arr.indexOf(null);
// → WARNING - actual parameter 1 of Array.prototype.indexOf does not match formal parameter

The reason is the following extern in es3.js:
/**
 * Available in ECMAScript 5, Mozilla 1.6+.
 * @param {T} obj
 * @param {number=} opt_fromIndex
 * @return {number}
 * @this {IArrayLike<T>|string}
 * @nosideeffects
 * @template T
 * @see http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
 */
Array.prototype.indexOf = function(obj, opt_fromIndex) {};

I think the null parameter should be allowed, though in that case indexOf will always return -1.

If you have an Array<string> (that is, you don't expect nulls in the array) then there is no good reason to pass null. Of course you can do it just as you can pass a number, or an Object, but it makes no sense to do it.
If you do expect nulls, annotate the array as Array<?string>.

Of course you can do it just as you can pass a number, or an Object

Right, so maybe the parameter obj can be annotated with {*}.
It seems to me that a shortcoming of the current annotation is that the following code is not allowed, which I believe is always safe:
/**
 * @param {!Array<string>} arr
 * @param {?string} obj
 * @return {number}
 */
function foo(arr, obj) {
  return arr.indexOf(obj);
}

To avoid the warning, I need to rewrite the code as follows:
/**
 * @param {!Array<string>} arr
 * @param {?string} obj
 * @return {number}
 */
function foo(arr, obj) {
  return obj ? arr.indexOf(obj) : -1;
}

I can put up with this limitation, but I prefer the first code for its conciseness.

You can cast obj to string with /** @type {string} */ (obj).

I think the current behavior is correct. The use case you mentioned doesn't seem to warrant a relaxation on the type annotation, so I'm closing this.

authors: Dominator008 MatrixFrog kwkbtr

repo: google/closure-compiler


text:
Support top-level await

As of Safari 15, all major browsers will support top-level await. However it looks like Closure Compiler doesn't support this. (It also appears to be missing a specific flag to indicate module input or output, perhaps that is related.)
Tested with v20210601, in.js: await null;
Command line: java -jar ./compiler.jar --js in.js --js_output_file out.js
Observed result:
in.js:1:0: ERROR - [JSC_PARSE_ERROR] Parse error. 'await' used in a non-async function context
  1| await null;
     ^

1 error(s), 0 warning(s)

Expected result: allow usage of top-level await.

AFAICT, changing the way modules load would require some pretty invasive changes to our broader internal JS stack, and not just the Closure compiler.

Top level await requires either the output to be a module OR the output to have an async IIFE. We should be able to support this when the chunk type is ES_MODULE, but we need a new flag otherwise.

authors: AshleyScirra ChadKillingsworth rishipal


text:
Refine type returns of createElement()

For https://github.com/google/closure-library/issues/570

I signed the CLA

@joeltine - does the travis failure look legit or is it a tool failure?  The error I see under "details" is
Line 1085, E:0251: Invalid suppression type: newCheckTypes
Line 1086, E:0217: Missing @return JsDoc in function with non-trivial return
which doesn't seem relevant to this change.

It's not legit. Those are known lint issues w/ base.js.

@psam44 can you squash all these commits so that we can pull it in as a single commit?
To do this:
git rebase -i master

and then change all but the first pick to squash.  Then you can rebase it on top of upstream/master (or whatever you've named our repo's remote).  When you push the branch back to your fork, you'll need to use git push -f to force it to rewrite your history (otherwise it will tell you to pull and merge, which undoes everything you'd just done).

Superseded by https://github.com/google/closure-library/pull/584

authors: joeltine psam44 shicks

repo: google/closure-library


text:
Implement http basic account manager

This PR includes two commits:

The first commit creates a BasicAccountManager which follows the HTTP Basic Authentication to get the username from a HTTP request.
The second commit labels the owner of the created docker container based on the user from BasicAccountManager.

BTW, I added write permission on this github repo to @denniscy1993 for merging PR, doing presubmit checks, and changing reviewers freely. FYI, @ser-io & @jemoreira

What happens if user info is not included in http request? and can we specific user/pw in cvdr for now?

If using the new http basic account manager and there's no user info the request should fail. We can continue using the unix account manager in a lab environment for now. And yes, for cvdr the next step would be to extend the authentication options with http basic credentials: similar to this: https://github.com/google/cloud-android-orchestration/pull/264/commits/0a09977043d30086e81205320e5a0fd0c268701e

With this PR, user would receive http.StatusBadRequest if the user info is not included in the http request when using HTTPBasicAccountManager. Thanks @ser-io for the reference, I'll continue to work on adding http basic credentials to cvdr.

repo: google/cloud-android-orchestration


text:
Popup covers the area where a student is typing

The documentation popup is in an inconvenient place.  When you've typed a function and want to know the arguments, it's logical to hover over that function name.  But that puts the popup tooltip right over the text cursor, so you can't see.  You have to move the mouse back and forth on and off the function name.

@nixorn FYI.  This looks hard in general.  The popup is relative to the mouse pointer, but the request here is that if it would cover up the text cursor, we try different placement rules to avoid this.  Might require a change in the hover plugin?
I'll look into it if you don't get to it, so please update the bug if you discover anything.

I've been looking at other popups, and noticed that a common rule seems to be "pop up above the element if possible... otherwise below the element".  That seems like an improvement to me.  I'd also like the popup to be relative to the span, not the mouse pointer.  I think those two changes together would solve this problem.

Looks this really requires changes to addon. Code which updates positions of hover here https://github.com/angelozerr/CodeMirror-Extension/blob/master/addon/hover/text-hover.js#L15
I going to fork this repo, make changes + PR, and make npm in https://github.com/google/codeworld/blob/master/install.sh#L256 install addon from my github.

related issue https://github.com/angelozerr/CodeMirror-Extension/issues/4

authors: cdsmith nixorn

repo: google/codeworld


text:
Create USGS_NLCD_RELEASES_2019_REL_RCMAP_V5_COVER.js

create RCMAP V5 Cover js file in the examples section

catalog/USGS/NLCD_RELEASES/2019_REL/RCMAP/V5/COVER

local id = 'USGS/NLCD_RELEASES/2019_REL/RCMAP/V5/COVER';
local subdir = 'USGS/NLCD_RELEASES';
local ee_const = import 'earthengine_const.libsonnet';
local ee = import 'earthengine.libsonnet';
local template = import 'RCMAP.libsonnet';
local basename = std.strReplace(id, '/', '_');
local self_ee_catalog_url = ee_const.ee_catalog_url + basename;
template + {
'gee:skip_indexing': true,
id: id,
title: 'RCMAP Rangeland Component Timeseries v5 (1985-2021)',
version: 'v5',
links: ee.standardLinks(subdir, id) + [
],
providers: [
ee.producer_provider('United States Geological Survey and Bureau of Land Management', 'https://www.mrlc.gov/'),
ee.host_provider(self_ee_catalog_url),
],
}

Closing:

a4c7db14019c744d9c95118b50b0ec93523db427 added this file
I will check for any changes and make sure they are captured

authors: ajgriebel schwehr

repo: google/earthengine-catalog


text:
[Tutorial proposal] First day of snow

What is the objective of the proposed tutorial?
A clear and concise description of what users can expect to learn from your tutorial.
What is the scope of the proposed tutorial?
The thematic (forestry, water resources, land cover classification, Earth Engine core libraries, etc) and specific geographic area, if relevant.
Please provide an outline of the structure of the proposed tutorial?

Section 1
a. Subsection 1a
b. Subsection 1b
Section 2
.. et cetera. ..

In what format will you be submitting the tutorial?
Select one: Markdown or Colab
This request will be reviewed by the Earth Engine community maintainers, who will reply on this issue tracker with any questions or suggestions. Once approved, this issue will be assigned to you and you can begin work on the tutorial following instructions in Writing a tutorial. When ready, enter “Closes #issueno” in the description of your Pull Request to link the tutorial to this issue.
Issue labels:
proposal, tutorial

Hi @aharmstrong! Thanks for the tutorial in #161! Could you kindly provide the info above so we can vet it before proceeding? Thanks!

@gino-m I'd like to request that tutorial #161 be exempt from the proposal step. @aharmstrong and I have been collaborating on it since before the proposal step was implemented.
@aharmstrong, before beginning work on future tutorials, please submit a proposal first.

Sure! Sorry I didn't realize you'd already been discussing this before we introduced this new process. Please disregard!

authors: gino-m jdbcode

repo: google/earthengine-community


text:
Navigate inside 3d model

Is there any example on how I can navigate inside the 3d model?

You can try gltf_viewer with the -c argument which enables FREE_FLIGHT mode in our camera manipulator helper library, which is documented here.
WASD-style controls are accepted in FilamentApp::manipulatorKeyFromKeycode.

authors: Zumbalamambo prideout

repo: google/filament