diff --git a/src/build.rs b/src/build.rs index e4637b1..9d6db38 100644 --- a/src/build.rs +++ b/src/build.rs @@ -862,7 +862,7 @@ pub fn compile_file( let jsx_mode_args = get_jsx_mode_args(&root_package); let uncurried_args = get_uncurried_args(version, &package, &root_package); - let warning_args: Vec = match package.bsconfig.warnings.to_owned() { + let warning_args: Vec = match root_package.bsconfig.warnings.to_owned() { None => vec![], Some(warnings) => { let warn_number = match warnings.number { @@ -874,7 +874,7 @@ pub fn compile_file( let warn_error = match warnings.error { Some(bsconfig::Error::Catchall(true)) => { - vec!["-warn-error A".to_string()] + vec!["-warn-error".to_string(), "A".to_string()] } Some(bsconfig::Error::Qualified(errors)) => { vec!["-warn-error".to_string(), errors.to_string()] @@ -1203,7 +1203,7 @@ pub fn build(filter: &Option, path: &str) -> Result, path: &str) -> Result 0 { if helpers::contains_ascii_characters(&compile_warnings) { println!("{}", &compile_warnings); diff --git a/src/clean.rs b/src/clean.rs index e7546f9..f614ce7 100644 --- a/src/clean.rs +++ b/src/clean.rs @@ -346,12 +346,7 @@ fn failed_to_parse(module: &Module) -> bool { } } -fn failed_to_compile(module: &Module, no_errors: bool) -> bool { - // also clean up dirty modules when the compile failed - if !no_errors && module.compile_dirty { - return true; - }; - +fn failed_to_compile(module: &Module) -> bool { match &module.source_type { SourceType::SourceFile(SourceFile { implementation: @@ -373,11 +368,7 @@ fn failed_to_compile(module: &Module, no_errors: bool) -> bool { } } -pub fn cleanup_after_build(build_state: &BuildState, no_errors: bool) { - // let failed_modules = all_modules - // .difference(&compiled_modules) - // .collect::>(); - +pub fn cleanup_after_build(build_state: &BuildState) { build_state .modules .par_iter() @@ -395,7 +386,7 @@ pub fn cleanup_after_build(build_state: &BuildState, no_errors: bool) { _ => (), } } - if failed_to_compile(module, no_errors) { + if failed_to_compile(module) { // only retain ast file if it compiled successfully, that's the only thing we check // if we see a AST file, we assume it compiled successfully, so we also need to clean // up the AST file if compile is not successful