backtrace-rs icon indicating copy to clipboard operation
backtrace-rs copied to clipboard

build.rs: canonicalize OUT_DIR

Open TheLortex opened this issue 10 months ago • 1 comments

Hi, I discovered a build problem when building this crate with the Bazel build system for the Android platform.

This warning occurs:

Build Script Warning: clang: error: no such file or directory: 'external/crate_index__backtrace-0.3.69/src/android-api.c'
Build Script Warning: clang: error: no input files

The problem is due to the fact that OUT_DIR is a relative path, and it looks like cc::Build:: ... .try_expand() expects an absolute path. Maybe because it's running inside a temporary dir ? I didn't dig enough to know.

I can confirm that canonicalizing the OUT_DIR fixes my problem.

TheLortex avatar Mar 29 '24 14:03 TheLortex

@TheLortex I do not think we should modify this code unless https://github.com/rust-lang/rust/pull/120593 fails to go through in a reasonable timeframe (say, next few weeks), because I would prefer the next modification to this file to not be an error correction but a deletion.

workingjubilee avatar Apr 01 '24 03:04 workingjubilee