bazelbuild / rules_swift

Bazel rules to build Swift on Apple and Linux platforms
Apache License 2.0
312 stars 137 forks source link

`swift.opt_uses_wmo` feature flag is broken ? #1453

Closed vakhidbetrakhmadov closed 6 hours ago

vakhidbetrakhmadov commented 6 hours ago

Hi

I am building an ios_application with the following build settings in .bazelrc

--compilation_mode=opt
--features=swift.opt_uses_wmo

When i check build logs, i CAN'T find -whole-module-optimization flag being passed to the compiler.

If i explicitly pass the following build settings:

--swiftcopt=-Xfrontend --swiftcopt=-whole-module-optimization

when i check build logs, i CAN find -whole-module-optimization flag being passed to the compiler.

I have created a minimal repro example: https://github.com/vakhidbetrakhmadov/wmo_repro

Please run make build to observe the first case described above, or make build-wmo to observe the second one.

brentleyjones commented 6 hours ago

I'm not able to reproduce this. swift.opt_uses_wmo is enabled by default. The following command has -whole-module-optimization in the params file:

bazel build -s --compilation_mode=opt examples/xplatform/hello_world

Same for your repro, I see the flag being passed.