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

bcmills opened this issue Sep 17, 2019 · 3 comments


Copy link

@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

This comment has been minimized.

Copy link

@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 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.


This comment has been minimized.

Copy link

@gopherbot gopherbot commented Sep 18, 2019

Change mentions this issue: internal/goroot: for -compiler=gccgo, only look for .gox files


This comment has been minimized.

Copy link

@gopherbot gopherbot commented Sep 19, 2019

Change 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
Run-TryBot: Bryan C. Mills <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Than McIntosh <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.