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

[SR-5004] Swift build with -whole-module-optimization fails #5007

Closed
tayloraswift opened this issue May 24, 2017 · 2 comments
Closed

[SR-5004] Swift build with -whole-module-optimization fails #5007

tayloraswift opened this issue May 24, 2017 · 2 comments
Labels

Comments

@tayloraswift
Copy link

Previous ID SR-5004
Radar None
Original Reporter @Kelvin13
Type Bug
Status Closed
Resolution Duplicate

Attachment: Download

Environment

Ubuntu 17.04, swift-3.1-dev trunk, also tested on swift-3.1-RELEASE

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 9b05891d406477c3bb6b9cb05f2e887b

duplicates:

  • SR-3660 Add support for custom build configuration

is duplicated by:

  • SR-5005 Swift build with -whole-module-optimization crashes following normal build

relates to:

  • SR-5017 Display a warning when an obviously wrong flag is passed using -Xswiftc/-Xcc/-Xlinker

Issue Description:

My projects build normally, but when the `-Xswiftc -whole-module-optimization` flag is passed, the build fails with something like

taylorswift@bmr13:~/wmo$ swift build -Xswiftc -whole-module-optimization
Compile Swift Module 'wmo' (1 sources)
<unknown>:0: error: unable to open dependencies file '/home/taylorswift/wmo/.build/debug/wmo.build/main.d'
<unknown>:0: error: build had 1 command failures

This has occurred on multiple projects; see https://github.com/kelvin13/noise for an example of a “real” project (with actual modules) that’s failing to build. A highly reduced test case is attached.

Related: https://bugs.swift.org/browse/SR-5005

@belkadan
Copy link

Same as SR-5005: I don't think you can just add -whole-module-optimization using -Xswiftc. The package manager has to know about it to link your project correctly.

@ankitspd
Copy link
Member

Thats right. `-Xswiftc` is workaround to lack of build settings and we pass these flags to compiler/linker as-is. You can use `-c release` to turn on WMO. We will have some kind of feature to allow custom build configurations but for now you only have the two inbuilt choices.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants