Skip to content

Commit 682b375

Browse files
authored
Merge pull request #30565 from buttaface/prefix
[build-script] Add the installation prefix to the toolchain path
2 parents 177bd24 + 41ef65c commit 682b375

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

utils/swift_build_support/swift_build_support/products/pythonkit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def should_build(self, host_target):
3232
def build(self, host_target):
3333
toolchain_path = targets.toolchain_path(self.args.install_destdir,
3434
self.args.install_prefix)
35-
swiftc = os.path.join(toolchain_path, 'usr', 'bin', 'swiftc')
35+
swiftc = os.path.join(toolchain_path, 'bin', 'swiftc')
3636

3737
# FIXME: this is a workaround for CMake <3.16 which does not correctly
3838
# generate the build rules if you are not in the build directory. As a
@@ -52,7 +52,7 @@ def build(self, host_target):
5252
self.toolchain.cmake,
5353
'-G', 'Ninja',
5454
'-D', 'BUILD_SHARED_LIBS=YES',
55-
'-D', 'CMAKE_INSTALL_PREFIX={}/usr'.format(
55+
'-D', 'CMAKE_INSTALL_PREFIX={}'.format(
5656
self.install_toolchain_path()),
5757
'-D', 'CMAKE_MAKE_PROGRAM={}'.format(self.toolchain.ninja),
5858
'-D', 'CMAKE_Swift_COMPILER={}'.format(swiftc),

utils/swift_build_support/swift_build_support/products/swiftpm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def run_bootstrap_script(self, action, host_target, additional_params=[]):
3232
script_path = os.path.join(
3333
self.source_dir, 'Utilities', 'bootstrap')
3434
toolchain_path = self.install_toolchain_path()
35-
swiftc = os.path.join(toolchain_path, "usr", "bin", "swiftc")
35+
swiftc = os.path.join(toolchain_path, "bin", "swiftc")
3636

3737
# FIXME: We require llbuild build directory in order to build. Is
3838
# there a better way to get this?

utils/swift_build_support/swift_build_support/products/tensorflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def should_build(self, host_target):
3232
def build(self, host_target):
3333
toolchain_path = targets.toolchain_path(self.args.install_destdir,
3434
self.args.install_prefix)
35-
swiftc = os.path.join(toolchain_path, 'usr', 'bin', 'swiftc')
35+
swiftc = os.path.join(toolchain_path, 'bin', 'swiftc')
3636

3737
# FIXME: this is a workaround for CMake <3.16 which does not correctly
3838
# generate the build rules if you are not in the build directory. As a
@@ -52,7 +52,7 @@ def build(self, host_target):
5252
self.toolchain.cmake,
5353
'-G', 'Ninja',
5454
'-D', 'BUILD_SHARED_LIBS=YES',
55-
'-D', 'CMAKE_INSTALL_PREFIX={}/usr'.format(
55+
'-D', 'CMAKE_INSTALL_PREFIX={}'.format(
5656
self.install_toolchain_path()),
5757
'-D', 'CMAKE_MAKE_PROGRAM={}'.format(self.toolchain.ninja),
5858
'-D', 'CMAKE_Swift_COMPILER={}'.format(swiftc),

utils/swift_build_support/swift_build_support/targets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,7 @@ def toolchain_path(install_destdir, install_prefix):
291291
built_toolchain_path = install_destdir
292292
if platform.system() == 'Darwin':
293293
# The prefix is an absolute path, so concatenate without os.path.
294-
built_toolchain_path += darwin_toolchain_prefix(install_prefix)
294+
built_toolchain_path += darwin_toolchain_prefix(install_prefix) + "/usr"
295+
else:
296+
built_toolchain_path += install_prefix
295297
return built_toolchain_path

0 commit comments

Comments
 (0)