forked from docker-archive/runc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This implements cross-build for "make release", moving the build into a container. This way we can support arm, arm64, ppc, and whatnot. * script/seccomp.sh: separate out of script/release.sh, amend to support cross-compile and save needed environment variables to a file. * Dockerfile: add installing libseccomp from source, as this is needed for release builds. * script/release.sh: amend to support more architectures in addition to the native build. Additional arches can be added by specifying "-a <arch>" argument (can be specified multiple times), or "make RELEASE_ARGS="-a arm64" release" if called via make. All supported architectures can be enabled via "make releaseall". * Makefile: move "release" target to "localrelease", add "release" and "releaseall" targets to build via the Dockerfile. This is done because most distros (including Fedora and openSUSE) lack cross-glibc, which is needed to cross-compile libseccomp. * Makefile: remove 'cross' and 'localcross' targets, as this is now done by the release script. * .github/workflows/validate.yum: amend the release CI job to cross-build for supported architectures, remove cross job. Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information
Showing
6 changed files
with
207 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,27 +124,6 @@ jobs: | |
error: 'Subject too long (max 72)' | ||
|
||
|
||
cross: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# We have to run this under Docker as Ubuntu (host) does not support all | ||
# the architectures we want to compile test against, and Dockerfile uses | ||
# Debian (which does). | ||
# | ||
# XXX: as currently this is the only job that is using Docker, we are | ||
# building and using the runcimage locally. In case more jobs running | ||
# under Docker will emerge, it will be good to have a separate make | ||
# runcimage job and share its result (the docker image) with whoever | ||
# needs it. | ||
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
- name: build docker image | ||
run: make runcimage | ||
- name: cross | ||
run: make cross | ||
|
||
|
||
cfmt: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
|
@@ -169,12 +148,21 @@ jobs: | |
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: install deps | ||
run: | | ||
sudo apt -qq update | ||
sudo apt -qq install gperf | ||
- name: make release | ||
run: make release | ||
# We have to run this under Docker as Ubuntu (host) does not support all | ||
# the architectures we want to compile test against, and Dockerfile uses | ||
# Debian (which does). | ||
# | ||
# XXX: as currently this is the only job that is using Docker, we are | ||
# building and using the runcimage locally. In case more jobs running | ||
# under Docker will emerge, it will be good to have a separate make | ||
# runcimage job and share its result (the docker image) with whoever | ||
# needs it. | ||
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
- name: build docker image | ||
run: make runcimage | ||
- name: make releaseall | ||
run: make releaseall | ||
- name: upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# set_cross_vars sets a few environment variables used for cross-compiling, | ||
# based on the architecture specified in $1. | ||
function set_cross_vars() { | ||
GOARCH="$1" # default, may be overridden below | ||
unset GOARM | ||
|
||
case $1 in | ||
arm64) | ||
HOST=aarch64-linux-gnu | ||
;; | ||
armel) | ||
HOST=arm-linux-gnueabi | ||
GOARCH=arm | ||
GOARM=6 | ||
;; | ||
armhf) | ||
HOST=arm-linux-gnueabihf | ||
GOARCH=arm | ||
GOARM=7 | ||
;; | ||
ppc64le) | ||
HOST=powerpc64le-linux-gnu | ||
;; | ||
*) | ||
echo "set_cross_vars: unsupported architecture: $1" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
CC=$HOST-gcc | ||
STRIP=$HOST-strip | ||
|
||
export HOST GOARM GOARCH CC STRIP | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.