@@ -379,16 +379,16 @@ pub fn compiler_args(
379
379
. par_iter ( )
380
380
. map ( |package_name| {
381
381
let canonicalized_path = if let Some ( packages) = packages {
382
- packages
383
- . get ( package_name)
384
- . expect ( "expect package" )
385
- . path
386
- . to_string ( )
382
+ let package = packages. get ( package_name) . expect ( "expect package" ) ;
383
+ package. path . to_string ( )
387
384
} else {
388
385
packages:: read_dependency ( package_name, project_root, project_root, workspace_root)
389
386
. expect ( "cannot find dep" )
390
387
} ;
391
- vec ! [ "-I" . to_string( ) , packages:: get_build_path( & canonicalized_path) ]
388
+ vec ! [
389
+ "-I" . to_string( ) ,
390
+ packages:: get_ocaml_build_path( & canonicalized_path) ,
391
+ ]
392
392
} )
393
393
. collect :: < Vec < Vec < String > > > ( ) ;
394
394
@@ -475,7 +475,7 @@ pub fn compiler_args(
475
475
vec ! [
476
476
namespace_args,
477
477
read_cmi_args,
478
- vec![ "-I" . to_string( ) , "." . to_string( ) ] ,
478
+ vec![ "-I" . to_string( ) , "../ocaml " . to_string( ) ] ,
479
479
deps. concat( ) ,
480
480
uncurried_args,
481
481
bsc_flags. to_owned( ) ,
@@ -510,6 +510,7 @@ fn compile_file(
510
510
workspace_root : & Option < String > ,
511
511
build_dev_deps : bool ,
512
512
) -> Result < Option < String > > {
513
+ let ocaml_build_path_abs = package. get_ocaml_build_path ( ) ;
513
514
let build_path_abs = package. get_build_path ( ) ;
514
515
let implementation_file_path = match & module. source_type {
515
516
SourceType :: SourceFile ( ref source_file) => Ok ( & source_file. implementation . path ) ,
@@ -566,13 +567,13 @@ fn compile_file(
566
567
// we just remove the @ for now. This makes sure the editor support
567
568
// doesn't break
568
569
. join ( module_name. to_owned ( ) + ".cmi" ) ,
569
- build_path_abs . to_string ( ) + "/" + & module_name + ".cmi" ,
570
+ ocaml_build_path_abs . to_string ( ) + "/" + & module_name + ".cmi" ,
570
571
) ;
571
572
let _ = std:: fs:: copy (
572
573
std:: path:: Path :: new ( & package. get_build_path ( ) )
573
574
. join ( dir)
574
575
. join ( module_name. to_owned ( ) + ".cmj" ) ,
575
- build_path_abs . to_string ( ) + "/" + & module_name + ".cmj" ,
576
+ ocaml_build_path_abs . to_string ( ) + "/" + & module_name + ".cmj" ,
576
577
) ;
577
578
let _ = std:: fs:: copy (
578
579
std:: path:: Path :: new ( & package. get_build_path ( ) )
@@ -581,20 +582,20 @@ fn compile_file(
581
582
// we just remove the @ for now. This makes sure the editor support
582
583
// doesn't break
583
584
. join ( module_name. to_owned ( ) + ".cmt" ) ,
584
- build_path_abs . to_string ( ) + "/" + & module_name + ".cmt" ,
585
+ ocaml_build_path_abs . to_string ( ) + "/" + & module_name + ".cmt" ,
585
586
) ;
586
587
} else {
587
588
let _ = std:: fs:: copy (
588
589
std:: path:: Path :: new ( & package. get_build_path ( ) )
589
590
. join ( dir)
590
591
. join ( module_name. to_owned ( ) + ".cmti" ) ,
591
- build_path_abs . to_string ( ) + "/" + & module_name + ".cmti" ,
592
+ ocaml_build_path_abs . to_string ( ) + "/" + & module_name + ".cmti" ,
592
593
) ;
593
594
let _ = std:: fs:: copy (
594
595
std:: path:: Path :: new ( & package. get_build_path ( ) )
595
596
. join ( dir)
596
597
. join ( module_name. to_owned ( ) + ".cmi" ) ,
597
- build_path_abs . to_string ( ) + "/" + & module_name + ".cmi" ,
598
+ ocaml_build_path_abs . to_string ( ) + "/" + & module_name + ".cmi" ,
598
599
) ;
599
600
}
600
601
match & module. source_type {
0 commit comments