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

Can not build image locally on ARM64(M1 Mac) due to missing packr binaries #5884

Closed
3 tasks done
s50600822 opened this issue Mar 26, 2021 · 1 comment
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@s50600822
Copy link
Contributor

s50600822 commented Mar 26, 2021

This affect M1 Mac (ARM64) only.

If you are trying to resolve an environment-specific issue or have a one-off question about the edge case that does not require a feature then please consider asking a question in argocd slack channel.

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug: do make on master
  • I've pasted the output of argocd version: this is master

To Reproduce
do make on master, maybe clean all your cached images first.
Broken at line

COPY --from=builder /usr/local/bin/packr /usr/local/bin/packr
Because there's no /usr/local/bin/packr in builder

Checking the builder itself, there seems to be several things in there that doesn't match the expectation.
If we spin up FROM golang:1.16.2 as builder
and peform the steps in ininstall-packr-linux.sh, there won't be:
$GOPATH/src/github.com/gobuffalo/packr or $GOPATH/bin/packr
and there won't be a $BIN/packr for downstream.

All I can see in GOPATH after go get are:

./pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gobuffalo/[email protected]
./pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gobuffalo/[email protected]
./pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gobuffalo/[email protected]
./pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gobuffalo/[email protected]
./pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gobuffalo/packr
./pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gobuffalo/[email protected]
./pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gobuffalo/[email protected]
./pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gobuffalo/[email protected]
./pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gobuffalo/[email protected]
./pkg/mod/cache/download/github.com/gobuffalo/packr
./pkg/mod/github.com/gobuffalo/[email protected]
./pkg/mod/github.com/gobuffalo/[email protected]/packr.go
./pkg/mod/github.com/gobuffalo/[email protected]/packr
./pkg/mod/github.com/gobuffalo/[email protected]/packr_test.go
./pkg/mod/github.com/gobuffalo/[email protected]
./pkg/mod/github.com/gobuffalo/[email protected]/packr.go
./pkg/mod/github.com/gobuffalo/[email protected]/packr
./pkg/mod/github.com/gobuffalo/[email protected]/packr_test.go
./pkg/mod/github.com/gobuffalo/[email protected]/packrd
./pkg/mod/github.com/gobuffalo/[email protected]/packrd/packed-packr.go

Both bin and src are empty.

Expected behavior
make can build the final image successfully

Screenshots

Screen Shot 2021-03-27 at 12 47 40 am

master

Build Log

➜  argo-cd git:(master) ✗ make
docker build --build-arg UID=501 -t argocd-test-tools -f test/container/Dockerfile .
[+] Building 50.4s (21/31)
 => [internal] load build definition from Dockerfile                                                                                                                         0.4s
 => => transferring dockerfile: 3.44kB                                                                                                                                       0.0s
 => [internal] load .dockerignore                                                                                                                                            0.5s
 => => transferring context: 340B                                                                                                                                            0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.10                                                                                                              4.2s
 => [internal] load metadata for docker.io/library/node:12.18.4                                                                                                              4.1s
 => [internal] load metadata for docker.io/library/golang:1.16.0                                                                                                             5.2s
 => [internal] load metadata for docker.io/library/redis:6.2.1                                                                                                               4.2s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                                0.0s
 => [auth] library/redis:pull token for registry-1.docker.io                                                                                                                 0.0s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                                                                                0.0s
 => [auth] library/node:pull token for registry-1.docker.io                                                                                                                  0.0s
 => [internal] load build context                                                                                                                                            0.5s
 => => transferring context: 17.09kB                                                                                                                                         0.0s
 => CACHED [node 1/1] FROM docker.io/library/node:12.18.4@sha256:8cfe7e8dc60095a4f9d25a3f0f208503559fa033a15e2ddd87dee85bec101a2e                                            0.1s
 => CACHED [redis 1/1] FROM docker.io/library/redis:6.2.1@sha256:e97d506be34a39fa69f45eea846080d6985c2c9ee338c0d408c7ea4347f014a5                                            0.1s
 => [golang 1/1] FROM docker.io/library/golang:1.16.0@sha256:b49b3a05d21c645a98425a006f4449bd155e74505ee19f772dd9b7432f8bd660                                                0.0s
 => [stage-3  1/17] FROM docker.io/library/ubuntu:20.10@sha256:5ecc0d5a84c0d82444a97da0391058d01f40d0594e54b065d431092dc5f7ed43                                              0.0s
 => CACHED [stage-3  2/17] RUN  apt-get update && apt-get install -y         ca-certificates         curl         openssh-server         nginx         fcgiwrap         git  0.0s
 => CACHED [stage-3  3/17] COPY --from=golang /usr/local/go /usr/local/go                                                                                                    0.0s
 => CACHED [stage-3  4/17] ADD ./hack/tool-versions.sh .                                                                                                                     0.0s
 => CACHED [stage-3  5/17] ADD ./hack/install.sh .                                                                                                                           0.0s
 => [stage-3  6/17] ADD ./hack/installers installers                                                                                                                         0.5s
 => ERROR [stage-3  7/17] RUN ./install.sh dep-linux &&     ./install.sh packr-linux &&     ./install.sh ksonnet-linux &&     ./install.sh helm2-linux &&     ./install.sh  43.1s
