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

Makefile won't work with a symlinked project #4

Closed
jmrodri opened this issue May 3, 2017 · 7 comments · Fixed by #5
Closed

Makefile won't work with a symlinked project #4

jmrodri opened this issue May 3, 2017 · 7 comments · Fixed by #5
Assignees

Comments

@jmrodri
Copy link
Contributor

jmrodri commented May 3, 2017

I put all of my projects in $HOME/dev/some/path. For my golang projects I symlink the projects into my $GOPATH.

GOPATH=/home/jesusr/dev
mkdir -p $GOPATH/src/github.com/openshift/
pushd $HOME/dev
git clone git@github.com:jmrodri/open-service-broker-sdk.git
popd
pushd $GOPATH/src/github.com/openshift
ln -s $HOME/dev/open-service-broker-sdk .
popd

Now if you go into the symlinked directory and run make test you get an error:

pushd $GOPATH/src/github.com/openshift/open-service-broker-sdk
[jesusr@speed3 open-service-broker-sdk{master}]$ make test
glide install --strip-vendor --strip-vcs --update-vendored
[WARN]	The --update-vendored flag is deprecated. This now works by default.
[WARN]	The --strip-vcs flag is deprecated. This now works by default.
[WARN]	stat /home/jesusr/dev/open-service-broker-sdk/src: no such file or directory
[WARN]	stat /home/jesusr/dev/open-service-broker-sdk/vendor/src: no such file or directory
[ERROR]	Could not find any of /home/jesusr/dev/open-service-broker-sdk//src, /home/jesusr/dev/open-service-broker-sdk//vendor/src.
[INFO]	As of Glide 0.5/Go 1.5, this is required.
[ERROR]	Without src, cannot continue.
Makefile:142: recipe for target '.init' failed
make: *** [.init] Error 1

Looks like the ROOT tries to figure out where you are and that doesn't work with symlinks.

@pmorie
Copy link
Contributor

pmorie commented May 4, 2017

working on this now

@pmorie pmorie mentioned this issue May 4, 2017
@pmorie pmorie closed this as completed in #5 May 5, 2017
@jmrodri
Copy link
Contributor Author

jmrodri commented May 10, 2017

The specific scenario under which I hit this issue does not yet work.

  1. clone project to some directory
  2. create a symlink to the project, locate the symlink in your GOPATH
  3. attempt to build
  4. fails

If I comment out the export GOPATH line in the Makefile everything works as I'd expect. I'm not sure if there are any other side effects of doing this though.

@jmrodri jmrodri reopened this May 10, 2017
@jmrodri
Copy link
Contributor Author

jmrodri commented May 10, 2017

  1. checkout code directly into GOPATH, WORKS
  2. checkout code directly into GOPATH, create symlink FROM another dir, WORKS
  3. checkout code outside GOPATH, create symlink IN GOPATH, FAILS

@eparis
Copy link
Member

eparis commented May 10, 2017

In general symlinks + golang == failure. There are long standing incompatibilities with golang and symlinks which are constantly closed by the golang core team with an explanation that golang does not support symlinks. Whenever anything comes along that works the golang core team's answer is "great that works, but it might not tomorrow, you must follow the golang way"

kubernetes and openshift try to make symlink hacks work when we know they can, but in general we will not invest time into making it work. After enough hits on the head it becomes apparent that if one can not change the golang core team the only option is to conform.

@jmrodri
Copy link
Contributor Author

jmrodri commented May 11, 2017

@eparis that's understandable. But if I comment out the export GOPATH defined in the Makefile all three of my scenarios work fine. If it's not something we plan to fix, then I can close and just live with it.

@jmrodri
Copy link
Contributor Author

jmrodri commented May 11, 2017

Fixed by PR #12

@bparees
Copy link
Contributor

bparees commented May 17, 2017

closing since this was fixed, but we still have a bad "getting started" experience since we now rely on the user having a valid GOPATH defined, as well as a proper directory structure.

@bparees bparees closed this as completed May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants