feat: add rust-lang/rust#13012
Conversation
[rust-lang/rust](https://github.com/rust-lang/rust): Empowering everyone to build reliable and efficient software
|
This doesn't work well. $ clippy-driver --help
dyld[80256]: Library not loaded: @rpath/librustc_driver-de83b13cb0dec411.dylib
Referenced from: <840E3891-3456-3181-8FD5-ED2C4C6EE785> /Users/shunsukesuzuki/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.70.0-aarch64-apple-darwin.tar.gz/rust-1.70.0-aarch64-apple-darwin/clippy-preview/bin/clippy-driver
Reason: tried: '/Users/shunsukesuzuki/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.70.0-aarch64-apple-darwin.tar.gz/rust-1.70.0-aarch64-apple-darwin/clippy-preview/bin/../lib/librustc_driver-de83b13cb0dec411.dylib' (no such file), '/Users/shunsukesuzuki/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.70.0-aarch64-apple-darwin.tar.gz/rust-1.70.0-aarch64-apple-darwin/clippy-preview/bin/../lib/librustc_driver-de83b13cb0dec411.dylib' (no such file), '/usr/local/lib/librustc_driver-de83b13cb0dec411.dylib' (no such file), '/usr/lib/librustc_driver-de83b13cb0dec411.dylib' (no such file, not in dyld cache)
zsh: abort clippy-driver --help$ ls ~/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.70.0-aarch64-apple-darwin.tar.gz/rust-1.70.0-aarch64-apple-darwin/rustc/lib/
libchalk_derive-a1e7ef7ca84f041b.dylib libserde_derive-d8bcd59977639216.dylib
libcstr-72c0ec6bf52a01ed.dylib libstd-2ca50e2550a11ed4.dylib
libderive_more-4d829aa1b351128a.dylib libtest-9a5e4ac0b43184d0.dylib
libdisplaydoc-d12aaeaedbb42264.dylib libthiserror_impl-efce2bbcf7c10189.dylib
libicu_provider_macros-972dba0234818778.dylib libtracing_attributes-ffd0bf903aa44903.dylib
libproc_macro_hack-93dced52c3ef57ee.dylib libunic_langid_macros_impl-a46cb91c681139b2.dylib
librustc-stable_rt.asan.dylib libyoke_derive-564c8b2e68c53d71.dylib
librustc-stable_rt.lsan.dylib libzerofrom_derive-e24a6de7937f351d.dylib
librustc-stable_rt.tsan.dylib libzerovec_derive-0dd66e1a97bf7b02.dylib
librustc_driver-de83b13cb0dec411.dylib rustlib
librustc_macros-086d6f1037ea6c16.dylib |
|
I want to use it from GitHub Actions, so is it possible to merge only for the Linux target? |
|
It didn't work on lima too. We need to confirm if it works now. |
|
Ah... I understand. Thank you. |
|
It partially worked on linux/amd64 (Ubuntu 24.04). The problem was that the following parts were The Rust standalone installer has two packages, and both glibc and musl are built with dynamic linking. $ ls
rust-1.86.0-x86_64-unknown-linux-gnu rust-1.86.0-x86_64-unknown-linux-musl
$ file rust-1.86.0-x86_64-unknown-linux-musl/cargo/bin/cargo
rust-1.86.0-x86_64-unknown-linux-musl/cargo/bin/cargo: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, with debug_info, not stripped
$ file rust-1.86.0-x86_64-unknown-linux-gnu/cargo/bin/cargo
rust-1.86.0-x86_64-unknown-linux-gnu/cargo/bin/cargo: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, with debug_info, not strippedMy environment is Ubuntu24.04 so I cannot run musl, but I can check the required glibc version with the following command. $ cmdx con linux amd64
+ bash scripts/connect.sh
[INFO] Connecting to the container aqua-registry (linux/amd64)
root@32b22dad9676:/workspace# cargo -V
cargo 1.86.0 (adf9b6ad1 2025-02-28)
root@32b22dad9676:/workspace# objdump -T ~/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.86.0-x86_64-unknown-linux-gnu.tar.gz/rust-1.86.0-x86_64-unknown-linux-gnu/cargo/bin/cargo | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu
2.2.5
2.3
2.3.2
2.3.4
2.4
2.5
2.6
2.7
2.9
2.10
2.12
2.14
2.15
2.16
2.17Above we can see that the minimum required glibc version is 2.17. https://sourceware.org/glibc/wiki/Glibc%20Timeline Also, considering that Rust requires glibc version 2.17, it should be able to run on most Linux distributions. https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements/ The only thing to consider is the Alpine Linux environment, but I think this can be solved by PR of the musl version for those who need it. For the above reasons, unless there is a special reason, I think that the musl specification in this PR should be changed to the gnu (glibc) specification. There are still other tasks that need to be done (such as setting LD_LIBRARY_PATH and the search path for the std crate), but for now, the above needs to be resolved before it will work on glibc-based Linux, so I would appreciate your consideration. |
|
Thank you for your investigation. musl or gnuI'm not familiar with this field, but I thought musl is more portable than gnu. https://aquaproj.github.io/docs/develop-registry/registry-style-guide/#consideration-about-rust
But you mentioned Rust musl binary is built with dynamic linking.
So I'll replace musl with gnu. |
|
clippy-driver doesn't work on GitHub Actions runner@fv-az1938-351:~/work/aqua-registry/aqua-registry$ clippy-driver --help
clippy-driver: error while loading shared libraries: librustc_driver-ea2439778c0a32ac.so: cannot open shared object file: No such file or directoryrunner@fv-az1938-351:~/work/aqua-registry/aqua-registry$ aqua which clippy-driver
/home/runner/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.86.0-x86_64-unknown-linux-gnu.tar.xz/rust-1.86.0-x86_64-unknown-linux-gnu/clippy-preview/bin/clippy-driver⭕
Probably work
❌
❓
|
$ cmdx con linux amd64
+ bash scripts/connect.sh
[INFO] Connecting to the container aqua-registry (linux/amd64)
root@0343f71d7284:/workspace# export LD_LIBRARY_PATH="$(dirname "$(dirname "$(aqua which rustc)")")/lib"
root@0343f71d7284:/workspace# clippy-driver -V
clippy 0.1.86 (05f9846f89 2025-03-31)
root@0343f71d7284:/workspace# cargo-clippy -V
clippy 0.1.86 (05f9846f89 2025-03-31)
root@0343f71d7284:/workspace# rustfmt -V
rustfmt 1.8.0-stable (05f9846f89 2025-03-31) |
|
RLS Deprecation: |
|
It seems to work fine. |
I didn't set |
|
It worked. runner@fv-az1988-983:~/work/aqua-registry/aqua-registry$ export LD_LIBRARY_PATH="$(dirname "$(dirname "$(aqua which rustc)")")/lib"
runner@fv-az1988-983:~/work/aqua-registry/aqua-registry$ clippy-driver --help
INFO[0000] download and unarchive the package aqua_version=2.50.1-3 env=linux/amd64 exe_name=clippy-driver package_name=rust-lang/rust package_version=1.86.0 program=aqua registry=standard
Checks a file to catch common mistakes and improve your Rust code.
Run clippy-driver with the same arguments you use for rustc
Usage:
clippy-driver [OPTIONS] INPUT
Common options:
-h, --help Print this message
-V, --version Print version info and exit
--rustc Pass all arguments to rustc
Allowing / Denying lints
You can use tool lints to allow or deny lints from your code, e.g.:
#[allow(clippy::needless_lifetimes)] |
|
Although it's off topic, it might be useful to have an option to write environment variable settings in registry.yaml and have aqua-proxy automatically configure them. |
|
I tried compiling it, but I still got an error about the std crate. $ cmdx con linux amd64
+ bash scripts/connect.sh
[INFO] Connecting to the container aqua-registry (linux/amd64)
root@4042502166a2:/workspace# export LD_LIBRARY_PATH="$(dirname "$(dirname "$(aqua which rustc)")")/lib"
root@4042502166a2:/workspace# cargo init neko
Creating binary (application) package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
root@4042502166a2:/workspace# cd neko/
root@4042502166a2:/workspace/neko# cargo b
Compiling neko v0.1.0 (/workspace/neko)
error[E0463]: can't find crate for `std`
|
= note: the `x86_64-unknown-linux-gnu` target may not be installed
= help: consider downloading the target with `rustup target add x86_64-unknown-linux-gnu`
For more information about this error, try `rustc --explain E0463`.
error: could not compile `neko` (bin "neko") due to 1 previous error |
root@4042502166a2:/workspace/neko# rustc --print sysroot
/root/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.86.0-x86_64-unknown-linux-gnu.tar.xz/rust-1.86.0-x86_64-unknown-linux-gnu/rustc |
root@4042502166a2:/workspace/neko# ls $(rustc --print sysroot)/lib/rustlib/x86_64-unknown-linux-gnu/
binThe std crate may be required separately. |
|
I tried to set export LD_LIBRARY_PATH="$(dirname "$(dirname "$(aqua which rustc)")")/lib"$ clippy-driver --help
dyld[51021]: Library not loaded: @rpath/librustc_driver-025e8c5df7c09b7b.dylib
Referenced from: <1DC3F7BE-EA5D-37B6-ABBD-7F8E4AB30D1A> /Users/shunsukesuzuki/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.86.0-aarch64-apple-darwin.tar.xz/rust-1.86.0-aarch64-apple-darwin/clippy-preview/bin/clippy-driver
Reason: tried: '/Users/shunsukesuzuki/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.86.0-aarch64-apple-darwin.tar.xz/rust-1.86.0-aarch64-apple-darwin/clippy-preview/bin/../lib/librustc_driver-025e8c5df7c09b7b.dylib' (no such file), '/Users/shunsukesuzuki/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.86.0-aarch64-apple-darwin.tar.xz/rust-1.86.0-aarch64-apple-darwin/clippy-preview/bin/../lib/librustc_driver-025e8c5df7c09b7b.dylib' (no such file)
zsh: abort clippy-driver --help$ ls $LD_LIBRARY_PATH
librustc_driver-025e8c5df7c09b7b.dylib librustc-stable_rt.asan.dylib librustc-stable_rt.lsan.dylib librustc-stable_rt.tsan.dylib rustlib |
|
Okay, I'll give it a try. |
|
Supporting all platforms (linux, macOS, and windows) is ideal, but supporting only linux is also acceptable. |
|
I have started macOS. However, I'm sorry, but I would like to run the equivalent of aqua's |
|
I checked, and it seems that all work is done in containers. |
|
Sorry, I completely misread it. The information you provided is fine. |
|
I'm sorry, but I haven't been maintaining my macOS environment, so a lot of things are going wrong. |
|
Well, for some reason it worked... aqua-registry on feat/rust-lang/rust [!]
❯ whence cargo
/Users/takumi/.local/share/aquaproj-aqua/bin/cargo
aqua-registry on feat/rust-lang/rust [!]
❯ aqua which cargo
/Users/takumi/.local/share/aquaproj-aqua/pkgs/http/static.rust-lang.org/dist/rust-1.86.0-aarch64-apple-darwin.tar.xz/rust-1.86.0-aarch64-apple-darwin/cargo/bin/cargo
aqua-registry on feat/rust-lang/rust [!]
❯ cargo -V
cargo 1.86.0 (adf9b6ad1 2025-02-28)I'll look into it a little more |
|
I decided to change my approach a bit and build CI from a state where "rustup-init is guaranteed to be installed." The following PR will add rustup-init to aqua. That said, it would be more convenient to be able to install Rust as is, so I'll try it again when I have time. Thank you very much. |
rust-lang/rust: Empowering everyone to build reliable and efficient software
$ aqua g -i rust-lang/rust