Build Storj from Source for arch armel/ARMv5 builderror: "build constraints exclude all Go files"

I build storj for my ARMv5 stroage node myself, so far without any problems. But after version 1.37.2 I always get the following error message while building:

package storj.io/storj/cmd/connect-test
        imports storj.io/common/rpc/quic: build constraints exclude all Go files in /home/maxl95/go/pkg/mod/storj.io/common@v0.0.0-20210915201516-56ad343b6a7e/rpc/quic

This is how I build:

CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc GOOS=linux GOARCH=arm GOARM=5 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o bin/ ./cmd/...

Unfortunately, I have no idea how to fix the error. Maybe someone can help me?

I used such Dockerfile to build a storagenode:

FROM --platform=linux/arm/v5 golang:1.17-alpine as build
# RUN apt update && apt dist-upgrade -y && apt install npm -y
RUN apk add npm git bash gcc libc-dev
RUN git clone https://github.com/storj/storj.git && cd storj && git checkout v1.39.6
RUN cd storj/web/storagenode && npm install && npm run build && cd ../.. \
    && go get github.com/go-bindata/go-bindata/go-bindata \
    && go-bindata -prefix web/storagenode/ -fs -o storagenode/console/consoleassets/bindata.resource.go -pkg consoleassets web/storagenode/dist/... web/storagenode/static/... \
    && /usr/bin/env echo -e '\nfunc init() { FileSystem = AssetFile() }' >> storagenode/console/consoleassets/bindata.resource.go \
    && gofmt -w -s storagenode/console/consoleassets/bindata.resource.go
RUN cd storj && ./scripts/release.sh install ./cmd/storagenode

FROM --platform=linux/arm/v5 alpine
RUN apk add libc6-compat
WORKDIR /app
COPY --from=build /go/bin/storagenode /app/storagenode
COPY --from=build /go/storj/cmd/storagenode/dashboard.sh /app/
COPY --from=build /go/storj/cmd/storagenode/entrypoint /
EXPOSE 28967
EXPOSE 14002
ENTRYPOINT [ "/entrypoint" ]

And this docker-compose.yaml to build and run it:

version: "3.7"
services:
  storagenode6:
    container_name: storagenode6
    restart: always
    stop_grace_period: 300s
    image: storagenode:arm
    build: .
    ports:
      - "28971:28967/tcp"
      - "28971:28967/udp"
      - "14006:14002"
    volumes:
      - type: bind
        source: /mnt/storj/storagenode6/identity/
        target: /app/identity
      - type: bind
        source: /mnt/storj/storagenode6/
        target: /app/config
    environment:
      - WALLET=0x000...
      - EMAIL=email
      - ADDRESS=external.address:28971
      - STORAGE=500GB
    command:
      - "--operator.wallet-features=zksync"
      - "--storage2.trust.sources=https://www.storj.io/dcs-satellites"
      # - "--log.level=info"
      # - "--log.development=false"
      # - "--log.caller=false"

So you can try to do it like this:

git clone https://github.com/storj/storj.git
cd storj
git checkout v1.39.6
cd web/storagenode
npm install
npm build
cd -
go get github.com/go-bindata/go-bindata/go-bindata
go-bindata -prefix web/storagenode/ -fs -o storagenode/console/consoleassets/bindata.resource.go -pkg consoleassets web/storagenode/dist/... web/storagenode/static/...
/usr/bin/env echo -e '\nfunc init() { FileSystem = AssetFile() }' >> storagenode/console/consoleassets/bindata.resource.go
gofmt -w -s storagenode/console/consoleassets/bindata.resource.go
./scripts/release.sh install ./cmd/storagenode

in ../bin you would have a binary

@Alexey thank you. that worked.

1 Like