Skip to content

Commit

Permalink
Fix v1.21 archive match (#24)
Browse files Browse the repository at this point in the history
Remove linux/armhf target
  • Loading branch information
IvoBCD committed Dec 7, 2023
1 parent af4b739 commit 429d9e6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 43 deletions.
1 change: 0 additions & 1 deletion .github/actions/build/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ git config --global --add safe.directory "$PWD"

VERBOSE=y make distclean test
TARGET_ARCH=linux-arm64 VERBOSE=y make
TARGET_ARCH=linux-armhf VERBOSE=y make
TARGET_ARCH=linux-amd64 VERBOSE=y make
VERBOSE=y make dist-archive
17 changes: 3 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
runs-on: ubuntu-20.04
container:
image: ghcr.io/bcdevices/scm-go-usb-arm:v1.20.1-jammy-2
image: ghcr.io/bcdevices/scm-go-usb-arm:v1.21.1-jammy-2
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -21,7 +21,7 @@ jobs:
build-linux-amd64:
runs-on: ubuntu-20.04
container:
image: ghcr.io/bcdevices/scm-go-usb-arm:v1.20.1-jammy-2
image: ghcr.io/bcdevices/scm-go-usb-arm:v1.21.1-jammy-2
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -32,21 +32,10 @@ jobs:
build-linux-arm64:
runs-on: ubuntu-20.04
container:
image: ghcr.io/bcdevices/scm-go-usb-arm:v1.20.1-jammy-2
image: ghcr.io/bcdevices/scm-go-usb-arm:v1.21.1-jammy-2
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build linux-arm64
run: |
TARGET_ARCH="linux-arm64" make all
build-linux-armhf:
runs-on: ubuntu-20.04
container:
image: ghcr.io/bcdevices/scm-go-usb-arm:v1.20.1-jammy-2
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build linux-armhf
run: |
TARGET_ARCH="linux-armhf" make all
25 changes: 9 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ARG BUILDPACK_HOSTOS="jammy"
FROM buildpack-deps:${BUILDPACK_HOSTOS}-scm

ENV GOLANG_VERSION="1.20.1"
ENV GOLANG_VERSION="1.21.1"

# hadolint ignore=DL3008
RUN set -eux; \
Expand All @@ -24,16 +24,12 @@ RUN set -eux; \
url=; \
case "$arch" in \
'amd64') \
url='https://dl.google.com/go/go1.20.1.linux-amd64.tar.gz'; \
sha256='000a5b1fca4f75895f78befeb2eecf10bfff3c428597f3f1e69133b63b911b02'; \
;; \
'armhf') \
url='https://dl.google.com/go/go1.20.1.linux-armv6l.tar.gz'; \
sha256='e4edc05558ab3657ba3dddb909209463cee38df9c1996893dd08cde274915003'; \
url='https://dl.google.com/go/go1.21.1.linux-amd64.tar.gz'; \
sha256='b3075ae1ce5dab85f89bc7905d1632de23ca196bd8336afd93fa97434cfa55ae'; \
;; \
'arm64') \
url='https://dl.google.com/go/go1.20.1.linux-arm64.tar.gz'; \
sha256='5e5e2926733595e6f3c5b5ad1089afac11c1490351855e87849d0e7702b1ec2e'; \
url='https://dl.google.com/go/go1.21.1.linux-arm64.tar.gz'; \
sha256='7da1a3936a928fd0b2602ed4f3ef535b8cd1990f1503b8d3e1acc0fa0759c967'; \
;; \
*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
esac; \
Expand Down Expand Up @@ -64,8 +60,6 @@ ENV PKGS="${PKGS} crossbuild-essential-amd64"
ENV PKGS="${PKGS} libusb-1.0-0-dev:amd64"
ENV PKGS="${PKGS} crossbuild-essential-arm64"
ENV PKGS="${PKGS} libusb-1.0-0-dev:arm64"
ENV PKGS="${PKGS} crossbuild-essential-armhf"
ENV PKGS="${PKGS} libusb-1.0-0-dev:armhf"
ENV PKGS="${PKGS} libusb-1.0-0-dev"
ENV PKGS="${PKGS} zip"

Expand All @@ -76,13 +70,12 @@ RUN set -eux; \
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse\n\
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse\n\
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse\n\
deb [arch=arm64,armhf] http://ports.ubuntu.com/ jammy main restricted universe multiverse\n\
deb [arch=arm64,armhf] http://ports.ubuntu.com/ jammy-updates main restricted universe multiverse\n\
deb [arch=arm64,armhf] http://ports.ubuntu.com/ jammy-security main restricted universe multiverse\n\
deb [arch=arm64,armhf] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" > /etc/apt/sources.list; \
deb [arch=arm64] http://ports.ubuntu.com/ jammy main restricted universe multiverse\n\
deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main restricted universe multiverse\n\
deb [arch=arm64] http://ports.ubuntu.com/ jammy-security main restricted universe multiverse\n\
deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" > /etc/apt/sources.list; \
dpkg --add-architecture "amd64"; \
dpkg --add-architecture "arm64"; \
dpkg --add-architecture "armhf"; \
apt-get update; \
apt-get -y install --no-install-recommends ${PKGS}; \
rm -rf /var/lib/apt/lists/*
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,16 @@ TARGET_ARCHS :=
TARGET_ARCHS += host
TARGET_ARCHS += linux-amd64
TARGET_ARCHS += linux-arm64
TARGET_ARCHS += linux-armhf
ifneq ($(TARGET_ARCH),)
ifeq ($(filter $(TARGET_ARCH),$(TARGET_ARCHS)),)
$(error "Invalid TARGET_ARCH: $(TARGET_ARCH), not in: $(TARGET_ARCHS)")
endif
endif
GCCTRIPLET_linux-amd64 := x86_64-linux-gnu
GCCTRIPLET_linux-arm64 := aarch64-linux-gnu
GCCTRIPLET_linux-armhf := arm-linux-gnueabihf
GCCTRIPLETS :=
GCCTRIPLETS += $(GCCTRIPLET_linux-amd64)
GCCTRIPLETS += $(GCCTRIPLET_linux-arm64)
GCCTRIPLETS += $(GCCTRIPLET_linux-armhf)
GCCTRIPLET_CROSS ?= $(GCCTRIPLET_$(TARGET_ARCH))
ifneq ($(GCCTRIPLET_CROSS),)
ifeq ($(filter $(GCCTRIPLET_CROSS),$(GCCTRIPLETS)),)
Expand All @@ -55,7 +52,6 @@ GO_BUILD ?= CC=$(CC) CGO_ENABLED=$(CGO_ENABLED) $(GO) build $(GO_BUILD_OPTS)
GO_TEST ?= CC=$(CC) CGO_ENABLED=$(CGO_ENABLED) $(GO) test $(GO_BUILD_OPTS)
GOARCH_linux-amd64 := amd64
GOARCH_linux-arm64 := arm64
GOARCH_linux-armhf := arm
GOARCH_CROSS ?= $(GOARCH_$(TARGET_ARCH))
GOARM_CROSS ?= 7
GOOS_CROSS := linux
Expand All @@ -70,8 +66,6 @@ BINS_amd64 :=
BINS_amd64 += build/linux-amd64/bin/deps
BINS_arm64 :=
BINS_arm64 += build/linux-arm64/bin/deps
BINS_armhf :=
BINS_armhf += build/linux-armhf/bin/deps
BINS_host :=
BINS_host += build/bin/deps
INSTALL_FILES :=
Expand All @@ -83,9 +77,6 @@ endif
ifeq ($(TARGET_ARCH),linux-arm64)
BINS += $(BINS_arm64)
endif
ifeq ($(TARGET_ARCH),linux-armhf)
BINS += $(BINS_armhf)
endif
ifeq ($(TARGET_ARCH),linux-amd64)
BINS += $(BINS_amd64)
endif
Expand Down Expand Up @@ -215,4 +206,4 @@ docker-%: check-docker-host
-t "$(DOCKER_TAG_BASE)-$*" \
/bin/bash -c "TARGET_ARCH=linux-$* VERBOSE=$(VERBOSE) make docker-guest"
.PHONY: docker
docker: docker-amd64 docker-arm64 docker-armhf
docker: docker-amd64 docker-arm64
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Target platforms:
- Host: container image platform (Linux/AArch64, Linux/x86\_64)
- `linux/amd64`: Linux/x86\_64
- `linux/arm64`: Linux/AArch64
- `linux/armhf`: Linux/armv7+

## Including additional packages

Expand All @@ -16,7 +15,7 @@ with a `PKGS` build argument.
```Shell
# Include libzmq3-dev, for all supported targets
docker build \
--build-arg PKGS="libzmq3-dev libzmq3-dev:amd64 libzmq3-dev:arm64 libzmq3-dev:armhf" \
--build-arg PKGS="libzmq3-dev libzmq3-dev:amd64 libzmq3-dev:arm64" \
.
```

Expand Down

0 comments on commit 429d9e6

Please sign in to comment.