Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

xen0n
Copy link
Contributor

@xen0n xen0n commented Dec 1, 2024

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:

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`
@xen0n xen0n force-pushed the loongarch64-rootfs branch from 0d84998 to f774810 Compare December 10, 2024 07:00
@xen0n
Copy link
Contributor Author

xen0n commented Dec 10, 2024

@dotnet-policy-service agree

@xen0n xen0n changed the title Support building sid and alpineedge rootfs for loongarch64 Support building sid and alpine rootfs for loongarch64 Dec 10, 2024
@@ -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-{} ")
Copy link
Member

Choose a reason for hiding this comment

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

typo:

Suggested change
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)
Copy link
Member

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.

@akoeplinger
Copy link
Member

/cc @am11

Copy link
Member

@am11 am11 left a 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.

@akoeplinger
Copy link
Member

@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"
Copy link
Member

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

Suggested change
__UbuntuPackages="${__UbuntuPackages} debian-ports-archive-keyring"

Comment on lines 452 to +459
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
Copy link
Member

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:

Suggested change
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"

@akoeplinger
Copy link
Member

Superseded by #15370

@akoeplinger akoeplinger closed this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants