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: error while trying to overwrite a built binary #25774

Closed
agnivade opened this issue Jun 7, 2018 · 3 comments
Closed

cmd/go: error while trying to overwrite a built binary #25774

agnivade opened this issue Jun 7, 2018 · 3 comments
Labels
arch-wasm WebAssembly issues FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@agnivade
Copy link
Contributor

agnivade commented Jun 7, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version devel +33f1768 Thu Jun 7 01:19:13 2018 +0000 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/agniva/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/agniva/play/go"
GORACE=""
GOROOT="/home/agniva/play/gosource/go"
GOTMPDIR=""
GOTOOLDIR="/home/agniva/play/gosource/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build730496659=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Build any wasm binary with js/wasm env vars. Then build the same binary again.

GOOS=js GOARCH=wasm gotip build -o binary file.go
Update code.
Then again - GOOS=js GOARCH=wasm gotip build -o binary file.go

What did you expect to see?

Binary builds fine. Overwrites existing binary. Just like it happens for normal builds for other platforms.

What did you see instead?

go build command-line-arguments: build output "binary" already exists and is not an object file

This is annoying during the dev cycle, because now I have to delete the binary every time I need to re-build.

I think we just need to add the wasm magic header in the objectMagic slice in cmd/go/internal/work/exec.go .

Can send a CL if this sounds good.

@agnivade agnivade added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. arch-wasm WebAssembly issues labels Jun 7, 2018
@agnivade agnivade added this to the Go1.11 milestone Jun 7, 2018
@agnivade
Copy link
Contributor Author

agnivade commented Jun 7, 2018

/cc @neelance

@neelance
Copy link
Member

neelance commented Jun 7, 2018

I think we just need to add the wasm magic header in the objectMagic slice in cmd/go/internal/work/exec.go .

Sounds good.

@agnivade agnivade added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 7, 2018
@gopherbot
Copy link

Change https://golang.org/cl/116915 mentions this issue: cmd/go/internal: add wasm magic header

@agnivade agnivade removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 7, 2018
@ALTree ALTree changed the title [wasm]cmd/go: error while trying to overwrite a built binary cmd/go: error while trying to overwrite a built binary Jun 7, 2018
@golang golang locked and limited conversation to collaborators Jun 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly issues FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants