-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support building sid and alpine rootfs for loongarch64 #15291
Conversation
This is a step towards eventual access to public CI resources to catch build regressions etc. earlier. As LoongArch support has not reached any public release of Debian, currently only sid is covered, while alpine versions from 3.21 onwards are supported. This is tested on a x86_64 system with qemu-loongarch64 linux-user emulation set up, because the debootstrap second stage needs to run binaries of the target architecture. The following invocations work: * `eng/common/cross/build-rootfs.sh loongarch64 sid --rootfsdir /test` * `eng/common/cross/build-rootfs.sh loongarch64 alpineedge --skipsigcheck --rootfsdir /test` * `eng/common/cross/build-rootfs.sh loongarch64 alpine --skipsigcheck --rootfsdir /test`
0d84998
to
f774810
Compare
@dotnet-policy-service agree |
@@ -766,7 +799,7 @@ elif [[ -n "$__CodeName" ]]; then | |||
cat > "$__RootfsDir/etc/apt/sources.list.d/$__CodeName.sources" <<EOF | |||
Types: deb | |||
URIs: $__UbuntuRepo | |||
Suites: $__CodeName $(echo $__UbuntuSuites | xargs -n 1 | xargs -I {} echo -n "$__CodeName-{} ") | |||
Suites: $__CodeName $__DebianRawSuites $(echo $__UbuntuSuites | xargs -n 1 | xargs -I {} echo -n "$__CodeName-{} ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo:
Suites: $__CodeName $__DebianRawSuites $(echo $__UbuntuSuites | xargs -n 1 | xargs -I {} echo -n "$__CodeName-{} ") | |
Suites: $__CodeName $__DebianSuitesRaw $(echo $__UbuntuSuites | xargs -n 1 | xargs -I {} echo -n "$__CodeName-{} ") |
__UbuntuRepo="http://ftp.debian.org/debian/" | ||
# Debian-Ports architectures need different values | ||
case "$__UbuntuArch" in | ||
amd64|arm64|armel|armhf|i386|mips64el|ppc64el|riscv64|s390x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer just special casing loong64 here and use *
for everything else.
/cc @am11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate of #8333
We also have a tracking issue dotnet/dotnet-buildtools-prereqs-docker#856. We should wait for debootstrap to support this and not add unreleased stuff in our infrastructure. Meanwhile, you can keep it in your own infra. There is no rush as we are already waiting for it for over two years.
@am11 what are we waiting for in debootstrap? |
if [[ -z "$__UbuntuRepo" ]]; then | ||
__UbuntuRepo="http://ftp.ports.debian.org/debian-ports/" | ||
fi | ||
__UbuntuPackages="${__UbuntuPackages} debian-ports-archive-keyring" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should download the keyring in the host layer with proper checksum https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/a397a76ee5995eba2dc61a4cd1faa60f4235fc52/src/azurelinux/3.0/net10.0/crossdeps-builder/amd64/Dockerfile#L37
__UbuntuPackages="${__UbuntuPackages} debian-ports-archive-keyring" |
elif [[ "$__AlpineArch" == "riscv64" ]]; then | ||
__AlpineLlvmLibsLookup=1 | ||
__AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive) | ||
elif [[ "$__AlpineArch" == "loongarch64" ]]; then | ||
__AlpineLlvmLibsLookup=1 | ||
if [[ "$__AlpineMajorVersion" -lt 3 || "$__AlpineMinorVersion" -lt 21 ]]; then | ||
__AlpineVersion=3.21 # minimum version with loongarch64 support | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd merge these two branches and set them to alpine 3.21 and llvm 19:
elif [[ "$__AlpineArch" == "riscv64" ]]; then | |
__AlpineLlvmLibsLookup=1 | |
__AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive) | |
elif [[ "$__AlpineArch" == "loongarch64" ]]; then | |
__AlpineLlvmLibsLookup=1 | |
if [[ "$__AlpineMajorVersion" -lt 3 || "$__AlpineMinorVersion" -lt 21 ]]; then | |
__AlpineVersion=3.21 # minimum version with loongarch64 support | |
fi | |
elif [[ "$__AlpineArch" == "loongarch64" || "$__AlpineArch" == "riscv64" ]]; then | |
__AlpineVersion=3.21 | |
__AlpinePackages+=" llvm19-libs" |
Superseded by #15370 |
This is a step towards eventual access to public CI resources to catch build regressions etc. earlier. As LoongArch support has not reached any public release of Debian or Alpine, currently only sid and alpineedge are covered.
This is tested on a x86_64 system with qemu-loongarch64 linux-user emulation set up, because the debootstrap second stage needs to run binaries of the target architecture. The following invocations work:
eng/common/cross/build-rootfs.sh loongarch64 sid --rootfsdir /test
eng/common/cross/build-rootfs.sh loongarch64 alpineedge --skipsigcheck --rootfsdir /test
To double check: