Skip to content

Conversation

3405691582
Copy link
Member

  • Explanation:

Ensures the native-clang-tools-path option works correctly with the build support modules.

The build support Python libraries assume by default that if we do not supply a Swift toolchain path, we can find clang in the installed toolchain path: i.e., the clang that we just built. However, possibly during bootstrap, we may not have a preexisting Swift compiler but still want to use the clang on the platform that is already installed.

build-script already gives us native-clang-tools-path. Here, we plumb this through to the relevant Python modules. If the native-clang-tools-path is not specified, we use the install_toolchain_path, just like native_toolchain_path, and the existing behavior is effectively unchanged. If we do specify a native-clang-tools-path, then we return it to ensure that we properly refer to the clang that lives there instead of always defaulting to the just-built clang.

(This is the same as #82768, applied to release/6.2.1.)

  • Scope:

Changes are limited to the build system only, and as mentioned, if native-clang-tools-path is not specified, the behavior is unchanged.

  • Issues:

Of relevance to the OpenBSD port in #78437, since we likely do not want to use the just-built LLVM tools like clang as part of the installation.

  • Original PRs:

#81587

  • Risk:

Minimal, only potentially affects seldom-used flag.

  • Testing:

Has passed CI.

  • Reviewers:

@justice-adams-apple

The build support Python libraries assume by default that if we do not
supply a Swift toolchain path, we can find clang in the installed
toolchain path: i.e., the clang that we just built. However, possibly
during bootstrap, we may not have a preexisting Swift compiler but still
want to use the clang on the platform that is already installed.

build-script already gives us native-clang-tools-path. Here, we plumb
this through to the relevant Python modules. If the
native-clang-tools-path is not specified, we use the
install_toolchain_path, just like native_toolchain_path, and the
existing behavior is effectively unchanged. If we do specify a
native-clang-tools-path, then we return it to ensure that we properly
refer to the clang that lives there instead of always defaulting to the
just-built clang.
@3405691582
Copy link
Member Author

@swift-ci please test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant