-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: 'go build' fails when current directory and output directory are symlinks on Windows #27515
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
Comments
See golang/go#27515 for context [#160287101] Signed-off-by: Andrew Keesler <[email protected]>
This reverts commit 020a875. We are holding off on upgrading to Go 1.11 until the following symlink issue is fixed: golang/go#27515. Signed-off-by: Andrew Keesler <[email protected]>
@ankeesler I can reproduce this here, thank you very much.. It is broken on the tip too. Alex |
Thanks @andybons + @alexbrainman. Let me know if you need anything else from me, happy to help. |
Defensively checks if $BOSH_INSTALL_TARGET is a link, if so it installs binaries in the link's target See golang/go#27515 for more context This can be reverted once we have a go version with the fix [#160103190](https://www.pivotaltracker.com/story/show/160103190)
I'm sorry this broke but we just fundamentally do not support magic tricks with symlinks. The answer is almost certainly to stop trying to trick the go command using symlinks. |
@rsc thanks for taking a look here. We were hoping that since this works on Linux and it has worked in previous versions on Windows, then it would continue to function the same way going forward. Windows symlinks can certainly by annoying at times (most times). All this being said, is there any chance that this will be fixed in a future go version? We are working with an interface that expects the directory hierarchy outlined in my initial comment. Since this works on Linux, it will likely be difficult, if not impossible, for us to change the hierarchy. This interface is used in our automated deployment tooling for Kubernetes. |
I have used https://play.golang.org/p/xYnM-XHKDve to find the commit that broke the test:
It looks like cmd/go fails when it calls os.MkdirAll, which calls os.Stat of So this looks like a dup of #27225 or very similar. If someone wants to have these 2 issues fixed, please, review https://golang.org/cl/134195 . Alex |
Temporary workaround for golang/go#27515 Co-authored-by: Julia Nedialkova <[email protected]>
- defensively checks if $BOSH_INSTALL_TARGET is a link - if so it installs binaries in the link's target See golang/go#27515 for more context This can be reverted once we have a go version with the fix [#160669222](https://www.pivotaltracker.com/story/show/160669222)
- defensively checks if $BOSH_INSTALL_TARGET is a link - if so it installs binaries in the link's target See golang/go#27515 for more context This can be reverted once we have a go version with the fix [#160669222](https://www.pivotaltracker.com/story/show/160669222)
Defensively checks if $BOSH_INSTALL_TARGET is a link, if so it installs binaries in the link's target See golang/go#27515 for more context This can be reverted once we have a go version with the fix Signed-off-by: Amin Jamali <[email protected]> Signed-off-by: Yael Harel <[email protected]>
Defensively checks if $BOSH_INSTALL_TARGET is a link, if so it installs binaries in the link's target See golang/go#27515 for more context This can be reverted once we have a go version with the fix Signed-off-by: Amin Jamali <[email protected]> Signed-off-by: Micah Young <[email protected]>
Change https://golang.org/cl/143578 mentions this issue: |
@ankeesler please try https://go-review.googlesource.com/c/go/+/143578 Does it fixes your problem? Thank you. Alex |
@alexbrainman thank you for your work on this. We will try this out and let you know. |
@alexbrainman we verified that this change does indeed fix the issue. Thank you. |
Thank you for checking. I will have it reviewed and submitted. Alex |
What version of Go are you using (
go version
)?go version go1.11 windows/amd64
Does this issue reproduce with the latest release?
Yes. This is a regression from go1.10.3.
What operating system and processor architecture are you using (
go env
)?Windows Server 1709 (OS Version 10.0.16299) and Windows Server 1803 (OS Version 10.0.17134).
What did you do?
On Windows, create this directory structure.
From the directory
C:\some-directory\src2\
, rungo build -o c:\some-directory\src2\hello\hello.exe .\hello.go
.What did you expect to see?
The command succeeds and builds
hello.exe
in the directoryC:\some-directory\hello\
.What did you see instead?
The text was updated successfully, but these errors were encountered: