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

{lang}[GCCcore/12.3.0] Rust v1.70.0 #18016

Merged
merged 5 commits into from
Jun 21, 2023

Conversation

Micket
Copy link
Contributor

@Micket Micket commented Jun 3, 2023

(created using eb --new-pr)

requires:

@Micket Micket added the update label Jun 3, 2023
@Micket
Copy link
Contributor Author

Micket commented Jun 3, 2023

Test report by @Micket
FAILED
Build succeeded for 0 out of 1 (1 easyconfigs in total)
vera-c1 - Linux Rocky Linux 8.7, x86_64, Intel Xeon Processor (Skylake), Python 3.6.8
See https://gist.github.com/Micket/831d3c2565e2ae2b95f142408056ec10 for a full test report.

@Micket
Copy link
Contributor Author

Micket commented Jun 3, 2023

bah, they completely changed the logic in the bootstrap.py stuff. I'll see if what i can do with the patch

@Micket
Copy link
Contributor Author

Micket commented Jun 3, 2023

@boegelbot please test @ generoso

@Micket Micket added this to the next release (4.7.3?) milestone Jun 3, 2023
@Micket Micket added the 2023a label Jun 3, 2023
@boegelbot
Copy link
Collaborator

@Micket: Request for testing this PR well received on login1

PR test command 'EB_PR=18016 EB_ARGS= EB_CONTAINER= /opt/software/slurm/bin/sbatch --job-name test_PR_18016 --ntasks=4 ~/boegelbot/eb_from_pr_upload_generoso.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 10897

Test results coming soon (I hope)...

- notification for comment with ID 1574940623 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@Micket
Copy link
Contributor Author

Micket commented Jun 3, 2023

@boegelbot please test @ jsc-zen2

@boegelbot
Copy link
Collaborator

@Micket: Request for testing this PR well received on jsczen2l1.int.jsc-zen2.easybuild-test.cluster

PR test command 'EB_PR=18016 EB_ARGS= /opt/software/slurm/bin/sbatch --mem-per-cpu=4000M --job-name test_PR_18016 --ntasks=8 ~/boegelbot/eb_from_pr_upload_jsc-zen2.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 2689

Test results coming soon (I hope)...

- notification for comment with ID 1574958932 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@Micket
Copy link
Contributor Author

Micket commented Jun 3, 2023

Test report by @Micket
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in total)
vera-c1 - Linux Rocky Linux 8.7, x86_64, Intel Xeon Processor (Skylake), Python 3.6.8
See https://gist.github.com/Micket/5cd748d0480bd4ebd78c8d136355a46a for a full test report.

@boegelbot
Copy link
Collaborator

Test report by @boegelbot
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in total)
jsczen2c1.int.jsc-zen2.easybuild-test.cluster - Linux Rocky Linux 8.5, x86_64, AMD EPYC 7742 64-Core Processor (zen2), Python 3.6.8
See https://gist.github.com/boegelbot/ec3e3c11f8dd0b45288021e3664aefbd for a full test report.

@boegelbot
Copy link
Collaborator

Test report by @boegelbot
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in total)
cns1 - Linux Rocky Linux 8.5, x86_64, Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz (haswell), Python 3.6.8
See https://gist.github.com/boegelbot/4fd290c74dad13f116f82ce7cecf2b0f for a full test report.

@boegel
Copy link
Member

boegel commented Jun 3, 2023

Test report by @boegel
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in total)
node3159.skitty.os - Linux RHEL 8.6, x86_64, Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz (skylake_avx512), Python 3.6.8
See https://gist.github.com/boegel/0bc07bfaed95f555db33204a4eba0a59 for a full test report.

@boegel
Copy link
Member

boegel commented Jun 3, 2023

Test report by @boegel
SUCCESS
Build succeeded for 3 out of 3 (1 easyconfigs in total)
fair-mastodon-c6g-2xlarge-0003 - Linux Rocky Linux 8.7, AArch64, ARM UNKNOWN (graviton2), Python 3.6.8
See https://gist.github.com/boegel/a59c235466964020626c473459c03848 for a full test report.

@branfosj
Copy link
Member

branfosj commented Jun 4, 2023

Test report by @branfosj
SUCCESS
Build succeeded for 4 out of 4 (1 easyconfigs in total)
bear-pg0105u03a.bear.cluster - Linux RHEL 8.6, x86_64, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz (icelake), Python 3.6.8
See https://gist.github.com/branfosj/14aea8b14aabe3dad98ed8c21131fdc0 for a full test report.

@boegel
Copy link
Member

boegel commented Jun 4, 2023

Test report by @boegel
SUCCESS
Build succeeded for 4 out of 4 (1 easyconfigs in total)
easybuild2.novalocal - Linux CentOS Stream 8, POWER, IBM pSeries (emulated by qemu) (power9le), Python 3.6.8
See https://gist.github.com/boegel/a5b8fd1dfbc60a7fa6e882cb5ee2d9fd for a full test report.

@Micket
Copy link
Contributor Author

Micket commented Jun 4, 2023

Looks like some possible issue with cmake on debian?

-- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.13")
CMake Error at Source/Modules/CMakeBuildUtilities.cmake:117 (message):
  CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!

I don't see how, since we do have zlib as a dep

boegel
boegel previously approved these changes Jun 4, 2023
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

lgtm

@boegel
Copy link
Member

boegel commented Jun 4, 2023

Looks like some possible issue with cmake on debian?

-- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.13")
CMake Error at Source/Modules/CMakeBuildUtilities.cmake:117 (message):
  CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!

I don't see how, since we do have zlib as a dep

It's a problem when installing CMake in an environment with an alternate sysroot, like we're doing in EESSI.
I'll install CMake using easybuilders/easybuild-easyblocks#2248, which will fix it, sorry for the confusion.

Debian is the build container we use, but the test report basically for the EESSI build environmen, we should make EasyBuild aware of that.

@boegel
Copy link
Member

boegel commented Jun 4, 2023

Test report by @boegel
FAILED
Build succeeded for 0 out of 1 (1 easyconfigs in total)
node3159.skitty.os - Linux Debian GNU/Linux 11 (bullseye), x86_64, Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz (skylake_avx512), Python 3.11.3
See https://gist.github.com/boegel/06ed4211e51027845a4d4686b42c883c for a full test report.

edit: test report from EESSI 2023.04 build environment

@Micket
Copy link
Contributor Author

Micket commented Jun 4, 2023

Test report by @Micket
SUCCESS
Build succeeded for 2 out of 2 (1 easyconfigs in total)
vera-c1 - Linux Rocky Linux 8.7, x86_64, Intel Xeon Processor (Skylake), Python 3.6.8
See https://gist.github.com/Micket/e3b4d980ee49e5a68b5b67058ca5e79f for a full test report.

@boegel
Copy link
Member

boegel commented Jun 4, 2023

@Micket Test install in EESSI environment failed, looks like the patch needs work?

running: patchelf --set-interpreter /cvmfs/pilot.eessi-hpc.org/versions/2023.04/compat/linux/x86_64/lib64/ld-linux-x86-64.so.2 /tmp/vsc40023/easybuild/build/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/build/x86_64-unknown-linux-gnu/stage0/bin/cargo
Traceback (most recent call last):
  File "/tmp/vsc40023/easybuild/build/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/./x.py", line 29, in <module>
    bootstrap.main()
  File "/tmp/vsc40023/easybuild/build/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/src/bootstrap/bootstrap.py", line 966, in main
    bootstrap(args)
  File "/tmp/vsc40023/easybuild/build/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/src/bootstrap/bootstrap.py", line 930, in bootstrap
    build.download_toolchain()
  File "/tmp/vsc40023/easybuild/build/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/src/bootstrap/bootstrap.py", line 444, in download_toolchain
    self.fix_bin_or_dylib("{}/bin/cargo".format(bin_root))
  File "/tmp/vsc40023/easybuild/build/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/src/bootstrap/bootstrap.py", line 577, in fix_bin_or_dylib
    subprocess.check_output([
  File "/cvmfs/pilot.eessi-hpc.org/versions/2023.04/software/linux/x86_64/intel/skylake_avx512/software/Python/3.11.3-GCCcore-12.3.0/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/cvmfs/pilot.eessi-hpc.org/versions/2023.04/software/linux/x86_64/intel/skylake_avx512/software/Python/3.11.3-GCCcore-12.3.0/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/cvmfs/pilot.eessi-hpc.org/versions/2023.04/software/linux/x86_64/intel/skylake_avx512/software/Python/3.11.3-GCCcore-12.3.0/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/cvmfs/pilot.eessi-hpc.org/versions/2023.04/software/linux/x86_64/intel/skylake_avx512/software/Python/3.11.3-GCCcore-12.3.0/lib/python3.11/subprocess.py", line 1917, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'nix-build'

@boegel
Copy link
Member

boegel commented Jun 4, 2023

Test report by @boegel
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in total)
node3159.skitty.os - Linux RHEL 8.6, x86_64, Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz (skylake_avx512), Python 3.6.8
See https://gist.github.com/boegel/cb097e4d8f4f2ba51cef472ac42611a8 for a full test report.

@boegel
Copy link
Member

boegel commented Jun 4, 2023

Test report by @boegel
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in total)
fair-mastodon-c6g-2xlarge-0003 - Linux Rocky Linux 8.7, AArch64, ARM UNKNOWN (graviton2), Python 3.6.8
See https://gist.github.com/boegel/42368c17f61b53d34de24fd316ca8307 for a full test report.

@branfosj
Copy link
Member

branfosj commented Jun 4, 2023

Test report by @branfosj
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in total)
bear-pg0105u03a.bear.cluster - Linux RHEL 8.6, x86_64, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz (icelake), Python 3.6.8
See https://gist.github.com/branfosj/933cca02e77aeab9daec7f4e45c4ba64 for a full test report.

@boegel
Copy link
Member

boegel commented Jun 4, 2023

Test report by @boegel
FAILED
Build succeeded for 0 out of 1 (1 easyconfigs in total)
node3159.skitty.os - Linux Debian GNU/Linux 11 (bullseye), x86_64, Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz (skylake_avx512), Python 3.11.3
See https://gist.github.com/boegel/2951433bf170169d3306e88b45141371 for a full test report.

edit: test report from EESSI 2023.04 build environment
RPATH sanity check fails for libLLVM-16-rust-1.70.0-stable.so because that's using RUNPATH rather than the expected RPATH - may require an additional patch to fix, or perhaps can be fixed using patchelf --debug --set-rpath '$ORIGIN/../lib' --force-rpath

@casparvl
Copy link
Contributor

casparvl commented Jun 5, 2023

Test report by @casparvl
FAILED
Build succeeded for 0 out of 1 (1 easyconfigs in total)
tcn1.local.snellius.surf.nl - Linux Rocky Linux 8.7, x86_64, AMD EPYC 7H12 64-Core Processor, Python 3.6.8
See https://gist.github.com/casparvl/3c22a45b95141052bd0bd76babe8a507 for a full test report.

@boegel
Copy link
Member

boegel commented Jun 7, 2023

The best way to deal with the RPATH issue here is probably to create a custom easyblock for Rust, where we use patchelf to transform the RUNPATH section in libLLVM*.so into RPATH, but only when EasyBuild is configured to use RPATH.

@casparvl Thoughts on that?

@casparvl
Copy link
Contributor

casparvl commented Jun 7, 2023

So... why is RUNPATH set and not RPATH? Is this library compiled? or is it a binary that's copied over from the sources?

If it's compiled, we should figure out why it sets RUNPATH instead of RPATH. I think I've seen something similar before, and it was because some software was overruling our --disable-new-dtags with an --enable-new-dtags.

