taskcluster-taskgraph 24.2.2__py3-none-any.whl → 24.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: taskcluster-taskgraph
3
- Version: 24.2.2
3
+ Version: 24.2.3
4
4
  Summary: Build taskcluster taskgraphs
5
5
  Project-URL: Repository, https://github.com/taskcluster/taskgraph
6
6
  Project-URL: Issues, https://github.com/taskcluster/taskgraph/issues
@@ -28,7 +28,7 @@ taskgraph/optimize/base.py,sha256=c2ETEJChLCFm6yoA-IcWepu7V0eOIA_e_tQfFwld-EA,20
28
28
  taskgraph/optimize/strategies.py,sha256=SAzMXbp_oQ3EJ2pDLOvShh2RosJExCRTZR4PFsD-3l0,3776
29
29
  taskgraph/run-task/fetch-content,sha256=ZpjiX-SmosoKBGyG-GxWtAGvUCzspWMrmoFQXhbhw8s,36209
30
30
  taskgraph/run-task/hgrc,sha256=BybWLDR89bWi3pE5T05UqmDHs02CbLypE-omLZWU6Uk,896
31
- taskgraph/run-task/robustcheckout.py,sha256=DZ-MB68P7FmZY1vkj7o3Xp-d21aOiFnLMimv25S3FTs,30778
31
+ taskgraph/run-task/robustcheckout.py,sha256=85tcHqlAlWre1RYJ5qu3CJtqAAsMnB9AlDeN4zfpOrQ,33021
32
32
  taskgraph/run-task/run-task,sha256=yEQqTaw2u7hgFqlUmWsN10J89GFarZhQtIheFl6WI0I,47409
33
33
  taskgraph/transforms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  taskgraph/transforms/base.py,sha256=NULQNfwJfBTo0Bem1hp_6aDztUABwbnJrQ0MBpOgGDE,5125
@@ -75,8 +75,8 @@ taskgraph/util/vcs.py,sha256=Z2sCJT0-kwP_AbSUMIzya9lk8SyjWPzMYtQPYJ2WtnA,22496
75
75
  taskgraph/util/verify.py,sha256=hY6xl4rEgXeVuPswG8HCGBHJNKHF2QXx2cTxrrRtDeE,14829
76
76
  taskgraph/util/workertypes.py,sha256=SpqQmf99kB9QxtgOdXeMUvzuVv1o0ZVB4lYahZH3jDY,2534
77
77
  taskgraph/util/yaml.py,sha256=29h6RE7JA4z0U2V3WCu-S39lPMBS9CEZEglv1delDvw,1075
78
- taskcluster_taskgraph-24.2.2.dist-info/METADATA,sha256=dgtz4W6pVH4-KRYuFfTfcs7rJyUUq6AnEVJ9uT56stk,5065
79
- taskcluster_taskgraph-24.2.2.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
80
- taskcluster_taskgraph-24.2.2.dist-info/entry_points.txt,sha256=2hxDzE3qq_sHh-J3ROqwpxgQgxO-196phWAQREl2-XA,50
81
- taskcluster_taskgraph-24.2.2.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
82
- taskcluster_taskgraph-24.2.2.dist-info/RECORD,,
78
+ taskcluster_taskgraph-24.2.3.dist-info/METADATA,sha256=tyKgYggjak7xdcvD5WcbEwZcWseWv5sDgBJwC8vWrXE,5065
79
+ taskcluster_taskgraph-24.2.3.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
80
+ taskcluster_taskgraph-24.2.3.dist-info/entry_points.txt,sha256=2hxDzE3qq_sHh-J3ROqwpxgQgxO-196phWAQREl2-XA,50
81
+ taskcluster_taskgraph-24.2.3.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
82
+ taskcluster_taskgraph-24.2.3.dist-info/RECORD,,
@@ -18,6 +18,7 @@ import random
18
18
  import re
19
19
  import socket
20
20
  import ssl
21
+ import stat
21
22
  import time
22
23
 
23
24
  from mercurial.i18n import _
@@ -38,6 +39,22 @@ from mercurial import (
38
39
  vfs,
39
40
  )
40
41
 
42
+ # TRACKING hg72 - `hg.repository`/`hg.peer` moved to `mercurial.repo.factory`.
43
+ try:
44
+ from mercurial.repo import factory as _repofactory
45
+
46
+ _repository = _repofactory.repository
47
+ _peer = _repofactory.peer
48
+ except ImportError:
49
+ _repository = hg.repository
50
+ _peer = hg.peer
51
+
52
+ # TRACKING hg72 - `hg.clone` moved to `mercurial.cmd_impls.clone.clone`.
53
+ try:
54
+ from mercurial.cmd_impls.clone import clone as _clone
55
+ except ImportError:
56
+ _clone = hg.clone
57
+
41
58
  # Causes worker to purge caches on process exit and for task to retry.
