Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hermetic-llvm + Rust path mapping repro

This is a minimal repro case for a path mapping issue with Rustc actions. I think the issue lies somewhere between hermetic-llvm, rules_rust, rules_rs, and rules_cc, but I could be off.

How to reproduce

Build the Rust binary:

bazel build //:hello

The build fails with a linker error like the following:

ld.lld: error: cannot open crt1.o: No such file or directory
ld.lld: error: cannot open crti.o: No such file or directory
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: unable to find library -lutil
ld.lld: error: unable to find library -lrt
ld.lld: error: unable to find library -lpthread
ld.lld: error: unable to find library -lm
ld.lld: error: unable to find library -ldl
ld.lld: error: unable to find library -lc
ld.lld: error: unable to find library -lpthread
ld.lld: error: unable to find library -ldl
ld.lld: error: cannot open crtend.o: No such file or directory
ld.lld: error: cannot open crtn.o: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Mitigation

To mitigate the issue disable path mapping for Rustc actions by uncommenting this line in .bazelrc:

common --modify_execution_info=Rustc=-supports-path-mapping

Then build the target again. It should succeed.

bazel build //:hello

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages