File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -40,20 +40,27 @@ pub(super) fn lock_fetch() {
40
40
. unwrap ( ) ;
41
41
}
42
42
43
- pub ( super ) fn lock_build ( cargo : & Path ) {
43
+ pub ( super ) fn lock_build ( cargo : & Path , frozen : bool ) {
44
44
let abi = ABI :: V4 ;
45
45
let access_all = AccessFs :: from_all ( abi) ;
46
- base_ruleset ( )
47
- . add_rules ( path_beneath_rules (
48
- & [ get_cargo_home ( cargo) . join ( "git" ) , get_cargo_home ( cargo) . join ( "registry" ) ] ,
49
- access_all,
50
- ) )
51
- . unwrap ( )
46
+
47
+ let ruleset = base_ruleset ( )
52
48
. add_rules ( path_beneath_rules (
53
49
& [ env:: current_dir ( ) . unwrap ( ) . join ( "build" ) , env:: current_dir ( ) . unwrap ( ) . join ( "dist" ) ] ,
54
50
access_all,
55
51
) )
56
- . unwrap ( )
57
- . restrict_self ( )
58
52
. unwrap ( ) ;
53
+
54
+ let ruleset = if frozen {
55
+ ruleset
56
+ } else {
57
+ ruleset
58
+ . add_rules ( path_beneath_rules (
59
+ & [ get_cargo_home ( cargo) . join ( "git" ) , get_cargo_home ( cargo) . join ( "registry" ) ] ,
60
+ access_all,
61
+ ) )
62
+ . unwrap ( )
63
+ } ;
64
+
65
+ ruleset. restrict_self ( ) . unwrap ( ) ;
59
66
}
Original file line number Diff line number Diff line change @@ -195,6 +195,8 @@ fn main() {
195
195
path:: RelPath :: BUILD . ensure_exists ( & dirs) ;
196
196
path:: RelPath :: DIST . ensure_exists ( & dirs) ;
197
197
198
+ landlock:: lock_build ( & bootstrap_host_compiler. cargo , frozen) ;
199
+
198
200
{
199
201
// Make sure we always explicitly specify the target dir
200
202
let target =
@@ -204,8 +206,6 @@ fn main() {
204
206
std:: fs:: File :: create ( target) . unwrap ( ) ;
205
207
}
206
208
207
- landlock:: lock_build ( & bootstrap_host_compiler. cargo ) ;
208
-
209
209
env:: set_var ( "RUSTC" , "rustc_should_be_set_explicitly" ) ;
210
210
env:: set_var ( "RUSTDOC" , "rustdoc_should_be_set_explicitly" ) ;
211
211
You can’t perform that action at this time.
0 commit comments