Skip to content

[Driver][Frontend] -nostdimport and -nostdlibimport should remove the default framework search paths #81269

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

Conversation

ian-twilightcoder
Copy link
Contributor

-nostdimport and -nostdlibimport only remove the toolchain and usr/lib/swift search paths, and they leave the framework search paths intact. That makes it impossible to get a fully custom SDK environment. Make their behavior match clang's -nostdinc/-nostdlibinc behavior: treat framework and non-framework paths the same. In other words, -nostdinc removes all compiler provided search paths, and -nostdlibinc removes all SDK search paths.

Rename SkipRuntimeLibraryImportPaths to SkipAllImportPaths, and ExcludeSDKPathsFromRuntimeLibraryImportPaths to SkipSDKImportPaths to reflect their updated behavior.

Move the DarwinImplicitFrameworkSearchPaths handling from SearchPathOptions to CompilerInvocation, where RuntimeLibraryImportPaths is managed. Rename it to just ImplicitFrameworkSearchPaths, and filter for Darwin when it's set up so that all of the clients don't have to do Darwin filtering themselves later.

rdar://150557632

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

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

LGTM. Good cleanup, too.

@ian-twilightcoder ian-twilightcoder force-pushed the nostdimport-remove-framework-paths branch 7 times, most recently from 6a6c93a to c18e318 Compare May 9, 2025 18:42
@ian-twilightcoder ian-twilightcoder force-pushed the nostdimport-remove-framework-paths branch 3 times, most recently from 1224535 to a9c3185 Compare May 12, 2025 20:17
… default framework search paths

-nostdimport and -nostdlibimport only remove the toolchain and usr/lib/swift search paths, and they leave the framework search paths intact. That makes it impossible to get a fully custom SDK environment. Make their behavior match clang's -nostdinc/-nostdlibinc behavior: treat framework and non-framework paths the same. In other words, -nostdinc removes *all* compiler provided search paths, and -nostdlibinc removes *all* SDK search paths.

Rename SkipRuntimeLibraryImportPaths to SkipAllImportPaths, and ExcludeSDKPathsFromRuntimeLibraryImportPaths to SkipSDKImportPaths to reflect their updated behavior.

Move the DarwinImplicitFrameworkSearchPaths handling from SearchPathOptions to CompilerInvocation, where RuntimeLibraryImportPaths is managed. Rename it to just ImplicitFrameworkSearchPaths, and filter for Darwin when it's set up so that all of the clients don't have to do Darwin filtering themselves later.

rdar://150557632
@ian-twilightcoder ian-twilightcoder force-pushed the nostdimport-remove-framework-paths branch from a9c3185 to a6e517e Compare May 13, 2025 05:34
@ian-twilightcoder
Copy link
Contributor Author

@swift-ci smoke test

@ian-twilightcoder ian-twilightcoder merged commit 69c5a02 into swiftlang:main May 13, 2025
3 checks passed
hamishknight added a commit to hamishknight/swift that referenced this pull request May 22, 2025
…tdimport-remove-framework-paths"

This reverts commit 69c5a02.
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