-
Couldn't load subscription status.
- Fork 115
Move riscv64 to Azure Linux #1098
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,34 @@ | ||
| FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-crossdeps-builder-net9.0-local AS builder | ||
| ARG ROOTFS_DIR=/crossrootfs/riscv64 | ||
|
|
||
| RUN /scripts/eng/common/cross/build-rootfs.sh riscv64 alpine3.20 --skipunmount | ||
|
|
||
| RUN TARGET_TRIPLE="riscv64-alpine-linux-musl" && \ | ||
| cmake -S llvm-project.src/runtimes -B runtimes \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_ASM_COMPILER=clang \ | ||
| -DCMAKE_C_COMPILER=clang \ | ||
| -DCMAKE_CXX_COMPILER=clang++ \ | ||
| -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
| -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
| -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
| # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. | ||
| -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
| -DCMAKE_SYSROOT="$ROOTFS_DIR" \ | ||
| # Specify linker to use for exes directly for CMake toolchain detection | ||
| -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ | ||
| # Don't search for tools in the sysroot as we're cross-compiling | ||
| -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ | ||
| -DLLVM_USE_LINKER=lld \ | ||
| -DLLVM_ENABLE_RUNTIMES="libcxx" \ | ||
| -DLIBCXX_ENABLE_SHARED=OFF \ | ||
| -DLIBCXX_HAS_MUSL_LIBC=ON \ | ||
| -DLIBCXX_CXX_ABI=libstdc++ \ | ||
| -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$ROOTFS_DIR/usr/include/c++/13.2.1/;$ROOTFS_DIR/usr/include/c++/13.2.1/$TARGET_TRIPLE" && \ | ||
| cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ | ||
| cmake --install runtimes --prefix "$ROOTFS_DIR/usr" | ||
|
|
||
| FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-crossdeps-llvm-net9.0-local | ||
| ARG ROOTFS_DIR=/crossrootfs/riscv64 | ||
|
|
||
| COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR |
This file contains hidden or 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,50 @@ | ||
| FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-crossdeps-builder-net9.0-local AS builder | ||
| ARG ROOTFS_DIR=/crossrootfs/riscv64 | ||
|
|
||
| # Install the latest debootstrap | ||
| RUN tdnf remove -y debootstrap && \ | ||
| git clone --depth 1 "https://git.launchpad.net/ubuntu/+source/debootstrap" /debootstrap && \ | ||
| chmod a+x /debootstrap/debootstrap && \ | ||
| ln -s /debootstrap/debootstrap -t /usr/local/bin | ||
|
|
||
| RUN /scripts/eng/common/cross/build-rootfs.sh riscv64 noble --skipunmount | ||
|
|
||
| RUN TARGET_TRIPLE="riscv64-linux-gnu" && \ | ||
| CLANG_MAJOR_VERSION=$(clang --version | grep -oP "(?<=version )\d+") && \ | ||
| cmake -S llvm-project.src/runtimes -B runtimes \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_ASM_COMPILER=clang \ | ||
| -DCMAKE_C_COMPILER=clang \ | ||
| -DCMAKE_CXX_COMPILER=clang++ \ | ||
| -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
| -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
| -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
| # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. | ||
| -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
| -DCMAKE_SYSROOT="$ROOTFS_DIR" \ | ||
| # Specify linker to use for exes directly for CMake toolchain detection | ||
| -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ | ||
| # Don't search for tools in the sysroot as we're cross-compiling | ||
| -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ | ||
| -DLLVM_USE_LINKER=lld \ | ||
| -DLLVM_ENABLE_RUNTIMES="libcxx;compiler-rt" \ | ||
| -DLIBCXX_ENABLE_SHARED=OFF \ | ||
| -DLIBCXX_CXX_ABI=libstdc++ \ | ||
| -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$ROOTFS_DIR/usr/include/c++/13/;$ROOTFS_DIR/usr/include/$TARGET_TRIPLE" \ | ||
| -DCOMPILER_RT_CXX_LIBRARY="libcxx" \ | ||
| -DCOMPILER_RT_STATIC_CXX_LIBRARY=ON \ | ||
| -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | ||
| -DCOMPILER_RT_BUILD_MEMPROF=OFF \ | ||
| # The libfuzzer build in LLVM doesn't correctly forward the required CMake properties to the "fuzzed libc++" build | ||
| # so skip it here. | ||
| -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ | ||
| -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ | ||
| -DCOMPILER_RT_INSTALL_PATH="/usr/local/lib/clang/$CLANG_MAJOR_VERSION" && \ | ||
| cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ | ||
| cmake --install runtimes --prefix "$ROOTFS_DIR/usr" | ||
|
|
||
| FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-crossdeps-llvm-net9.0-local | ||
| ARG ROOTFS_DIR=/crossrootfs/riscv64 | ||
|
|
||
| COPY --from=builder /usr/local/lib/clang /usr/local/lib/clang/ | ||
| COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR | ||
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
from what I can see noble was added in debootstrap 1.0.134 so I'd prefer getting the .tar.gz from https://ftp.debian.org/debian/pool/main/d/debootstrap/ instead of git
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.
also would be good to file an issue tracking this so we can remove it once azurelinux is updated
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.
It is a shell script, not an executable. We will need to setup a fakechroot etc. to make it work from the tarball, see https://src.fedoraproject.org/rpms/debootstrap/blob/rawhide/f/debootstrap.spec. BTW, these steps are taken from the readme of lanchpad official package, to run without installing. Lets keep this for now. I will remove it once newer version of azlinux is published in a few months.
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 looked into this a bit more and it seems the only relevant change is that
scripts/nobleis a symlink toscripts/gutsy. I think we can just create that symlink?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.
This step took 8s (out of 145mins)
riscv64 is a community-supported platform, I think we can live with it for a while. Unless you are feeling too strongly about it, I'd say lets keep it for now and we can delete it once tdnf picks up the latest version in a few weeks or so. (we have been using and trusting launchpad aka Canonical packages forever, so there is no security risk)
LMK 😅
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.
@am11 it's not about the time, I'm more worried about cloning directly from git HEAD. We don't really know when Azure Linux will bump to new debootstrap and if a simple
RUN ln -s gutsy /usr/share/debootstrap/scripts/nobleworks too I prefer that :)In fact I tried that and it seems to work for me locally.
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.
Lets merge this to unblock others and then follow-up on it. I don't wana run another 4 hours CI job for it. That git-clone step hasn't changed in years and hasn't broken anyone. It can sustain a few days. Fair?
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 agree, sounds good.
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.
Upstream PR microsoft/azurelinux#9422