Skip to content

Commit 8a3d7fc

Browse files
committed
[build-script][test] Remove hard-coded install prefix of /usr and pass it in instead
1 parent f008618 commit 8a3d7fc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/ISDBTibs/TibsToolchain.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ extension TibsToolchain {
132132

133133
let fm = FileManager.default
134134

135-
let envVar = "INDEXSTOREDB_TOOLCHAIN_PATH"
135+
let envVar = "INDEXSTOREDB_TOOLCHAIN_BIN_PATH"
136136
if let path = ProcessInfo.processInfo.environment[envVar] {
137-
let bin = URL(fileURLWithPath: "\(path)/usr/bin", isDirectory: true)
137+
let bin = URL(fileURLWithPath: "\(path)/bin", isDirectory: true)
138138
swiftc = bin.appendingPathComponent("swiftc", isDirectory: false)
139139
clang = bin.appendingPathComponent("clang", isDirectory: false)
140140

Utilities/build-script-helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def get_swiftpm_options(args):
3737
swiftpm_args += [
3838
# Dispatch headers
3939
'-Xcxx', '-I', '-Xcxx',
40-
os.path.join(args.toolchain, 'usr', 'lib', 'swift'),
40+
os.path.join(args.toolchain, 'lib', 'swift'),
4141
# For <Block.h>
4242
'-Xcxx', '-I', '-Xcxx',
43-
os.path.join(args.toolchain, 'usr', 'lib', 'swift', 'Block'),
43+
os.path.join(args.toolchain, 'lib', 'swift', 'Block'),
4444
]
4545

4646
return swiftpm_args
@@ -51,7 +51,7 @@ def handle_invocation(swift_exec, args):
5151

5252
env = os.environ
5353
# Set the toolchain used in tests at runtime
54-
env['INDEXSTOREDB_TOOLCHAIN_PATH'] = args.toolchain
54+
env['INDEXSTOREDB_TOOLCHAIN_BIN_PATH'] = args.toolchain
5555

5656
if args.ninja_bin:
5757
env['NINJA_BIN'] = args.ninja_bin
@@ -105,7 +105,7 @@ def add_common_args(parser):
105105
args.toolchain = os.path.abspath(args.toolchain)
106106

107107
if args.toolchain:
108-
swift_exec = os.path.join(args.toolchain, 'usr', 'bin', 'swift')
108+
swift_exec = os.path.join(args.toolchain, 'bin', 'swift')
109109
else:
110110
swift_exec = 'swift'
111111

0 commit comments

Comments
 (0)