mman
(Martin Man)
1
Hi guys,
I used to do swift build --configuration release to produce optimized binary. Today when playing with swift 5.5.1 I noticed that swift build no longer lists the --configuration option as valid.
Is that intentional? Or is it a bug?
€ docker run -it swift:5.5 swift build -help
OVERVIEW: Build sources into binary products
SEE ALSO: swift run, swift package, swift test
USAGE: swift build <options>
OPTIONS:
--build-tests Build both source and test targets
--show-bin-path Print the binary output path
--target <target> Build the specified target
--product <product> Build the specified product
--version Show the version.
-help, -h, --help Show help information.
The 5.4 lists a whole lot of options available.
€ docker run -it swift:5.4 swift build -help
OVERVIEW: Build sources into binary products
SEE ALSO: swift run, swift package, swift test
USAGE: swift build [<options>] --enable-index-store
OPTIONS:
-Xcc <Xcc> Pass flag through to all C compiler invocations
-Xswiftc <Xswiftc> Pass flag through to all Swift compiler invocations
-Xlinker <Xlinker> Pass flag through to all linker invocations
-Xcxx <Xcxx> Pass flag through to all C++ compiler invocations
-c, --configuration <configuration>
Build with configuration (default: debug)
--build-path <build-path>
Specify build/cache directory
--cache-path <cache-path>
Specify the shared cache directory
--enable-repository-cache/--disable-repository-cache
Use a shared cache when fetching repositories (default: true)
-C, --chdir <chdir>
--package-path <package-path>
Change working directory before any other operation
--multiroot-data-file <multiroot-data-file>
--enable-prefetching/--disable-prefetching
(default: true)
-v, --verbose Increase verbosity of informational output
--disable-sandbox Disable using the sandbox when executing subprocesses
--manifest-cache <manifest-cache>
Caching mode of Package.swift manifests (shared: shared cache, local: package's build directory, none: disabled (default: shared)
--destination <destination>
--triple <triple>
--sdk <sdk>
--toolchain <toolchain>
--static-swift-stdlib/--no-static-swift-stdlib
Link Swift stdlib statically (default: false)
--skip-update Skip updating dependencies from their remote during a resolution
--sanitize <sanitize> Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo
--enable-code-coverage/--disable-code-coverage
Enable code coverage (default: false)
--force-resolved-versions, --disable-automatic-resolution
Disable automatic resolution if Package.resolved file is out-of-date
--enable-index-store/--disable-index-store
Enable or disable indexing-while-building feature
--enable-parseable-module-interfaces
--trace-resolver
-j, --jobs <jobs> The number of jobs to spawn in parallel during the build process
--enable-build-manifest-caching/--disable-build-manifest-caching
(default: true)
--emit-swift-module-separately
--use-integrated-swift-driver
--experimental-explicit-module-build
--print-manifest-job-graph
Write the command graph for the build manifest as a graphviz file
--build-system <build-system>
(default: native)
--netrc
--netrc-optional
--netrc-file <netrc-file>
--build-tests Build both source and test targets
--show-bin-path Print the binary output path
--target <target> Build the specified target
--product <product> Build the specified product
--version Show the version.
-help, -h, --help Show help information.
Keith
(Keith Smiley)
2
This was caused by a SwiftPM change that hides options with swift-argument-parser. I filed [SR-15224] [5.5] swift build --help regression · Issue #5734 · apple/swift-package-manager · GitHub a while back and recently submitted Add --help-hidden for use with _hiddenFromHelp by keith · Pull Request #366 · apple/swift-argument-parser · GitHub which would give us a --help-hidden for these more advanced options (although the configuration example I agree shouldn't be hidden, maybe that one should separately be pulled out from this)
2 Likes
Keith
(Keith Smiley)
3
Note that the arguments still exist, they just don't how up in help, so you can continue passing --configuration as before.
1 Like