------
 > [stage-3  7/17] RUN ./install.sh dep-linux &&     ./install.sh packr-linux &&     ./install.sh ksonnet-linux &&     ./install.sh helm2-linux &&     ./install.sh helm-linux &&     ./install.sh kubectl-linux &&     ./install.sh kustomize-linux &&     ./install.sh codegen-tools &&     ./install.sh codegen-go-tools &&     ./install.sh lint-tools &&     go get github.com/mattn/goreman &&     go get github.com/kisielk/godepgraph &&     go get github.com/jstemmer/go-junit-report &&     rm -rf /tmp/dl &&     rm -rf /tmp/helm &&     rm -rf /tmp/helm2 &&     rm -rf /tmp/ks_* &&     rm -rf /tmp/packr:
#19 1.085 + export DOWNLOADS=/tmp/dl
#19 1.085 + DOWNLOADS=/tmp/dl
#19 1.085 + export BIN=/usr/local/bin
#19 1.085 + BIN=/usr/local/bin
#19 1.085 + mkdir -p /tmp/dl
#19 1.087 + ARCHITECTURE=
#19 1.087 + case $(uname -m) in
#19 1.088 ++ uname -m
#19 1.089 + dpkg --print-architecture
#19 1.090 + grep -q arm64
#19 1.092 + ARCHITECTURE=arm64
#19 1.092 + '[' -z arm64 ']'
#19 1.092 + for product in $*
#19 1.092 ++ dirname ./install.sh
#19 1.093 + ARCHITECTURE=arm64
#19 1.093 + ./installers/install-dep-linux.sh
#19 1.094 + '[' -e /tmp/dl/dep ']'
#19 1.094 + curl -sLf --retry 3 -o /tmp/dl/dep https://github.com/golang/dep/releases/download/v0.5.3/dep-linux-arm64
#19 13.65 + cp /tmp/dl/dep /usr/local/bin/
#19 13.67 + chmod +x /usr/local/bin/dep
#19 13.67 + dep version
#19 13.67 dep:
#19 13.67  version     : v0.5.3
#19 13.67  build date  : 2019-05-13
#19 13.67  git hash    : 192eb44
#19 13.67  go version  : go1.12.5
#19 13.67  go compiler : gc
#19 13.67  platform    : linux/arm64
#19 13.67  features    : ImportDuringSolve=false
#19 13.68 + export DOWNLOADS=/tmp/dl
#19 13.68 + DOWNLOADS=/tmp/dl
#19 13.68 + export BIN=/usr/local/bin
#19 13.68 + BIN=/usr/local/bin
#19 13.68 + mkdir -p /tmp/dl
#19 13.68 + ARCHITECTURE=
#19 13.68 + case $(uname -m) in
#19 13.68 ++ uname -m
#19 13.68 + dpkg --print-architecture
#19 13.68 + grep -q arm64
#19 13.68 + ARCHITECTURE=arm64
#19 13.68 + '[' -z arm64 ']'
#19 13.68 + for product in $*
#19 13.68 ++ dirname ./install.sh
#19 13.68 + ARCHITECTURE=arm64
#19 13.68 + ./installers/install-packr-linux.sh
#19 13.68 ++ dirname ./installers/install-packr-linux.sh
#19 13.68 + . ./installers/../tool-versions.sh
#19 13.68 ++ helm2_version=2.17.0
#19 13.68 ++ helm3_version=3.5.1
#19 13.68 ++ jq_version=1.6
#19 13.68 ++ ksonnet_version=0.13.1
#19 13.68 ++ kubectl_version=1.17.8
#19 13.68 ++ kubectx_version=0.6.3
#19 13.68 ++ kustomize3_version=3.9.4
#19 13.68 ++ packr_version=1.21.9
#19 13.68 ++ protoc_version=3.7.1
#19 13.68 ++ swagger_version=0.19.0
#19 13.68 + PACKR_VERSION=1.21.9
#19 13.68 + case $ARCHITECTURE in
#19 13.68 + go get -u github.com/gobuffalo/packr
#19 16.68 go: downloading github.com/gobuffalo/packr v1.30.1
#19 35.88 go: downloading github.com/gobuffalo/envy v1.7.0
#19 35.88 go: downloading github.com/gobuffalo/packd v0.3.0
#19 36.76 go: downloading github.com/gobuffalo/envy v1.9.0
#19 36.96 go: downloading github.com/rogpeppe/go-internal v1.3.0
#19 36.96 go: downloading github.com/joho/godotenv v1.3.0
#19 37.24 go: downloading github.com/gobuffalo/packd v1.0.0
#19 38.15 go: downloading github.com/rogpeppe/go-internal v1.8.0
#19 42.65 + cd /go/src/github.com/gobuffalo/packr
#19 42.65 ./installers/install-packr-linux.sh: line 11: cd: /go/src/github.com/gobuffalo/packr: No such file or directory
#19 42.65 + cd /go/src/github.com/gobuffalo/packr
#19 42.65 ./installers/install-packr-linux.sh: line 12: cd: /go/src/github.com/gobuffalo/packr: No such file or directory
#19 42.65 + mv /go/bin/packr /usr/local/bin/packr
#19 42.65 mv: cannot stat '/go/bin/packr': No such file or directory
------
executor failed running [/bin/sh -c ./install.sh dep-linux &&     ./install.sh packr-linux &&     ./install.sh ksonnet-linux &&     ./install.sh helm2-linux &&     ./install.sh helm-linux &&     ./install.sh kubectl-linux &&     ./install.sh kustomize-linux &&     ./install.sh codegen-tools &&     ./install.sh codegen-go-tools &&     ./install.sh lint-tools &&     go get github.com/mattn/goreman &&     go get github.com/kisielk/godepgraph &&     go get github.com/jstemmer/go-junit-report &&     rm -rf /tmp/dl &&     rm -rf /tmp/helm &&     rm -rf /tmp/helm2 &&     rm -rf /tmp/ks_* &&     rm -rf /tmp/packr]: exit code: 1
make: *** [test-tools-image] Error 1```

Could be https://github.com/argoproj/argo-cd/pull/5904.
@s50600822 s50600822 added the bug Something isn't working label Mar 26, 2021
@s50600822 s50600822 changed the title Can not build image locally due to missing packr binaries Can not build image locally on ARM64(M1 Mac) due to missing packr binaries Mar 30, 2021
@s50600822
Copy link
Contributor Author

See #4211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant