Create rust-cross image
Aimee OS/container-images/pipeline/head This commit looks good Details

Splitting up the _build/cross-{target}_ image into two steps, first the
C/C++ toolchain and then the Rust toolchain will make it quicker to
rebuild the latter stage.
rust-cross/main
Dustin 2024-12-22 08:57:09 -06:00
parent 825e1c17b1
commit 09d32d722c
3 changed files with 8 additions and 25 deletions

View File

@ -5,7 +5,6 @@ SRCDIR=${SELF%/*}
. "${SRCDIR}"/lib/common.sh . "${SRCDIR}"/lib/common.sh
target=aarch64-unknown-linux-gnu target=aarch64-unknown-linux-gnu
base=aimee-os.org/build/base
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
-t|--target) -t|--target)
@ -24,9 +23,13 @@ while [ $# -gt 0 ]; do
shift shift
done done
if [ -z "${base-}" ]; then
base=aimee-os.org/build/cross-"${target}"
fi
set -e set -e
cid=$(buildah from "${base}") cid=$(buildah from "${base}")
buildah_run_script "${cid}" "${SRCDIR}"/lib/sync.sh buildah_run_script "${cid}" "${SRCDIR}"/lib/sync.sh
buildah_run_script "${cid}" "${SRCDIR}"/crossdev.sh "${target}" buildah_run_script "${cid}" "${SRCDIR}"/rust-cross.sh "${target}"
buildah commit --rm "${cid}" aimee-os.org/build/cross-"${target}" buildah commit --rm "${cid}" aimee-os.org/build/rust-cross-"${target}"

4
ci/Jenkinsfile vendored
View File

@ -20,7 +20,7 @@ pipeline {
stage('Build') { stage('Build') {
steps { steps {
sh 'sh -e build.sh --base git.pyrocufflink.net/aimeeos/build/base' sh 'sh -e build.sh --base git.pyrocufflink.net/aimeeos/build/cross-aarch64-unknown-linux-gnu'
} }
} }
@ -41,7 +41,7 @@ pipeline {
git.pyrocufflink.net git.pyrocufflink.net
""" """
} }
sh 'buildah push aimee-os.org/build/cross-aarch64-unknown-linux-gnu git.pyrocufflink.net/aimeeos/build/cross-aarch64-unknown-linux-gnu' sh 'buildah push aimee-os.org/build/rust-cross-aarch64-unknown-linux-gnu git.pyrocufflink.net/aimeeos/build/rust-cross-aarch64-unknown-linux-gnu'
} }
} }
} }

View File

@ -4,26 +4,6 @@ set -e
target=$1 target=$1
USE=-nls \
emerge -kvnj sys-devel/gettext
mkdir -p /var/db/repos/crossdev/profiles /var/db/repos/crossdev/metadata
echo crossdev > /var/db/repos/crossdev/profiles/repo_name
echo 'masters = gentoo' > /var/db/repos/crossdev/metadata/layout.conf
chown -R portage:portage /var/db/repos/crossdev
mkdir -p /etc/portage/repos.conf
cat > /etc/portage/repos.conf/crossdev.conf <<EOF
[crossdev]
location = /var/db/repos/crossdev
priority = 10
masters = gentoo
auto-sync = no
EOF
emerge -kvnj --rebuilt-binaries=y sys-devel/crossdev
crossdev --stable -t "$1"
ln -s /var/db/repos/gentoo/sys-devel/rust-std /var/db/repos/crossdev/cross-${target}/ ln -s /var/db/repos/gentoo/sys-devel/rust-std /var/db/repos/crossdev/cross-${target}/
case ${target%%-*} in case ${target%%-*} in