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

make install should not make binaries if already exist #4367

Closed
AkihiroSuda opened this issue Oct 29, 2019 · 4 comments · Fixed by #4762
Closed

make install should not make binaries if already exist #4367

AkihiroSuda opened this issue Oct 29, 2019 · 4 comments · Fixed by #4762
Assignees
Labels
do-not-close kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@AkihiroSuda
Copy link
Collaborator

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description
make install should not make binaries if already exist

Steps to reproduce the issue:

suda@suda-ws01:~/gopath/src/github.com/containers/libpod$ which go
/usr/local/go/bin/go
suda@suda-ws01:~/gopath/src/github.com/containers/libpod$ make
From github.com:AkihiroSuda/libpod
 + a56131fe...a5aa44c5 master     -> origin/master  (forced update)
 + a69654f3...95b57cfb v1.0       -> origin/v1.0  (forced update)
touch .gopathok
GO111MODULE=off go generate ./cmd/podman/varlink/...
GO111MODULE=on go build -mod=vendor  -gcflags 'all=-trimpath=/home/suda/gopath/src/github.com/containers/libpod' -asmflags 'all=-trimpath=/home/suda/gopath/src/github.com/containers/libpod' -ldflags ' -X gith
ub.com/containers/libpod/libpod.gitCommit=a56131fef4a82824b397c94f6b7edcdb24769624 -X github.com/containers/libpod/libpod.buildInfo=1572361198 -X github.com/containers/libpod/libpod.installPrefix=/usr/local -
X github.com/containers/libpod/libpod.etcDir=/etc' -tags "   containers_image_ostree_stub selinux systemd exclude_graphdriver_devicemapper seccomp varlink" -o bin/podman github.com/containers/libpod/cmd/podma
n
GO111MODULE=on go build -mod=vendor  -gcflags 'all=-trimpath=/home/suda/gopath/src/github.com/containers/libpod' -asmflags 'all=-trimpath=/home/suda/gopath/src/github.com/containers/libpod' -ldflags ' -X gith
ub.com/containers/libpod/libpod.gitCommit=a56131fef4a82824b397c94f6b7edcdb24769624 -X github.com/containers/libpod/libpod.buildInfo=1572361207 -X github.com/containers/libpod/libpod.installPrefix=/usr/local -
X github.com/containers/libpod/libpod.etcDir=/etc' -tags "   containers_image_ostree_stub selinux systemd exclude_graphdriver_devicemapper seccomp varlink remoteclient" -o bin/podman-remote github.com/containers/libpod/cmd/podman
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
WARNING: go-md2man does not handle node type HTMLSpan
suda@suda-ws01:~/gopath/src/github.com/containers/libpod$ sudo make install
make: go: Command not found
The authenticity of host 'github.com (52.69.186.44)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])?  ^C

Describe the results you received:

make && sudo make install fails because sudo make install attempts to make binaries with different env vars.

Describe the results you expected:
make install should just install existing binaries without compiling already existing binaries.

Output of podman version:
a56131f

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 29, 2019
@baude
Copy link
Member

baude commented Oct 29, 2019

please submit a PR to fix this.

@rhatdan
Copy link
Member

rhatdan commented Oct 29, 2019

Can we change it so both commands use the same environment variables?

@AkihiroSuda
Copy link
Collaborator Author

Not just same envvar, because root should not write files under non-root home.

@github-actions
Copy link

This issue had no activity for 30 days. In the absence of activity or the "do-not-close" label, the issue will be automatically closed within 7 days.

NevilleC added a commit to NevilleC/libpod that referenced this issue Jan 4, 2020
Changes I am making:

1. The target `.gopathok` was listed in `.PHONY` which
looks wrong as it regenerates `.gopathok` every time we
 re-run it, which was a part of the issue. I removed it
 to avoid that. If `.gopathok` is present', makefile
should not need to rerun it.

2. Ensure the binaries are created only if they don't
exist by adding `bin/podman`
and `bin/podman-remote`.

3. Add a `SOURCES = $(shell find . -name "*.go")` and put
it as a dependency of the podman binaries target. It allows us
to re-generate the binaries only when there is a change in the
source files. The downside is it increases the running time of
the command that generates them (20 seconds on my virtual machine
running Centos 7). If this is a problem, we could introduce a
hidden file that would list all the files to track, that
would need to be updated only when a dev is introducing new files.

4. Fixed the make package-install as it does not work with yum.
I updated the build_rpm.sh to ensure it works on centos 7
and centos 8 with no pre-required installation.

Closes containers#4367

Signed-off-by: Neville Cain <[email protected]>
@NevilleC NevilleC self-assigned this Jan 5, 2020
@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
do-not-close kind/bug Categorizes issue or PR as related to a bug. 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.

5 participants