Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: 'go build -compiler=gccgo' fails silently when the package path is 'm' #34358

Closed
bcmills opened this issue Sep 17, 2019 · 3 comments
Closed

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Sep 17, 2019

This program silently fails to emit output:

cd m
go build -compiler=gccgo

-- m/go.mod --
module m
-- m/hello.go --
package main
func main() { println("hello") }

Changing the module path to (seemingly) anything other than m causes the test to fail with the symptom in #30344.

If the source file is appropriately located within GOPATH/src, varying the value of GO111MODULE does not seem to make a difference.

CC @ianlancetaylor @thanm @cherrymui @jayconrod

@bcmills bcmills added this to the Unplanned milestone Sep 17, 2019
@bcmills bcmills added the GoCommand label Sep 17, 2019
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Sep 18, 2019

This is happening because of the code in internal/goroot.(*gccgoDirs).isStandard that tries to determine whether a path exists in the standard library. The typical set of search directories for Go packages will include /usr/lib/x86_64-linux-gnu. Typically the file libm.so will exist in that directory. That will be enough for isStandard to decide that that standard library package exists.

The code there is a replica of what gccgo does internally. But gccgo goes on to actually open the file and look for gccgo export data. If it doesn't find any, it moves on. I think that for purposes of this code it will suffice to only look for .gox files.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Sep 18, 2019

Change https://golang.org/cl/196120 mentions this issue: internal/goroot: for -compiler=gccgo, only look for .gox files

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Sep 19, 2019

Change https://golang.org/cl/196518 mentions this issue: cmd/go: change the gccgo 'package m' regression test to run in GOPATH mode

gopherbot pushed a commit that referenced this issue Sep 19, 2019
… mode

This test is failing in the builders due to the deployed versions of
gccgo not supporting module mode. However, the bug reproduced in
GOPATH mode too, so that mode should be fine for a regression test.

Updates #34358

Change-Id: I954132a96849e80e8783d4de10389fcab7b14af2
Reviewed-on: https://go-review.googlesource.com/c/go/+/196518
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.