The big issue with fixing this programmatically in the EasyBlock is that we'd need to make sure a patchelf is available. I.e. one would really need to add patchelf as a build dependency from the EasyBlock, if build_option('rpath'). The question then is, which version should the EasyBlock load for patchelf? We'll also have to make sure it is a proper build dependency, so that EasyBuild knows to install it if run with --robot. (and: what should the EasyBlock do if there isn't even a patchelf EasyConfig for that toolchain yet?)

It would be useful if we could come up with a good patch-on-the-fly strategy from EasyBlocks in general btw. Maybe not for this particular case (if it's indeed a --enable-new-dtags messing it up, removing it is a much cleaner solution), but there are always cases where you are doing actual binary installations, and you'd still want to RPATH them. Or, where fixing the RPATH issue is so difficult/time consuming, that you'd rather patch it like this.

@casparvl
Copy link
Contributor

casparvl commented Jun 9, 2023

I had a quick look. This library doesn't seem to come with the sources, but in the logs (even with --debug) I don't see the command line that builds this shared library. I also checked the rpath wrappers, they definitely didn't pick up on any command line that build this library (they do contain command lines that link this library to something else). The problem might be that whatever command is used to build this library isn't intercepted by the wrappers.

I'll check if I can easily pass the -v flag to the build command, maybe that prints some more information...

@casparvl
Copy link
Contributor

casparvl commented Jun 9, 2023

From the ./x.py build -v output:

...
download https://ci-artifacts.rust-lang.org/rustc-builds/90c541806f23a127002de5b4038be731ba1458ca/rust-dev-1.70.0-x86_64-unknown-linux-gnu.tar.xz
downloading https://ci-artifacts.rust-lang.org/rustc-builds/90c541806f23a127002de5b4038be731ba1458ca/rust-dev-1.70.0-x86_64-unknown-linux-gnu.tar.xz
running: "curl" "-#" "-y" "30" "-Y" "10" "--connect-timeout" "30" "--retry" "3" "-Sf" "https://ci-artifacts.rust-lang.org/rustc-builds/90c541806f23a127002de5b4038be731ba1458ca/rust-dev-1.70.0-x86_64-unknown-linux-gnu.tar.xz"
extracting /gpfs/nvme1/1/casparl/ebbuildpath/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/build/cache/llvm-90c541806f23a127002de5b4038be731ba1458ca-false/rust-dev-1.70.0-x86_64-unknown-linux-gnu.tar.xz to /gpfs/nvme1/1/casparl/ebbuildpath/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/build/x86_64-unknown-linux-gnu/ci-llvm
... 
extracting rust-dev-1.70.0-x86_64-unknown-linux-gnu/rust-dev/lib/libLLVM-16-rust-1.70.0-stable.so to /gpfs/nvme1/1/casparl/ebbuildpath/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/build/x86_64-unknown-linux-gnu/ci-llvm
...

That sounds like it is distributed as a binary, and not compiled...?

@casparvl
Copy link
Contributor

casparvl commented Jun 9, 2023

Ok, I'm now 99% sure this is just installed as a binary:

$ cd /gpfs/nvme1/1/casparl/ebbuildpath/Rust/1.70.0/GCCcore-12.3.0/rustc-1.70.0-src/build/cache/llvm-90c541806f23a127002de5b4038be731ba1458ca-false
[casparl@tcn37 llvm-90c541806f23a127002de5b4038be731ba1458ca-false]$ ls
rust-dev-1.70.0-x86_64-unknown-linux-gnu.tar.xz
[casparl@tcn37 llvm-90c541806f23a127002de5b4038be731ba1458ca-false]$ tar -xf rust-dev-1.70.0-x86_64-unknown-linux-gnu.tar.xz
[casparl@tcn37 llvm-90c541806f23a127002de5b4038be731ba1458ca-false]$ cd rust-dev-1.70.0-x86_64-unknown-linux-gnu/
[casparl@tcn37 rust-dev-1.70.0-x86_64-unknown-linux-gnu]$ find -name libLLVM*
./rust-dev/lib/libLLVM-16-rust-1.70.0-stable.so
[casparl@tcn37 rust-dev-1.70.0-x86_64-unknown-linux-gnu]$ sha256sum rust-dev/lib/libLLVM-16-rust-1.70.0-stable.so
1970a0cb1b44494f6c6095341947a84bccad37654c34a724a64c98e5a4ed024e  rust-dev/lib/libLLVM-16-rust-1.70.0-stable.so

And, on the installed library, I get the same checksum:

$ sha256sum /scratch-nvme/1/casparl/generic/software/Rust/1.70.0-GCCcore-12.3.0/lib/libLLVM-16-rust-1.70.0-stable.so
1970a0cb1b44494f6c6095341947a84bccad37654c34a724a64c98e5a4ed024e  /scratch-nvme/1/casparl/generic/software/Rust/1.70.0-GCCcore-12.3.0/lib/libLLVM-16-rust-1.70.0-stable.so

That means indeed the only way to 'fix' this, is to patchelf it. But: see above for my the challenges in doing so...

@casparvl
Copy link
Contributor

Ok, I wrote my thoughts regarding the RPATH issue in #18079
I think it is much bigger than Rust alone, we probably need to solve this with some standardized functionality in the Framework level that can be invoked from the EasyBlocks whenever that's needed.

I don't think it should be blocking this PR thought: useage of RPATH is still a niche, and by the looks of it this PR is fine if you don't build with RPATH support.

@boegel
Copy link
Member

boegel commented Jun 21, 2023

@casparvl I'm fine with merging this PR as-is for now, and dealing with the RPATH issue in a follow-up PR.

W.r.t. the easyblock proposal: we could easily always list a specific version patchelf as a build dependency in the Rust easyconfigs. It would only really be needed when RPATH linking is done, but it's not too big of a problem to always have it as a build dependency (and if it is, --filter-deps to the rescue).

The custom easyblock for Rust that would rely on patchelf when EasyBuild is configured with RPATH could also complain early on that patchelf is required, and give up it it's not found. In the context of EESSI, patchelf is in the compat layer for example, and it's "just a tool" like patch or tar to some extent, so fairly easy to install in the OS.

@boegel boegel dismissed branfosj’s stale review June 21, 2023 13:30

now using Ninja, as requested

Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

lgtm

@boegel
Copy link
Member

boegel commented Jun 21, 2023

Going in, thanks @Micket!

@boegel boegel merged commit 9583f33 into easybuilders:develop Jun 21, 2023
@Micket Micket deleted the 20230603142755_new_pr_Rust1700 branch October 11, 2023 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants