Open matthiaskrgr opened 1 month ago
Pretty sure long ty names written to disk also has this issue EDIT: opened #129296 so that is separately tracked.
making it a relative path would likely hurt usability, cargo sets the working directory to the crate source which is not necessarily the working directory of the user. it would be bad if they couldn't just copy paste the path and open it.
Ah good point, in case a crate dependency causes the ICE, the backtrace file gets dumped into random dirs inside the $CARGO_HOME
which is even worse (registry crate sources really shouldn't be altered at all during builds...), see https://github.com/rust-lang/rust/issues/128484 for an example.
We could probably fix 99% of the cases by checking if there is a something like a /tmp
and using that one if available?
Could we replace a prefix matching the user's home dir with ~/
on Unix and with %userprofile%
on Windows (or assume that most Windows users understand the ~/
syntax too)?
I think that we can likely use a combination of the above strategies. @yaahc just happens to be looking into making the target directory a user definable nightly config flag (instead of an env flag) so that cargo
can pass it in and specify a directory in the same way that they are talking about global caching of artifacts (cc @epage). That would likely also have the issue of the username being part of the path printed to stderr. I think if we can reliably use ~/
and %userprofile%
, that would likely be the best option.
When you trigger an ICE, rustc generates this stacktrace file and prints its location as absolute path:
note: please attach the file at
/home/matthias/vcs/github/rust/rustc-ice-2024-08-03T09_07_05-3443169.txt
to your bug reportThis absolute path is part of the backtrace and often copied into the ticket and can contain sensitive information such as users real names or where they work, when its a work computer, etc...
Can we make this a relative path? cc @estebank