Skip to content

Commit

Permalink
try build arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
snmsts committed Aug 11, 2024
1 parent b071266 commit 2333c66
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [arm64, x86-64]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v8.1.5
- name: build
env:
DOCKER_PLATFORM: ${{ matrix.target == 'arm64' && 'linux/arm64' || 'linux/amd64' }}
run: |
make linux-build archive
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: roswell-linux
name: ${{ matrix.target == 'arm64' && 'roswell-linux-arm64' || 'roswell-linux' }}
path: ./*.tbz
14 changes: 0 additions & 14 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,3 @@ jobs:
with:
name: ${{ matrix.target == 'arm64' && 'roswell-osx-arm64' || 'roswell-osx' }}
path: ./*.tbz
build-arm64-linux:
runs-on: macos-14
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: build
run: |
make linux-build archive
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: roswell-linux-arm64
path: ./*.tbz
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ GROUP_ID?=$(shell id -g)
DOCKER_IMAGE?=roswell2
DOCKER_BUILD_OPTION?=
DOCKER_RUN_OPTION?=
DOCKER_PLATFORM ?= linux/amd64

# invoke linux
# alpine for building environment.
Expand All @@ -40,13 +41,13 @@ alpine-docker:
"ln -s base/bin bin;" \
"ln -s base/lib lib;" \
"make install-alpine alpine-sbcl;'" \
| docker build -t $(DOCKER_IMAGE) $(DOCKER_BUILD_OPTION) -
| docker build --platform $(DOCKER_PLATFORM) -t $(DOCKER_IMAGE) $(DOCKER_BUILD_OPTION) -

alpine-docker-scratch:
$(MAKE) DOCKER_BUILD_OPTION=--no-cache alpine-docker

alpine: alpine-docker
docker run -w /tmp3 -v $$PWD:/tmp3/base --rm -it $(DOCKER_IMAGE) $(DOCKER_RUN_OPTION) /bin/ash -c \
docker run -w /tmp3 -v $$PWD:/tmp3/base --rm --platform $(DOCKER_PLATFORM) -it $(DOCKER_IMAGE) $(DOCKER_RUN_OPTION) /bin/ash -c \
"ln -s base/Makefile Makefile; \
ln -s base/bin bin; \
ln -s base/lib lib; \
Expand All @@ -58,7 +59,7 @@ alpine: alpine-docker
chown -R u:u .; \
sudo -u u /bin/ash -i"
linux-build: alpine-docker
docker run -w /tmp3 -v $$PWD:/tmp3/base --rm -i $(DOCKER_IMAGE) $(DOCKER_RUN_OPTION) /bin/ash -c \
docker run -w /tmp3 -v $$PWD:/tmp3/base --rm --platform $(DOCKER_PLATFORM) -i $(DOCKER_IMAGE) $(DOCKER_RUN_OPTION) /bin/ash -c \
"ln -s base/Makefile Makefile; \
ln -s base/bin bin; \
ln -s base/lib lib; \
Expand All @@ -68,10 +69,10 @@ linux-build: alpine-docker
addgroup -g $(GROUP_ID) u; \
usermod -g $(GROUP_ID) u; \
chown -R u:u .; \
sudo -u u make"
make"
# ubuntu for testing environment. try not to copy bin to the environment.
ubuntu:
docker run -w /tmp2 -v $$PWD:/tmp2/base --rm -it ubuntu:16.04 $(DOCKER_RUN_OPTION) /bin/bash -c \
docker run -w /tmp2 -v $$PWD:/tmp2/base --rm --platform $(DOCKER_PLATFORM) -it ubuntu:16.04 $(DOCKER_RUN_OPTION) /bin/bash -c \
"apt-get update -y; \
apt-get install -y sudo make git bzip2; \
ln -s base/Makefile Makefile; \
Expand Down Expand Up @@ -200,8 +201,9 @@ clean:
rm -rf quicklisp
rm -f *.o
rm -f linkage-table-prelink-info-override.c
rm -f $(TARGET)

archive: lib/commit
archive: lib/commit $(TARGET)
mkdir $(ARCHIVE)
mkdir $(ARCHIVE)/bin
mkdir $(ARCHIVE)/lib
Expand Down

0 comments on commit 2333c66

Please sign in to comment.