rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.98k stars 12.68k forks source link

"File name too long" error when compiling files with long names #49914

Open rcoh opened 6 years ago

rcoh commented 6 years ago
could not write output to /home/russell/code/rust/rust/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.region_lbr1_does_outlive_lbr2_because_implied_bound0-317d481089b8c8fe83113de504472633.rs.rcgu.o: File name too long

Can the test runner avoid trying to write file with names this long? I've moved my rust installation to a higher level directory to work around it.

rcoh commented 6 years ago

This occurs for me because my home directory is mounted on ecryptfs which only supports file names up to 143 characters

steveklabnik commented 4 years ago

Triage: not aware of any specific fixes here

jyn514 commented 2 years ago

There are two ways we could make the file name shorter:

  1. Write test files to /tmp instead of build/$TARGET/test. This shouldn't be too hard to implement, but not sure why build/ was chosen in the first place so hard to know what the tradeoffs are.
  2. Abbreviate the test name if it goes over an arbitrary limit. We shouldn't change the source name (in src/test) but we can pass a custom --crate-name that should lead to shorter CGU filenames.