File tree Expand file tree Collapse file tree 2 files changed +28
-18
lines changed 
doc/rustc/src/platform-support Expand file tree Collapse file tree 2 files changed +28
-18
lines changed Original file line number Diff line number Diff line change 99
1010import  argparse 
1111from  dataclasses  import  dataclass 
12+ import  fcntl 
1213import  glob 
1314import  hashlib 
1415import  json 
@@ -146,6 +147,9 @@ def host_arch_triple(self):
146147 def  zxdb_script_path (self ):
147148 return  os .path .join (self .tmp_dir (), "zxdb_script" )
148149
150+  def  pm_lockfile_path (self ):
151+  return  os .path .join (self .tmp_dir (), "pm.lock" )
152+ 
149153 def  log_info (self , msg ):
150154 print (msg )
151155
@@ -460,6 +464,9 @@ def start(self):
460464 stderr = self .subprocess_output (),
461465 )
462466
467+  # Create lockfiles 
468+  open (self .pm_lockfile_path (), 'a' ).close ()
469+ 
463470 # Write to file 
464471 self .write_to_file ()
465472
@@ -676,19 +683,25 @@ def log(msg):
676683 log ("Publishing package to repo..." )
677684
678685 # 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 )
692705
693706 log ("Running ffx test..." )
694707
Original file line number Diff line number Diff line change @@ -717,7 +717,7 @@ run the full `tests/ui` test suite:
717717 --stage=2 \
718718 test  tests/ui \
719719 --target x86_64-unknown-fuchsia \
720-  --run=always --jobs 1  \
720+  --run=always    \
721721 --test-args --target-rustcflags \
722722 --test-args -Lnative=${SDK_PATH} /arch/{x64| arm64}/sysroot/lib \
723723 --test-args --target-rustcflags \
@@ -729,9 +729,6 @@ run the full `tests/ui` test suite:
729729)
730730``` 
731731
732- * Note: The test suite cannot be run in parallel at the moment, so ` x.py ` 
733- must be run with ` --jobs 1 `  to ensure only one test runs at a time.* 
734- 
735732By default, ` x.py `  compiles test binaries with ` panic=unwind ` . If you built your
736733Rust toolchain with ` -Cpanic=abort ` , you need to tell ` x.py `  to compile test
737734binaries with ` panic=abort `  as well:
@@ -908,7 +905,7 @@ through our `x.py` invocation. The full invocation is:
908905 --stage=2 \
909906 test  tests/${TEST}  \
910907 --target x86_64-unknown-fuchsia \
911-  --run=always --jobs 1  \
908+  --run=always    \
912909 --test-args --target-rustcflags \
913910 --test-args -Lnative=${SDK_PATH} /arch/{x64| arm64}/sysroot/lib \
914911 --test-args --target-rustcflags \
                         You can’t perform that action at this time. 
           
                  
0 commit comments