Skip to content

[Darwin] Add external plugin paths into platform specified by PLATFORM_DIR #1726

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 2 commits into from
Nov 7, 2024

Conversation

DougGregor
Copy link
Member

The driver currently has logic to infer the location of the platform based on the conventional layout of SDKs within platforms. However, that doesn't work well when SDKs have been built up in other places.

Introduce support for a second convention, that the PLATFORM_DIR environment variable can specify the path to the platform. When present, also add external plugin paths pointing into that platform.

Fixes rdar://138370421.

…M_DIR

The driver currently has logic to infer the location of the platform
based on the conventional layout of SDKs within platforms. However,
that doesn't work well when SDKs have been built up in other places.

Introduce support for a second convention, that the PLATFORM_DIR
environment variable can specify the path to the platform. When
present, also add external plugin paths pointing into that platform.

Fixes rdar://138370421.
@DougGregor
Copy link
Member Author

@swift-ci please test

Comment on lines 468 to 476
// If the PLATFORM_DIR environment variable is set, also add plugin
// paths into it.
if let platformDir = env["PLATFORM_DIR"],
let platformPath = try? VirtualPath(path: platformDir) {
addPluginPaths(
forPlatform: platformPath,
commandLine: &commandLine
)
}
Copy link
Member

@rintaro rintaro Nov 6, 2024

Choose a reason for hiding this comment

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

I think env["PLATFORM_DIR"] based paths should precedes the SDK path based paths.
If there are plugins with the same name in the both directories, earlier -external-plugin-path option takes the precedence.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I've moved it first

Since PLATFORM_DIR is the override, put it before the default-derived path.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test Windows

@DougGregor DougGregor merged commit 7e74ff6 into swiftlang:main Nov 7, 2024
3 checks passed
@DougGregor DougGregor deleted the darwin-platform-dir-env-var branch November 7, 2024 01:46
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.

3 participants