42
59
  EXIT_PURGE_CACHE = 72
43
60
 
@@ -67,6 +84,57 @@ def peerlookup(remote, v):
67
84
  return e.callcommand(b"lookup", {b"key": v}).result()
68
85
 
69
86
 
87
+ def remove_dangling_links(ui, path):
88
+ """On Windows, remove dangling symlinks and junctions under ``path``.
89
+
90
+ npm's ``file:`` protocol dependencies create directory junctions in
91
+ ``node_modules/`` with absolute targets. When a Taskcluster cache
92
+ is restored to a different task directory those targets no longer
93
+ exist, and Mercurial's purge crashes in ``vfs.listdir()`` with
94
+ ``FileNotFoundError``. Removing them first lets purge proceed.
95
+ """
96
+ if os.name != "nt":
97
+ return
98
+
99
+ ui.write(b"windows detected, removing dangling links\n")
100
+
101
+ stack = [path]
102
+ while stack:
103
+ dirpath = stack.pop()
104
+ try:
105
+ entries = os.scandir(dirpath)
106
+ except OSError:
107
+ continue
108
+
109
+ with entries:
110
+ for entry in entries:
111
+ p = entry.path
112
+ try:
113
+ attrs = entry.stat(follow_symlinks=False).st_file_attributes
114
+ except OSError:
115
+ continue
116
+
117
+ if attrs & stat.FILE_ATTRIBUTE_REPARSE_POINT:
118
+ if not os.path.exists(p):
119
+ ui.write(
120
+ b"(removing dangling link %s)\n"
121
+ % os.fsencode(os.path.relpath(p, path))
122
+ )
123
+ try:
124
+ os.rmdir(p)
125
+ except OSError:
126
+ os.remove(p)
127
+ continue
128
+
129
+ try:
130
+ is_dir = entry.is_dir(follow_symlinks=False)
131
+ except OSError:
132
+ continue
133
+
134
+ if is_dir:
135
+ stack.append(p)
136
+
137
+
70
138
  @command(
71
139
  b"robustcheckout",
72
140
  [
@@ -427,7 +495,7 @@ def _docheckout(
427
495
  def handlerepoerror(e):
428
496
  if pycompat.bytestr(e) == _(b"abandoned transaction found"):
429
497
  ui.warn(b"(abandoned transaction found; trying to recover)\n")
430
- repo = hg.repository(ui, dest)
498
+ repo = _repository(ui, dest)
431
499
  if not repo.recover():
432
500
  ui.warn(b"(could not recover repo state; deleting shared store)\n")
433
501
  with timeit("remove_unrecovered_shared_store", "remove-store"):
@@ -535,7 +603,7 @@ def _docheckout(
535
603
  cloneurl = upstream or url
536
604
 
537
605
  try:
538
- clonepeer = hg.peer(ui, {}, cloneurl)
606
+ clonepeer = _peer(ui, {}, cloneurl)
539
607
  rootnode = peerlookup(clonepeer, b"0")
540
608
  except error.RepoLookupError:
541
609
  raise error.Abort(b"unable to resolve root revision from clone source")
@@ -623,12 +691,12 @@ def _docheckout(
623
691
  ui.write(b"(cloning from upstream repo %s)\n" % upstream)
624
692
 
625
693
  if not storevfs.exists():
626
- behaviors.add(b"create-store")
694
+ behaviors.add("create-store")
627
695
 
628
696
  try:
629
697
  with timeit("clone", "clone"):
630
698
  shareopts = {b"pool": sharebase, b"mode": b"identity"}
631
- res = hg.clone(
699
+ res = _clone(
632
700
  ui,
633
701
  {},
634
702
  clonepeer,
@@ -667,7 +735,7 @@ def _docheckout(
667
735
  # The destination .hg directory should exist. Now make sure we have the
668
736
  # wanted revision.
669
737
 
670
- repo = hg.repository(ui, dest)
738
+ repo = _repository(ui, dest)
671
739
 
672
740
  # We only pull if we are using symbolic names or the requested revision
673
741
  # doesn't exist.
@@ -694,7 +762,7 @@ def _docheckout(
694
762
 
695
763
  remote = None
696
764
  try:
697
- remote = hg.peer(repo, {}, url)
765
+ remote = _peer(repo, {}, url)
698
766
  pullrevs = [peerlookup(remote, revision or branch)]
699
767
  checkoutrevision = hex(pullrevs[0])
700
768
  if branch:
@@ -741,6 +809,10 @@ def _docheckout(
741
809
  # guaranteed to not have conflicts on `hg update`.
742
810
  if purge and not created:
743
811
  ui.write(b"(purging working directory)\n")
812
+
813
+ with timeit("purge", "dangling_link_remove"):
814
+ remove_dangling_links(ui, dest)
815
+
744
816
  purge = getattr(commands, "purge", None)
745
817
  if not purge:
746
818
  purge = extensions.find(b"purge").purge