Skip to content

Commit ce5fdf1

Browse files
authored
Bootstrap: Use computed module triple (#9265)
Use the `moduleTriple` field to compute the module triple. ### Motivation: Neither the unversioned target triple or target triple are the module triple. They are often similar, but not guaranteed to be the same, which can cause issues. ``` [2025-10-16T00:39:26.676Z] 11 | //===----------------------------------------------------------------------===// [2025-10-16T00:39:26.676Z] 12 | [2025-10-16T00:39:26.676Z] 13 | @_spi(PackageDescriptionInternal) import PackageDescription [2025-10-16T00:39:26.676Z] | `- error: could not find module 'PackageDescription' for target 'x86_64-unknown-freebsd'; found: x86_64-unknown-freebsd14.3, at: /home/ec2-user/jenkins/workspace/oss-swift-package-freebsd-14/build/buildbot_freebsd/swiftpm-freebsd-x86_64/x86_64-unknown-freebsd/bootstrap/Sources/Runtimes/PackageDescription/PackageDescription.swiftmodule/x86_64-unknown-freebsd ``` #9255 ### Modifications: Updated the cmake bootstrap build to use the module triple instead of the unversioned triple or full target triple. ### Result: We will use the module triple as computed by the Swift compiler to set the module triple that SwiftPM will generate to emit the swiftmodule instead of either the unversioned target triple or full target triple. Neither of which are guaranteed to align with the expected module triple used on the file name.
1 parent fae1549 commit ce5fdf1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Utilities/bootstrap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,8 @@ def build_swiftpm_with_cmake(args):
727727
"""Builds SwiftPM using CMake."""
728728
logging.info("Building SwiftPM (with CMake)")
729729

730-
module_triple = get_build_target(args)
731-
if platform.system() == 'Darwin':
732-
module_triple = module_triple.replace('macosx', 'macos')
730+
get_build_target(args)
731+
module_triple = args.target_info["target"]["moduleTriple"]
733732

734733
cmake_flags = [
735734
get_llbuild_cmake_arg(args),

0 commit comments

Comments
 (0)