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 test -c` does not respect gcflags sometimes [1.11 backport] #28346

Closed
gopherbot opened this Issue Oct 24, 2018 · 9 comments

Comments

Projects
None yet
10 participants
@gopherbot
Copy link

gopherbot commented Oct 24, 2018

@ianlancetaylor requested issue #27681 to be considered for backport to the next 1.11 minor release.

As far as I can see, this hasn't been fixed on tip yet. CC @bcmills

@gopherbot please open a backport to 1.11

@katiehockman

This comment has been minimized.

Copy link
Contributor

katiehockman commented Oct 29, 2018

Approved since this is a regression. Please follow the instructions at https://github.com/golang/go/wiki/MinorReleases to create the cherrypick CL.

@katiehockman

This comment has been minimized.

Copy link
Contributor

katiehockman commented Oct 30, 2018

Removed the approved label since the original CL has not been merged yet. Once it is, and the issue is closed, this can be re-approved assuming it is still appropriate for backport.

@bradfitz bradfitz modified the milestones: Go1.11.2, Go1.11.3 Nov 1, 2018

@bradfitz

This comment has been minimized.

Copy link
Member

bradfitz commented Nov 1, 2018

Bumping to Go 1.11.3 since there's no fix on master yet.

@heschik heschik added the Debugging label Nov 19, 2018

@dmitshur dmitshur modified the milestones: Go1.11.3, Go1.11.4 Dec 13, 2018

@FiloSottile FiloSottile modified the milestones: Go1.11.4, Go1.11.5 Dec 15, 2018

@webern

This comment has been minimized.

Copy link

webern commented Dec 31, 2018

I cannot tell from the Github issues what patch version of go1.11 the backport resolution of this issue is slated for. I would like to know when this will be/is fixed.

The most recent comment from @bradfitz suggests 1.11.3, but 1.11.4 has already been released.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented Dec 31, 2018

There is still no fix on master.

@katiehockman

This comment has been minimized.

Copy link
Contributor

katiehockman commented Jan 4, 2019

The change has been fixed on master, approved the cherry pick after speaking with @jayconrod. Sounds like this meets the backport criteria of being a serious issue with no workaround.

@jayconrod

This comment has been minimized.

Copy link
Contributor

jayconrod commented Jan 4, 2019

@aarzilli Would you mind creating a cherry-pick CL, following the procedure at Making cherry-pick CLs? I'd be happy to review and approve again.

@gopherbot

This comment has been minimized.

Copy link
Author

gopherbot commented Jan 4, 2019

Change https://golang.org/cl/156377 mentions this issue: [release-branch.go1.11] cmd/go: respect gcflags, ldflags in 'go test'

@gopherbot

This comment has been minimized.

Copy link
Author

gopherbot commented Jan 7, 2019

Closed by merging e39e43d to release-branch.go1.11.

@gopherbot gopherbot closed this Jan 7, 2019

gopherbot pushed a commit that referenced this issue Jan 7, 2019

[release-branch.go1.11] cmd/go: respect gcflags, ldflags in 'go test'
Fixes bug introduced by https://golang.org/cl/129059 where
gcflags='all=...' and ldflags='all=...' would not be applied to some
packages built by 'go test'.

LoadImport used to set gcflags/ldflags for the Package objects it
created, in https://golang.org/cl/129059 this code was factored out to
setToolFlags. The codepath of `go build` was updated to call
setToolFlags appropriatley, but the codepath of `go test -c` wasn't,
resulting in gcflags/ldflags being applied inconsistently when building
tests.

This commit changes TestPackagesFor to call setToolFlags on the package
objects it creates.

Fixes #28346

Change-Id: Idcbec0c989ee96ec066207184611f08818873e8d
Reviewed-on: https://go-review.googlesource.com/c/136275
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
(cherry picked from commit 374546d)
Reviewed-on: https://go-review.googlesource.com/c/156377
Run-TryBot: Alessandro Arzilli <alessandro.arzilli@gmail.com>

@julieqiu julieqiu modified the milestones: Go1.11.5, Go1.11.6 Jan 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.