diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 511bd92fa..c7faea9f4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -55,7 +55,22 @@ jobs: GIT_COMMIT=${{ github.sha }} REPO_URL=https://github.com/openfaas/faas-cli tags: openfaas/faas-cli:${{ github.sha }} - - + - + name: Test the redistributable binaries cross-compile + uses: docker/build-push-action@v7 + with: + context: . + file: ./Dockerfile.redist + push: false + load: false + platforms: linux/amd64 + target: release + build-args: | + VERSION=latest-dev + GIT_COMMIT=${{ github.sha }} + REPO_URL=https://github.com/openfaas/faas-cli + tags: openfaas/faas-cli-redist:${{ github.sha }} + - name: Copy binary to host run: | docker create --name faas-cli openfaas/faas-cli:${{ github.sha }} && \ diff --git a/.gitignore b/.gitignore index 01974abac..c6e0a5ec5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ build faas-cli faas-cli-darwin faas-cli-darwin-arm64 -faas-cli-armhf faas-cli.exe faas-cli-arm64 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 087662f74..3cba75515 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,7 +56,7 @@ To build the release binaries type in: ./extract_binaries.sh ``` -This creates the faas-cli for Mac, Windows, Linux x64, Linux ARMHF and Linux ARM64. +This creates the faas-cli for Mac, Windows, Linux x64 and Linux ARM64. * The project manages dependencies using Go modules and the `vendor/` folder. When updating a dependency you must run diff --git a/Dockerfile.redist b/Dockerfile.redist index d7f0f7b6a..a88dfdd5f 100644 --- a/Dockerfile.redist +++ b/Dockerfile.redist @@ -55,13 +55,6 @@ RUN CGO_ENABLED=0 GOOS=windows go build --ldflags "-s -w \ -X github.com/openfaas/faas-cli/commands.Platform=x86_64" \ -o faas-cli.exe -FROM builder as arm -RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build --ldflags "-s -w \ - -X github.com/openfaas/faas-cli/version.GitCommit=${GIT_COMMIT} \ - -X github.com/openfaas/faas-cli/version.Version=${VERSION} \ - -X github.com/openfaas/faas-cli/commands.Platform=armhf" \ - -o faas-cli-armhf - FROM builder as arm64 RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build --ldflags "-s -w \ -X github.com/openfaas/faas-cli/version.GitCommit=${GIT_COMMIT} \ @@ -83,7 +76,6 @@ WORKDIR /home/app COPY --from=linux /go/src/github.com/openfaas/faas-cli/faas-cli . COPY --from=darwin /go/src/github.com/openfaas/faas-cli/faas-cli-darwin . COPY --from=darwin-arm64 /go/src/github.com/openfaas/faas-cli/faas-cli-darwin-arm64 . -COPY --from=arm /go/src/github.com/openfaas/faas-cli/faas-cli-armhf . COPY --from=windows /go/src/github.com/openfaas/faas-cli/faas-cli.exe . COPY --from=arm64 /go/src/github.com/openfaas/faas-cli/faas-cli-arm64 . diff --git a/Makefile b/Makefile index a15df6691..f1893d1bf 100644 --- a/Makefile +++ b/Makefile @@ -65,14 +65,6 @@ dist: test-unit: go test $(shell go list ./... | grep -v /vendor/ | grep -v /template/ | grep -v build) -cover -.PHONY: ci-armhf-push -ci-armhf-push: - (docker push openfaas/faas-cli:$(TAG)-armhf && docker push openfaas/faas-cli:$(TAG)-root-armhf) - -.PHONY: ci-armhf-build -ci-armhf-build: - (./build.sh $(TAG)-armhf) - .PHONY: ci-arm64-push ci-arm64-push: (docker push openfaas/faas-cli:$(TAG)-arm64 && docker push openfaas/faas-cli:$(TAG)-root-arm64) diff --git a/build_integration_test.sh b/build_integration_test.sh index 898dfad71..474e49076 100755 --- a/build_integration_test.sh +++ b/build_integration_test.sh @@ -23,13 +23,6 @@ get_package() { ;; esac ;; - "Linux") - case $arch in - "armv6l" | "armv7l") - cli="./faas-cli-armhf" - ;; - esac - ;; esac echo "Using package $cli" diff --git a/commands/local_run_resources.go b/commands/local_run_resources.go index 414b89ea6..5bd2e8415 100644 --- a/commands/local_run_resources.go +++ b/commands/local_run_resources.go @@ -136,7 +136,7 @@ func negativeMemoryError(value string) error { func oversizedMemoryError(value string) error { // Typed as int64 so the constant does not take its default type of int, - // which overflows when cross-compiling for a 32-bit target such as armhf. + // which would overflow when building for a 32-bit target. return fmt.Errorf("invalid memory value %q: must be under %d bytes", value, int64(math.MaxInt64)) } diff --git a/extract_binaries.sh b/extract_binaries.sh index 95e96636b..294216e15 100755 --- a/extract_binaries.sh +++ b/extract_binaries.sh @@ -15,7 +15,6 @@ docker create --name faas-cli openfaas/faas-cli:${eTAG} && \ docker cp faas-cli:/home/app/faas-cli ./bin && \ docker cp faas-cli:/home/app/faas-cli-darwin ./bin && \ docker cp faas-cli:/home/app/faas-cli-darwin-arm64 ./bin && \ - docker cp faas-cli:/home/app/faas-cli-armhf ./bin && \ docker cp faas-cli:/home/app/faas-cli-arm64 ./bin && \ docker cp faas-cli:/home/app/faas-cli.exe ./bin && \ docker rm -f faas-cli diff --git a/npm/lib.js b/npm/lib.js index 0063f68cd..dcabf75ed 100644 --- a/npm/lib.js +++ b/npm/lib.js @@ -18,10 +18,6 @@ module.exports = { if (arch === 'aarch64') { return '-arm64'; } - - if (arch === 'armv61' || arch === 'armv71') { - return '-armhf' - } } if (type === 'Darwin') { diff --git a/npm/test.js b/npm/test.js index 9d4048e45..733ab90ec 100644 --- a/npm/test.js +++ b/npm/test.js @@ -14,13 +14,9 @@ describe('Platform Suffix', function () { let result = lib.getSuffix('Linux', 'aarch64'); assert.equal(result, '-arm64', `Expected '-arm64', but got: ${result}`); }); - it('should return -armhf for Linux armv61', function () { - let result = lib.getSuffix('Linux', 'armv61'); - assert.equal(result, '-armhf', `Expected '-armhf', but got: ${result}`); - }); - it('should return -armhf for Linux armv71', function () { - let result = lib.getSuffix('Linux', 'armv71'); - assert.equal(result, '-armhf', `Expected '-armhf', but got: ${result}`); + it('should throw for 32-bit Arm, which is no longer published', function () { + assert.throws(() => {lib.getSuffix('Linux', 'armv61')}); + assert.throws(() => {lib.getSuffix('Linux', 'armv71')}); }); it('should return -darwin for MacOS', function () { let result = lib.getSuffix('Darwin', '');