Skip to content
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

Supported way to turn off whole-module optimization #7276

Open
dabrahams opened this issue Jan 19, 2024 · 2 comments
Open

Supported way to turn off whole-module optimization #7276

dabrahams opened this issue Jan 19, 2024 · 2 comments

Comments

@dabrahams
Copy link
Contributor

Description

I am asking for a way to turn of whole-module optimzation this that is supported by SPM i.e. does not involve unsafeFlags.
Whether or not this feature is blocked on some work in the compiler, providing the requested feature requires some work in SPM; that's what this issue is for.

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

Swift Package Manager - Swift 5.9.0

Swift & OS version (output of swift --version && uname -a)

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
Darwin DaveA-MBP14-5.local 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64

@keith
Copy link
Member

keith commented Jan 24, 2024

Another option for a hack for this would be to use SWIFT_EXEC to override swiftc with a script that strips the argument. Maybe in some case that would be better than unsafeFlags

@dabrahams
Copy link
Contributor Author

Simply stripping the argument isn't quite enough, but yeah, the basic idea could lead somewhere.

it doesn't look like doing setenv("SWIFT_EXEC", ...) inside of Package.swifthas any effect though. Unless I can figure out how to replace the swiftc used from inside Package.swift, this approach won't allow my package to be used from other packages unless those other packages tell their users to use the swift wrapper from my project.

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

No branches or pull requests

2 participants