Open
Description
Is it reproducible with SwiftPM command-line tools: swift build
, swift test
, swift package
etc?
- Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands,
swift build
,swift test
,swift package
etc.
Description
As @dschaefer2 shared his concerns about build time, interleaving swift build -c release
and swift test -c release
executions require full-rebuilding for every execution because they switch -enable-testing
driver option.
Expected behavior
I think we have three options:
- Keep the current behavior
- Changing testability always requires full rebuilding
- Have separate build description and object directory for with/without testability, not to overwrite artifacts
- Changing testability requires full rebuilding only for the first time
- Need non-trivial refactoring in SwiftPM because we assume a pair of build description and object directory corresponds to a configuration.
- Or internally introduce
[debug, debug-test, release, release-test]
configurations
- Or internally introduce
- Double disk footprint if switching testability even once
- Always build with
-enable-testing
- Changing testability never requires full rebuilding
- Sacrifice runtime performance and code size in release mode
Actual behavior
$ swift build -c release -v 2>&1 | grep "/release/Example.build/Example.swift.o"
$ swift test -c release -v 2>&1 | grep "/release/Example.build/Example.swift.o"
$ swift build -c release -v 2>&1 | grep "/release/Example.build/Example.swift.o"
$ swift test -c release -v 2>&1 | grep "/release/Example.build/Example.swift.o"
...
You can see frontend invocation every time.
Steps to reproduce
No response
Swift Package Manager version/commit hash
Swift & OS version (output of swift --version ; uname -a
)
No response