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

@ -92,7 +92,6 @@ pub fn load_and_monomorphize_from_str<'a>(
pub fn load_and_monomorphize(
arena: &Bump,
filename: PathBuf,
src_dir: PathBuf,
exposed_types: ExposedByModule,
target_info: TargetInfo,
render: RenderTarget,
@ -100,7 +99,7 @@ pub fn load_and_monomorphize(
) -> Result<MonomorphizedModule<'_>, LoadingProblem<'_>> {
use LoadResult::*;
let load_start = LoadStart::from_path(arena, src_dir, filename, render)?;
let load_start = LoadStart::from_path(arena, filename, render)?;
match load(
arena,
@ -119,7 +118,6 @@ pub fn load_and_monomorphize(
pub fn load_and_typecheck(
arena: &Bump,
filename: PathBuf,
src_dir: PathBuf,
exposed_types: ExposedByModule,
target_info: TargetInfo,
render: RenderTarget,
@ -127,7 +125,7 @@ pub fn load_and_typecheck(
) -> Result<LoadedModule, LoadingProblem<'_>> {
use LoadResult::*;
let load_start = LoadStart::from_path(arena, src_dir, filename, render)?;
let load_start = LoadStart::from_path(arena, filename, render)?;
match load(
arena,