Skip to content

Commit 2d1930f

Browse files
authored
Merge pull request #29310 from Rostepher/remove-old-which-module
[NFC][Build System: build-script] Remove the old which module in swift_build_support.
2 parents ce7888e + ac431fa commit 2d1930f

File tree

5 files changed

+5
-81
lines changed

5 files changed

+5
-81
lines changed

utils/scale-test

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,20 @@ import tempfile
2828
from collections import namedtuple
2929
from operator import attrgetter
3030

31+
from build_swift.build_swift import shell
32+
3133
import gyb
3234

3335
from jobstats import load_stats_dir, merge_all_jobstats
3436

3537

36-
def find_which(p):
37-
for d in os.environ["PATH"].split(os.pathsep):
38-
full = os.path.join(d, p)
39-
if os.path.isfile(full) and os.access(full, os.X_OK):
40-
return full
41-
return p
42-
43-
4438
# Evidently the debug-symbol reader in dtrace is sufficiently slow and/or buggy
4539
# that attempting to inject probes into a binary w/ debuginfo is asking for a
4640
# failed run (possibly racing with probe insertion, or probing the stabs
4741
# entries, see rdar://problem/7037927 or rdar://problem/11490861 respectively),
4842
# so we sniff the presence of debug symbols here.
4943
def has_debuginfo(swiftc):
50-
swiftc = find_which(swiftc)
44+
swiftc = shell.which(swiftc)
5145
for line in subprocess.check_output(
5246
["dwarfdump", "--file-stats", swiftc]).splitlines():
5347
if '%' not in line:

utils/swift_build_support/swift_build_support/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#
1616
# ----------------------------------------------------------------------------
1717

18-
from .which import which
19-
2018
__all__ = [
2119
"cmake",
2220
"debug",
@@ -25,6 +23,5 @@
2523
"tar",
2624
"targets",
2725
"toolchain",
28-
"which",
2926
"xcrun",
3027
]

utils/swift_build_support/swift_build_support/toolchain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818

1919
import platform
2020

21+
from build_swift.build_swift.shell import which
22+
2123
from . import cache_util
2224
from . import shell
2325
from . import xcrun
24-
from .which import which
2526

2627
__all__ = [
2728
'host_toolchain',

utils/swift_build_support/swift_build_support/which.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

utils/swift_build_support/tests/test_which.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)