-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 fmt fails in symlinked directory #32725
Comments
Note that you are misreading the |
In general symbolic links are problematic for the go tool. It needs to know the import path of a directory, and using a symbolic link breaks that. I don't know if this particular case can be handled better. |
Sorry about this. The correct strace output is:
Note that the problem does not occut with all symlinks (some of them just work). I did not manage to identify exactly why some do and why others don't. |
There have been a number of symlink-related fixes since the (You can obtain runnable wrappers for those using |
I installed
I have to investigate a bit further why it works with some symlinks, please leave open, I will try to find more info soon. |
So I managed to reproduce on my machine... The problem happens only when source code is in a directory called It happened that my sources were in an Steps to reproduce
Once I am in Or maybe this is the intended behavior of setting Thank you |
Thanks. What about a |
File #!/bin/bash
export GOPATH=/tmp/test
gotip version
mkdir -p /tmp/test || true
cd /tmp/test
mkdir -p src/alpha/bravo
echo "package main" > ./src/alpha/bravo/main.go
ln -s /tmp/test/src/alpha/bravo ./link 2>&- || true
cd link
gotip fmt Output
|
Ran the script from @sguillia above. Can confirm the same results:
|
Closing this issue. Please reopen if it's still a problem. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
If latest release is go 1.12 then yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have one directory which is a clone of my git repo. Let's call it
project
.I have a symbolic link to that directory. Let's call it
link
.This works fine
This does not work fine
What did you expect to see?
I expected
go fmt
to work with no error.What did you see instead?
I saw a
no such file or directory
error, but the file exists.Additional information
go fmt
in thelink
directory fails 100% of the time.50% of time,
futex
fails.50% of time,
waitid
fails.This runs in the docker environment of my cloud CI, Codeship. I am reporting the bug here since everything else works fine.
Thank you
The text was updated successfully, but these errors were encountered: