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 local fails if docker is not installed #8055

Closed
4censord opened this issue Jul 27, 2024 · 6 comments · Fixed by #8056
Closed

make local fails if docker is not installed #8055

4censord opened this issue Jul 27, 2024 · 6 comments · Fixed by #8056
Assignees
Labels
Needs triage We need discussion to understand problem and decide the priority

Comments

@4censord
Copy link

What steps did you take and what happened:

I'm usually using the velero client via the aur package. (https://aur.archlinux.org/packages/velero). Recently, the build stopped working.

(the exact same behaviour happens with just the git repo, without build as an AUR package)

What did you expect to happen:

The PKGBUILD runs make like this:

make GIT_TREE_STATE=clean VERSION=v$pkgver local

Where $pkgver is the version that is being build.

Before, builds were working no problem.
Recently, they hung forever with the following output

$ make GIT_TREE_STATE=clean VERSION=v$pkgver local
which: no docker in (/home/user/.guix-profile/bin:/home/user/.config/guix/current/bin:/home/user/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/user/go/bin:/home/user/.local/bin:/home/user/.meteor:/home/user/.cargo/bin:/home/user/.krew/bin:/home/user/.nix-profile/bin:/home/user/.guix-profile/bin:/home/user/.config/guix/current/bin:/nix/var/nix/profiles/default/bin:/home/user/.nix-profile/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/user/.local/share//flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)

I've bisected this, and the first bad commit is 8f8bc9f.
Reverting just this commit makes the build work again on main.

The following information will help us better understand what's going on:

Please provide the output of the following commands

None of these are applicable, as this is a build problem

Environment:

Building on archlinux, without having the docker binary in the path.

@blackpiglet blackpiglet added the Needs info Waiting for information label Jul 28, 2024
@blackpiglet
Copy link
Contributor

blackpiglet commented Jul 28, 2024

I didn't meet this issue while building the upstream Velero release-1.14 branch code in my local environment.

make local
GOOS=darwin \
        GOARCH=arm64 \
        GOBIN=$(pwd)/.go/bin \
        VERSION=main \
        REGISTRY=velero \
        PKG=github.com/vmware-tanzu/velero \
        BIN=velero \
        GIT_SHA=cd601cafdf5d62633e252b13853b79a57138ab61 \
        GIT_TREE_STATE=clean \
        OUTPUT_DIR=$(pwd)/_output/bin/darwin/arm64 \
        ./hack/build.sh
[~/go/src/github.com/vmware-tanzu/velero] [release-1.14]

@4censord
Copy link
Author

Have you ensured you don't have any docker binary in your path?

I've written down more detailed repro steps below.

While docker is present, it works fine:

$ git rev-parse HEAD
d9ca14747925630664c9e4f85a682b5fc356806d
$ which docker
/usr/bin/docker
$ make local
GOOS=linux \
GOARCH=amd64 \
GOBIN=$(pwd)/.go/bin \
VERSION=main \
REGISTRY=velero \
PKG=github.com/vmware-tanzu/velero \
BIN=velero \
GIT_SHA=d9ca14747925630664c9e4f85a682b5fc356806d \
GIT_TREE_STATE=clean \
OUTPUT_DIR=$(pwd)/_output/bin/linux/amd64 \
./hack/build.sh

Then, after removing the docker binary from the path, it starts failing:

$ git clean -fxd ; and git reset --hard origin/main
Removing .go/
Removing _output/
HEAD is now at d9ca1474 Merge pull request #7963 from Lyndon-Li/issue-fix-7620-design
$ git rev-parse HEAD
d9ca14747925630664c9e4f85a682b5fc356806d
# Removing docker
$ sudo rm $(which docker)
$ which docker
which: no docker in (/home/user/.guix-profile/bin:/home/user/.config/guix/current/bin:/home/user/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/user/go/bin:/home/user/.local/bin:/home/user/.meteor:/home/user/.cargo/bin:/home/user/.krew/bin:/home/user/.nix-profile/bin:/home/user/.guix-profile/bin:/home/user/.config/guix/current/bin:/nix/var/nix/profiles/default/bin:/home/user/.nix-profile/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/user/.local/share//flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)

$ make local 
which: no docker in (/home/user/.guix-profile/bin:/home/user/.config/guix/current/bin:/home/user/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/user/go/bin:/home/user/.local/bin:/home/user/.meteor:/home/user/.cargo/bin:/home/user/.krew/bin:/home/user/.nix-profile/bin:/home/user/.guix-profile/bin:/home/user/.config/guix/current/bin:/nix/var/nix/profiles/default/bin:/home/user/.nix-profile/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/user/.local/share//flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)

[hangs on this for >3 minutes]
[the usual build finishes in under 1min for me]

@blackpiglet
Copy link
Contributor

I have the same issue after removing the docker CLI in my environment.

@kaovilai
Please take a look at this issue.

@blackpiglet blackpiglet added Needs triage We need discussion to understand problem and decide the priority and removed Needs info Waiting for information labels Jul 29, 2024
@kaovilai
Copy link
Contributor

Thanks for catching that. Will get a fix up

@blackpiglet
Copy link
Contributor

/assign @kaovilai

@kaovilai
Copy link
Contributor

Fixed in #8056

No longer hangs without docker in path

❯ which docker; time make local
docker not found
GOOS=darwin \
        GOARCH=arm64 \
        GOBIN=$(pwd)/.go/bin \
        VERSION=main \
        REGISTRY=velero \
        PKG=github.com/vmware-tanzu/velero \
        BIN=velero \
        GIT_SHA=9172ba88c8aaebfdd56751818ceabfaad48752b2 \
        GIT_TREE_STATE=clean \
        OUTPUT_DIR=$(pwd)/_output/bin/darwin/arm64 \
        ./hack/build.sh
make local  0.78s user 1.27s system 241% cpu 0.847 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs triage We need discussion to understand problem and decide the priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants