Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/ci/docker/host-aarch64/dist-aarch64-freebsd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM ubuntu:22.04
Copy link
Copy Markdown
Member

@marcoieni marcoieni May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use a more recent ubuntu? Or do we need ubuntu 22 for some reason?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure it could be any ubuntu, shouldn't matter that much. I can give it a try with whichever version you think is most appropriate.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer the latest lts: 26.04. But 24.04 works as well!


RUN apt-get update && apt-get install -y --no-install-recommends \
clang \
make \
ninja-build \
file \
curl \
ca-certificates \
python3 \
git \
cmake \
sudo \
bzip2 \
xz-utils \
texinfo \
wget \
libssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

COPY scripts/freebsd-toolchain.sh /tmp/
RUN /tmp/freebsd-toolchain.sh aarch64

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh

ENV \
AR_aarch64_unknown_freebsd=aarch64-unknown-freebsd13-ar \
CC_aarch64_unknown_freebsd=aarch64-unknown-freebsd13-clang \
CXX_aarch64_unknown_freebsd=aarch64-unknown-freebsd13-clang++

ENV HOSTS=aarch64-unknown-freebsd

ENV RUST_CONFIGURE_ARGS="--enable-full-tools \
--enable-extended \
--enable-profiler \
--enable-sanitizers \
--disable-docs"

ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS"
18 changes: 15 additions & 3 deletions src/ci/docker/scripts/freebsd-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ set -eux

arch=$1
binutils_version=2.40
freebsd_version=12.3
triple=$arch-unknown-freebsd12
# FIXME: Use the same version from FreeBSD 14
Copy link
Copy Markdown
Member

@marcoieni marcoieni May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I lost the notifications and I'm only reviewing this PR now. Do you want to fix this before merging?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good to know! I've been meaning to update this since FreeBSD 13 is now EOL as of this month, so this should just be using FreeBSD 14 across the board. I'll push the update tomorrow.

case $arch in
(aarch64)
freebsd_version=13.5
triple=$arch-unknown-freebsd13
freebsd_date=2025-03-07
;;
(*)
freebsd_version=12.3
triple=$arch-unknown-freebsd12
freebsd_date=2022-05-06
;;
esac
sysroot=/usr/local/$triple

hide_output() {
Expand Down Expand Up @@ -45,6 +56,7 @@ mkdir -p "$sysroot"
case $arch in
(x86_64) freebsd_arch=amd64 ;;
(i686) freebsd_arch=i386 ;;
(aarch64) freebsd_arch=arm64 ;;
esac

files_to_extract=(
Expand All @@ -61,7 +73,7 @@ done

# Originally downloaded from:
# URL=https://download.freebsd.org/ftp/releases/${freebsd_arch}/${freebsd_version}-RELEASE/base.txz
URL=https://ci-mirrors.rust-lang.org/rustc/2022-05-06-freebsd-${freebsd_version}-${freebsd_arch}-base.txz
URL=https://ci-mirrors.rust-lang.org/rustc/${freebsd_date}-freebsd-${freebsd_version}-${freebsd_arch}-base.txz
curl "$URL" | tar xJf - -C "$sysroot" --wildcards "${files_to_extract[@]}"

# Clang can do cross-builds out of the box, if we give it the right
Expand Down
Loading