Skip to content

[Driver] Derive '-external-plugin-path' #65473

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Apr 27, 2023

(libDriver changes corresponding to swiftlang/swift-driver#1320)
When the current toolchain is not a Xcode toolchain, derive '-external-plugin-path' poinintng Xcode plugins paths, so we can use plugins in Xcode.

rdar://108624128

@rintaro rintaro requested a review from artemcm as a code owner April 27, 2023 20:27
@rintaro
Copy link
Member Author

rintaro commented Apr 27, 2023

@swift-ci Please smoke test

@@ -377,8 +377,6 @@ void ToolChain::addCommonFrontendArgs(const OutputInfo &OI,
}

// Add plugin path options.
inputArgs.AddAllArgs(arguments, options::OPT_plugin_path);

Copy link
Member Author

@rintaro rintaro Apr 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is the same line above (line 239). This was just duplicating -plugin-path

@rintaro rintaro requested review from DougGregor and bnbarham April 27, 2023 20:33
@rintaro
Copy link
Member Author

rintaro commented Apr 27, 2023

@swift-ci Please Build Toolchain macOS Platform

static bool findCurrentSelectedXcodeDir(llvm::SmallVectorImpl<char> &path) {
assert(path.empty());

auto xcrunPath = llvm::sys::findProgramByName("xcode-select");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xcodeSelectPath


auto xcrunPath = llvm::sys::findProgramByName("xcrun");
if (!xcrunPath.getError()) {
// Explicitly ask for the default toolchain so that we don't find a Clang
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swiftc in this case

Comment on lines 249 to 250
// Explicitly ask for the default toolchain so that we don't find a Clang
// included with an open-source toolchain.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment doesn't apply here, we're just doing a xcode-select -p

path::remove_filename(xcodePluginPath); // 'bin'
path::append(xcodePluginPath, "lib", "swift", "host", "plugins");

// '${toolchain}/usr/locallib/swift/host/plugins'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`/local/lib/

@rintaro rintaro force-pushed the driver-external-plugin-path-rdar108624128 branch from 3d8b9c9 to b3024df Compare May 4, 2023 23:40
When the current toolchain is not a Xcode toolchain, derive
'-external-plugin-path' poinintng Xcode plugins paths, so we can use
plugins in Xcode.

rdar://108624128
@rintaro rintaro force-pushed the driver-external-plugin-path-rdar108624128 branch from b3024df to b0f5c39 Compare May 4, 2023 23:41
@rintaro
Copy link
Member Author

rintaro commented May 4, 2023

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented May 5, 2023

@swift-ci Please smoke test

@rintaro rintaro merged commit f984eda into swiftlang:main May 5, 2023
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.

2 participants