Skip to content

Update RootFS build #423

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
22 changes: 22 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5190,6 +5190,28 @@ os = "linux"
sha256 = "f51e2d7defe0979abff04e024f75d75d1ef18da9cc9813dbfd5deb8701b8cf7f"
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Rootfs-v2024.3.29/Rootfs.v2024.3.29.x86_64-linux-musl.unpacked.tar.gz"

[["Rootfs.v2025.4.29.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "5526badb5a049bc45844cae977818e2c3316adb7"
lazy = true
libc = "musl"
os = "linux"

[["Rootfs.v2025.4.29.x86_64-linux-musl.squashfs".download]]
sha256 = "fd17c40c6833111743bb2fde602596cb6bad1f22c5ec765d017c67fc9afe1e9d"
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Rootfs-v2025.4.29/Rootfs.v2025.4.29.x86_64-linux-musl.squashfs.tar.gz"

[["Rootfs.v2025.4.29.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "9e748d08d77b69cc7838da98974697ab494e63d7"
lazy = true
libc = "musl"
os = "linux"

[["Rootfs.v2025.4.29.x86_64-linux-musl.unpacked".download]]
sha256 = "6891d3590153dbc8ad1e9c401f5f9d91e44d179747b6df38ef1ac31375fb1852"
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Rootfs-v2025.4.29/Rootfs.v2025.4.29.x86_64-linux-musl.unpacked.tar.gz"

[["RustBase.v1.57.0.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "ced9ffc9b69fbf10db7f413aacfd4d6099825cf2"
Expand Down
6 changes: 4 additions & 2 deletions src/Runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function ld_library_path(target::AbstractPlatform,
# that can natively run within this environment
if csl_paths
append!(paths,
unique("/usr/lib/csl-$(libc(p))-$(arch(p))" for p in (host, target) if Sys.islinux(p) && proc_family(p) == "intel"),
unique("/usr/lib/csl-$(libc(p))-$(arch(p))" for p in (target, host) if Sys.islinux(p) && proc_family(p) == "intel"),
Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, swapping the order the libraries in CSL breaks something else, e.g. cargo:

sandbox:${WORKSPACE} # make -j${nproc} -sC /usr/share/testsuite install
c++ -o /tmp/testsuite/x86_64-linux-gnu/cxx/hello_world/hello_world -g -O2 hello_world.cc
cc -o /tmp/testsuite/x86_64-linux-gnu/c/hello_world/hello_world -g -O2 hello_world.c
c++ -shared -o /tmp/testsuite/x86_64-linux-gnu/cxx/dyn_link/librepeater/librepeater.so -fPIC -g -O2 -lm librepeater/librepeater.cc
cc -shared -o /tmp/testsuite/x86_64-linux-gnu/c/dyn_link/libfoo/libfoo.so -fPIC -g -O2 -lm libfoo/libfoo.c
gcc -o /tmp/testsuite/x86_64-linux-gnu/c/openmp/openmp -g -O2 -fopenmp openmp.c
cc -o /tmp/testsuite/x86_64-linux-gnu/c/dyn_link/dyn_link -I/usr/share/testsuite/c/dyn_link/libfoo -fPIC -g -O2 -Wl,-z,origin -Wl,-rpath,$ORIGIN/libfoo -L/tmp/testsuite/x86_64-linux-gnu/c/dyn_link/libfoo -lfoo dyn_link.c
c++ -o /tmp/testsuite/x86_64-linux-gnu/cxx/dyn_link/dyn_link -I/usr/share/testsuite/cxx/dyn_link/librepeater -fPIC -g -O2 -Wl,-z,origin -Wl,-rpath,$ORIGIN/librepeater -L/tmp/testsuite/x86_64-linux-gnu/cxx/dyn_link/librepeater -lrepeater dyn_link.cc
gfortran -o /tmp/testsuite/x86_64-linux-gnu/fortran/hello_world/hello_world.o -c hello_world.f
cargo install --verbose --path . --root /tmp/testsuite/x86_64-linux-gnu/rust/cargo_build
rustc -o /tmp/testsuite/x86_64-linux-gnu/rust/hello_world/hello_world hello_world.rs
Error relocating /usr/lib/csl-glibc-x86_64/libgcc_s.so.1: __cpu_indicator_init: symbol not found
Error relocating /usr/lib/csl-glibc-x86_64/libgcc_s.so.1: __cpu_model: symbol not found
Error relocating /lib64/ld-linux-x86-64.so.2: unsupported relocation type 37
make[1]: *** [Makefile:7: /tmp/testsuite/x86_64-linux-gnu/rust/cargo_build/cargo_build] Error 127
make: *** [Makefile:48: install-project-rust-cargo_build] Error 2
make: *** Waiting for unfinished jobs....
Error relocating /usr/lib/csl-glibc-x86_64/libgcc_s.so.1: __cpu_indicator_init: symbol not found
Error relocating /usr/lib/csl-glibc-x86_64/libgcc_s.so.1: __cpu_model: symbol not found
Error relocating /lib64/ld-linux-x86-64.so.2: unsupported relocation type 37
make[1]: *** [Makefile:7: /tmp/testsuite/x86_64-linux-gnu/rust/hello_world/hello_world] Error 127
make: *** [Makefile:48: install-project-rust-hello_world] Error 2

@staticfloat @Keno I think there's something wrong with the musl rejection patch though: #423 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

@giordano giordano Apr 30, 2025

Choose a reason for hiding this comment

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

I'm moving a bit blindfolded because I don't know exactly how this was designed to work, but as far as I can tell this isn't really working in practice.

I'm trying to summarise the facts I could gather:

Questions:

  1. do I understand correctly that we should apply the musl reject patch to the glibc we install, which is basically Glibc_jll?
  2. since that's a patch for glibc to reject musl, having glibc before musl in LD_LIBRARY_PATH would make sense, right? Edit: thinking more about this, probably this isn't correct: the problem now is with trying to run a musl executable with glibc libraries listed first: there's nothing to prevent this going wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

About question 1: we already apply the musl rejection patch: https://github.com/JuliaPackaging/Yggdrasil/blob/31124d256133d96e48c5558317c125deae96e0a4/G/Glibc/Glibc%402.34/bundled/patches/glibc-006-glibc_musl_rejection_234.patch. So I'm even more lost now.

Side note, at a quick glance, bminor/glibc@8ee8785 in glibc 2.37 may have made it harder to implement the rejection patch.

)
end

Expand Down Expand Up @@ -1489,7 +1489,9 @@ function runner_setup!(workspaces, mappings, workspace_root, verbose, kwargs, pl
if !isdir(ccache_dir())
mkpath(ccache_dir())
end
push!(workspaces, ccache_dir() => envs["CCACHE_DIR"])
# During bootstrap `CCACHE_DIR` may not be defined, we provide a
# fallback for that case, otherwise rely on the environment variable.
push!(workspaces, ccache_dir() => get(envs, "CCACHE_DIR", "/root/.ccache"))
end

return platform, envs, shards
Expand Down
26 changes: 8 additions & 18 deletions test/runners.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,15 +322,10 @@ end
./test
"""
cmd = `/bin/bash -c "$(test_script)"`
if arch(platform) == "i686" && libc(platform) == "musl"
# We can't run this program for this platform
@test_broken run(ur, cmd, iobuff; tee_stream=devnull)
else
@test run(ur, cmd, iobuff; tee_stream=devnull)
seekstart(iobuff)
# Test that we get the output we expect
@test endswith(readchomp(iobuff), "Hello World!")
end
@test run(ur, cmd, iobuff; tee_stream=devnull)
seekstart(iobuff)
# Test that we get the output we expect
@test endswith(readchomp(iobuff), "Hello World!")
cleanup_dependencies(prefix, artifact_paths, concrete_platform)
end
end
Expand Down Expand Up @@ -377,15 +372,10 @@ end
./test
"""
cmd = `/bin/bash -c "$(test_script)"`
if arch(platform) == "i686" && libc(platform) == "musl"
# We can't run C++ programs for this platform
@test_broken run(ur, cmd, iobuff; tee_stream=devnull)
else
@test run(ur, cmd, iobuff; tee_stream=devnull)
seekstart(iobuff)
# Test that we get the output we expect
@test endswith(readchomp(iobuff), "Hello World!")
end
@test run(ur, cmd, iobuff; tee_stream=stdout)
seekstart(iobuff)
# Test that we get the output we expect
@test endswith(readchomp(iobuff), "Hello World!")
Comment on lines -380 to +378
Copy link
Member Author

Choose a reason for hiding this comment

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

 Got correct result, please change to @test if no longer broken.

b828b068ca6f832f02dd24edc48dc6f8

cleanup_dependencies(prefix, artifact_paths, concrete_platform)
end
end
Expand Down
Loading