File tree 2 files changed +28
-18
lines changed
doc/rustc/src/platform-support
2 files changed +28
-18
lines changed Original file line number Diff line number Diff line change 9
9
10
10
import argparse
11
11
from dataclasses import dataclass
12
+ import fcntl
12
13
import glob
13
14
import hashlib
14
15
import json
@@ -146,6 +147,9 @@ def host_arch_triple(self):
146
147
def zxdb_script_path (self ):
147
148
return os .path .join (self .tmp_dir (), "zxdb_script" )
148
149
150
+ def pm_lockfile_path (self ):
151
+ return os .path .join (self .tmp_dir (), "pm.lock" )
152
+
149
153
def log_info (self , msg ):
150
154
print (msg )
151
155
@@ -460,6 +464,9 @@ def start(self):
460
464
stderr = self .subprocess_output (),
461
465
)
462
466
467
+ # Create lockfiles
468
+ open (self .pm_lockfile_path (), 'a' ).close ()
469
+
463
470
# Write to file
464
471
self .write_to_file ()
465
472
@@ -676,19 +683,25 @@ def log(msg):
676
683
log ("Publishing package to repo..." )
677
684
678
685
# Publish package to repo
679
- subprocess .check_call (
680
- [
681
- self .tool_path ("pm" ),
682
- "publish" ,
683
- "-a" ,
684
- "-repo" ,
685
- self .repo_dir (),
686
- "-f" ,
687
- far_path ,
688
- ],
689
- stdout = log_file ,
690
- stderr = log_file ,
691
- )
686
+ with open (self .pm_lockfile_path (), 'w' ) as pm_lockfile :
687
+ fcntl .lockf (pm_lockfile .fileno (), fcntl .LOCK_EX )
688
+ subprocess .check_call (
689
+ [
690
+ self .tool_path ("pm" ),
691
+ "publish" ,
692
+ "-a" ,
693
+ "-repo" ,
694
+ self .repo_dir (),
695
+ "-f" ,
696
+ far_path ,
697
+ ],
698
+ stdout = log_file ,
699
+ stderr = log_file ,
700
+ )
701
+ # This lock should be released automatically when the pm
702
+ # lockfile is closed, but we'll be polite and unlock it now
703
+ # since the spec leaves some wiggle room.
704
+ fcntl .lockf (pm_lockfile .fileno (), fcntl .LOCK_UN )
692
705
693
706
log ("Running ffx test..." )
694
707
Original file line number Diff line number Diff line change @@ -716,7 +716,7 @@ run the full `tests/ui` test suite:
716
716
--stage=2 \
717
717
test tests/ui \
718
718
--target x86_64-unknown-fuchsia \
719
- --run=always --jobs 1 \
719
+ --run=always \
720
720
--test-args --target-rustcflags \
721
721
--test-args -Lnative=${SDK_PATH} /arch/{x64| arm64}/sysroot/lib \
722
722
--test-args --target-rustcflags \
@@ -728,9 +728,6 @@ run the full `tests/ui` test suite:
728
728
)
729
729
```
730
730
731
- * Note: The test suite cannot be run in parallel at the moment, so ` x.py `
732
- must be run with ` --jobs 1 ` to ensure only one test runs at a time.*
733
-
734
731
By default, ` x.py ` compiles test binaries with ` panic=unwind ` . If you built your
735
732
Rust toolchain with ` -Cpanic=abort ` , you need to tell ` x.py ` to compile test
736
733
binaries with ` panic=abort ` as well:
@@ -907,7 +904,7 @@ through our `x.py` invocation. The full invocation is:
907
904
--stage=2 \
908
905
test tests/${TEST} \
909
906
--target x86_64-unknown-fuchsia \
910
- --run=always --jobs 1 \
907
+ --run=always \
911
908
--test-args --target-rustcflags \
912
909
--test-args -Lnative=${SDK_PATH} /arch/{x64| arm64}/sysroot/lib \
913
910
--test-args --target-rustcflags \
You can’t perform that action at this time.
0 commit comments