Skip to content

[build-script][test] Remove hard-coded install prefix of /usr and pass it in instead #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/ISDBTibs/TibsToolchain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ extension TibsToolchain {

let fm = FileManager.default

let envVar = "INDEXSTOREDB_TOOLCHAIN_PATH"
let envVar = "INDEXSTOREDB_TOOLCHAIN_BIN_PATH"
if let path = ProcessInfo.processInfo.environment[envVar] {
let bin = URL(fileURLWithPath: "\(path)/usr/bin", isDirectory: true)
let bin = URL(fileURLWithPath: "\(path)/bin", isDirectory: true)
swiftc = bin.appendingPathComponent("swiftc", isDirectory: false)
clang = bin.appendingPathComponent("clang", isDirectory: false)

Expand Down
8 changes: 4 additions & 4 deletions Utilities/build-script-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def get_swiftpm_options(args):
swiftpm_args += [
# Dispatch headers
'-Xcxx', '-I', '-Xcxx',
os.path.join(args.toolchain, 'usr', 'lib', 'swift'),
os.path.join(args.toolchain, 'lib', 'swift'),
# For <Block.h>
'-Xcxx', '-I', '-Xcxx',
os.path.join(args.toolchain, 'usr', 'lib', 'swift', 'Block'),
os.path.join(args.toolchain, 'lib', 'swift', 'Block'),
]

return swiftpm_args
Expand All @@ -51,7 +51,7 @@ def handle_invocation(swift_exec, args):

env = os.environ
# Set the toolchain used in tests at runtime
env['INDEXSTOREDB_TOOLCHAIN_PATH'] = args.toolchain
env['INDEXSTOREDB_TOOLCHAIN_BIN_PATH'] = args.toolchain

if args.ninja_bin:
env['NINJA_BIN'] = args.ninja_bin
Expand Down Expand Up @@ -105,7 +105,7 @@ def add_common_args(parser):
args.toolchain = os.path.abspath(args.toolchain)

if args.toolchain:
swift_exec = os.path.join(args.toolchain, 'usr', 'bin', 'swift')
swift_exec = os.path.join(args.toolchain, 'bin', 'swift')
else:
swift_exec = 'swift'

Expand Down