@@ -466,11 +466,7 @@ pub fn compiler_args(
466466 format!(
467467 "{}:{}:{}" ,
468468 root_config. get_module( ) ,
469- // compile into lib/bs and later install in the right place
470- Path :: new( "lib/bs" )
471- . join( Path :: new( file_path) . parent( ) . unwrap( ) )
472- . to_str( )
473- . unwrap( ) ,
469+ Path :: new( file_path) . parent( ) . unwrap( ) . to_str( ) . unwrap( ) ,
474470 root_config. get_suffix( )
475471 ) ,
476472 ]
@@ -600,55 +596,6 @@ fn compile_file(
600596 ocaml_build_path_abs. to_string ( ) + "/" + & module_name + ".cmi" ,
601597 ) ;
602598 }
603- match ( & module. source_type , is_interface) {
604- (
605- SourceType :: SourceFile ( SourceFile {
606- implementation : Implementation { path, .. } ,
607- ..
608- } ) ,
609- false ,
610- ) => {
611- // update: we now generate the file in lib/bs/... and then install it in the right
612- // in-source location if the hash is different
613-
614- // the in-source file. This is the currently "installed" file
615- let in_source_hash =
616- helpers:: compute_file_hash ( & helpers:: get_source_file_from_rescript_file (
617- & std:: path:: Path :: new ( & package. path ) . join ( path) ,
618- & root_package. config . get_suffix ( ) ,
619- ) ) ;
620-
621- // this is the file that we just generated
622- let generated_hash =
623- helpers:: compute_file_hash ( & helpers:: get_source_file_from_rescript_file (
624- & std:: path:: Path :: new ( & package. get_build_path ( ) ) . join ( path) ,
625- & root_package. config . get_suffix ( ) ,
626- ) ) ;
627-
628- match ( in_source_hash, generated_hash) {
629- ( Some ( in_source_hash) , Some ( generated_hash) ) if in_source_hash == generated_hash => {
630- // do nothing, the hashes are the same!
631- ( )
632- }
633- _ => {
634- let source = helpers:: get_source_file_from_rescript_file (
635- & std:: path:: Path :: new ( & package. get_build_path ( ) ) . join ( path) ,
636- & root_package. config . get_suffix ( ) ,
637- ) ;
638- let destination = helpers:: get_source_file_from_rescript_file (
639- & std:: path:: Path :: new ( & package. path ) . join ( path) ,
640- & root_package. config . get_suffix ( ) ,
641- ) ;
642- // println!("copying source file to in-source location");
643- // println!("{}", source.display());
644- // println!("{}", destination.display());
645- // copy the file to the in-source location
646- let _ = std:: fs:: copy ( source, destination) . expect ( "copying source file failed" ) ;
647- }
648- }
649- }
650- _ => ( ) ,
651- }
652599
653600 if helpers:: contains_ascii_characters ( & err) {
654601 if package. is_pinned_dep || package. is_local_dep {
0 commit comments