File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,15 @@ pub(crate) enum SysrootKind {
48
48
pub fn main ( ) {
49
49
env:: set_var ( "CG_CLIF_DISPLAY_CG_TIME" , "1" ) ;
50
50
env:: set_var ( "CG_CLIF_DISABLE_INCR_CACHE" , "1" ) ;
51
- // The target dir is expected in the default location. Guard against the user changing it.
52
- env:: set_var ( "CARGO_TARGET_DIR" , "target" ) ;
51
+
52
+ {
53
+ // Make sure we always explicitly specify the target dir
54
+ let target = "build/target_dir_should_be_set_explicitly" ;
55
+ env:: set_var ( "CARGO_TARGET_DIR" , target) ;
56
+ std:: fs:: create_dir_all ( "build" ) . unwrap ( ) ;
57
+ let _ = std:: fs:: remove_file ( target) ;
58
+ let file = std:: fs:: File :: create ( target) . unwrap ( ) ;
59
+ }
53
60
54
61
if is_ci ( ) {
55
62
// Disabling incr comp reduces cache size and incr comp doesn't save as much on CI anyway
You can’t perform that action at this time.
0 commit comments