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

libpod make fails when GOPATH is not defined #1842

Closed
ssbarnea opened this issue Nov 21, 2018 · 1 comment · Fixed by #2330
Closed

libpod make fails when GOPATH is not defined #1842

ssbarnea opened this issue Nov 21, 2018 · 1 comment · Fixed by #2330
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@ssbarnea
Copy link
Collaborator

ssbarnea commented Nov 21, 2018

go language does not make GOPATH variable mandatory and states that it will default to ~/go when is not defined.

It seems that libpod Makefile is smart enough to detect if code was cloned in an unexpected location and to symlink it to ~/go/src/github.com/containers/libpod but the problem is that this does not make it work.

When this happens go fails to build its dependencies as it end-up looking for them relative to the "resolved" location of podman.

Still, runnning make without GOPATH fails because of this. here is the proof:

This is a serious issue because for non golang developers there are 9/10 changes that exactly this will happen: they will not have GOPATH defined and they will clone the code to another folder.

We need to find a way to make it work when this happens (without requiring any user intervension as this would be key for automating the installation).

$ make                                                                                                                                                                                                                                                               touch .gopathok
go build -i -ldflags '-L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/nss/lib  -L/usr/local/opt/libarchive/lib -L/usr/local/opt/icu4c/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -X github.com/containers/libpod/libpod.gitCommit="23feb0d6f9a6a43e44f959c99100ae24d6c27f6d" -X github.com/containers/libpod/libpod.buildInfo=1542803025' -tags "seccomp btrfs_noversion exclude_graphdriver_btrfs containers_image_ostree_stub   varlink exclude_graphdriver_devicemapper" -o bin/podman github.com/containers/libpod/cmd/podman
can't load package: package github.com/containers/libpod/cmd/podman: cannot find package "github.com/containers/libpod/cmd/podman" in any of:
/usr/local/Cellar/go/1.11.2/libexec/src/github.com/containers/libpod/cmd/podman (from $GOROOT)
/Users/ssbarnea/go/src/github.com/containers/libpod/_output/src/github.com/containers/libpod/cmd/podman (from $GOPATH)
make: *** [podman] Error 1
FAIL: 2

Originally mentioned on #1840

@ghost
Copy link

ghost commented Feb 4, 2019

Thanks for mentioning this.

I couldn't get the build to work for confusing reasons pertaining to varlink not being found (I'm not familiar with Go) and it turned out it was because I defined the GOPATH to be somewhere else than suggested by the installation README.

Now that I defined it exactly as in the README, the build works as intended.

baude added a commit to baude/podman that referenced this issue Feb 13, 2019
when gopath was not explicitly set, make would fail due
to the varlink generator.  this symlink in the makefile
addresses that.

fixes: containers#1842

Signed-off-by: baude <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants