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: -x flag does not produce executable output #9052

Closed
davecheney opened this issue Nov 3, 2014 · 5 comments
Closed

cmd/go: -x flag does not produce executable output #9052

davecheney opened this issue Nov 3, 2014 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@davecheney
Copy link
Contributor

dfc@qnap:~$ go build -x os/user
WORK=/tmp/go-build337667835
mkdir -p $WORK/os/user/_obj/
mkdir -p $WORK/os/
cd /home/dfc/go/src/os/user
CGO_LDFLAGS="-g" "-O2" /home/dfc/go/pkg/tool/linux_arm/cgo -objdir
$WORK/os/user/_obj/ -- -I $WORK/os/user/_obj/ lookup_unix.go
** SNIP *

The key is the assignment to CGO_LDFLAGS should be ="-g -O2", but is
incorrectly '-g", "-O2" which will cause the shell to look for a command,
"-O2"

$ CGO_LDFLAGS="-g" "-O2" /home/dfc/go/pkg/tool/linux_arm/cgo -objdir
$WORK/os/user/_obj/ -- -I $WORK/os/user/_obj/ lookup_unix.go
-bash: -O2: command not found
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-go1.5.

@bradfitz bradfitz modified the milestone: Go1.5 Dec 16, 2014
@rsc rsc removed the repo-main label Apr 14, 2015
@rsc rsc changed the title cmd/go: -x flag does not produce reproducible output cmd/go: -x flag does not produce executable output Apr 20, 2015
@rsc
Copy link
Contributor

rsc commented Jun 8, 2015

go build -x is not about producing an exact shell script. This kind of bug has been filed before (maybe about dist?), but of course it depends on the quoting rules of the shell and more. I'm not terribly inclined to try to shove those rules into cmd/go. If you want to use %q that's fine, but it still won't be shell input.

@rsc rsc modified the milestones: Unplanned, Go1.5 Jun 8, 2015
@bcmills
Copy link
Contributor

bcmills commented Jan 23, 2019

TestExecBuildX seems to verify that the output is, in fact, executable.

Was this issue fixed as part of #21427? If it is still reproducible, is there a small change we can make to TestExecBuildX to detect it?

(CC @hirochachacha)

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 23, 2019
@gopherbot
Copy link

Change https://golang.org/cl/84736 mentions this issue: cmd/go: make -x output commands executable again

@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Feb 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants