Compute src_dir from original filename

This fixed a bug where bindgen was providing cwd() for src_dir,
but actually the src_dir should have been based on the filename.
This prevents that problem from happening in the future!
This commit is contained in:
Richard Feldman 2022-07-13 12:49:06 -04:00
parent 6abf25e3a8
commit bf63c45b46
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
12 changed files with 10 additions and 47 deletions

View file

@ -353,8 +353,6 @@ pub fn test(matches: &ArgMatches, triple: Triple) -> io::Result<i32> {
);
}
let src_dir = path.parent().unwrap().canonicalize().unwrap();
// let target_valgrind = matches.is_present(FLAG_VALGRIND);
let arena = &arena;
@ -368,7 +366,6 @@ pub fn test(matches: &ArgMatches, triple: Triple) -> io::Result<i32> {
let loaded = roc_load::load_and_monomorphize(
arena,
path,
src_dir,
subs_by_module,
target_info,
// TODO: expose this from CLI?
@ -494,12 +491,10 @@ pub fn build(
}
});
let src_dir = path.parent().unwrap().canonicalize().unwrap();
let target_valgrind = matches.is_present(FLAG_VALGRIND);
let res_binary_path = build_file(
&arena,
&triple,
src_dir,
path,
opt_level,
emit_debug_info,