rust-lang / rust-lang/rust

error while loading shared libraries: librustc_driver-fb0866b1cd913c20.so: cannot open shared object file: No such file or directory

Open
#136,237 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-linkage C-discussion O-yocto T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

In Yocto environment , we could see a test failure after upgrading to rust_1.82 . (May be because of the feature (https://github.com/rust-lang/rust/pull/122362) )

After updating to rust 1.82 , we ran "python3 src/bootstrap/bootstrap.py test" . Then we came across the below failure . Can anyone point me out do we need to make any changes in poky sources to adapt this feature .

Compiling rustc_driver_impl v0.0.0 (rust_1.82/tmp/work/core2-64-poky-linux/rust/1.82.0/rustc-1.82.0-src/compiler/rustc_driver_impl)
  Compiling rustc_driver v0.0.0 (rust_1.82/tmp/work/core2-64-poky-linux/rust/1.82.0/rustc-1.82.0-src/compiler/rustc_driver)
   Finished `release` profile [optimized] target(s) in 5m 29s
    Running unittests src/main.rs (build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-poky-linux-gnu/release/deps/rustc_main-92223b15c9f2d827)
uploaded "rust_1.82/tmp/work/core2-64-poky-linux/rust/1.82.0/rustc-1.82.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-poky-linux-gnu/release/deps/rustc_main-92223b15c9f2d827", waiting for result
/tmp/work/test4056/rustc_main-92223b15c9f2d827: error while loading shared libraries: librustc_driver-fb0866b1cd913c20.so: cannot open shared object file: No such file or directory
error: test failed, to rerun pass `-p rustc-main --bin rustc-main`

Caused by:
 process didn't exit successfully: `rust_1.82/tmp/work/core2-64-poky-linux/rust/1.82.0/rustc-1.82.0-src/build/x86_64-unknown-linux-gnu/stage0-tools-bin/remote-test-client run 0 rust_1.82/tmp/work/core2-64-poky-linux/rust/1.82.0/rustc-1.82.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-poky-linux-gnu/release/deps/rustc_main-92223b15c9f2d827 -Z unstable-options --format json` (exit status: 127)
note: test exited abnormally; to see the full output pass --nocapture to the harness.
    Running unittests src/lib.rs (build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-poky-linux-gnu/release/deps/rustc_abi-ec634b1002c52b95)
uploaded "rust_1.82/tmp/work/core2-64-poky-linux/rust/1.82.0/rustc-1.82.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-poky-linux-gnu/release/deps/rustc_abi-ec634b1002c52b95", waiting for result

running 1 tests
test tests::align_constants ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 34.99ms

According to the above given error log, it seems like it cannot able to find the librustc_driver.so but I can able to find librustc_driver.so file in the following build path where the rustc_main-92223b15c9f2d827 is also present :

rust_1.82/tmp/work/core2-64-poky-linux/rust/1.82.0/rustc-1.82.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-poky-linux-gnu/release/deps

I found the following files related to librustc_driver in that directory:

librustc_driver-fb0866b1cd913c20.so
librustc_driver_impl-41ab001b5a5d6c41.rlib
librustc_driver_impl-41ab001b5a5d6c41.rmeta

However, I am unsure about the below path:

/tmp/work/test4056/rustc_main-92223b15c9f2d827

I'm not certain where this path is coming from, and whether it indicates that the system is trying to find the librustc_driver*.so file in the wrong location.

CC: @bjorn3 @Zoxc

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/bootstrap/bootstrap.py and the remote-test-client invocation from the failure, then inspect how the staged rustc_main binary is uploaded to /tmp/work/test4056. Reproduce with python3 src/bootstrap/bootstrap.py test in the Yocto environment and determine whether the missing shared-library path is caused by test staging or runtime lookup; done means the rustc-main test runs successfully after Rust 1.82.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.