Description
Repro steps :
in rules_swift
master branch, run the following command (options documented here)
bazelisk build //examples/apple/objc_interop_modulemap:objc_interop_modulemap --swiftcopt=-stats-output-dir --swiftcopt=/Users/ycho/Snapchat/Dev/rules_swift/stats --swiftcopt=-trace-stats-events --swiftcopt=-v
Expected result
trace csv files are generated under stats directory
Actual Result
ERROR: /Users/ycho/Snapchat/Dev/rules_swift/examples/apple/objc_interop_modulemap/BUILD:17:14: Compiling Swift module //examples/apple/objc_interop_modulemap:Printer failed: (Exit 1): worker failed: error executing SwiftCompile command (from target //examples/apple/objc_interop_modulemap:Printer) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/tools/worker/worker swiftc ... (remaining 1 argument skipped)
Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macos13.0
/Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types examples/apple/objc_interop_modulemap/Printer.swift -target arm64-apple-macos13.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -enable-testing -gline-tables-only -debug-info-format=dwarf -dwarf-version=4 -module-cache-path bazel-out/darwin_arm64-fastbuild/bin/_swift_module_cache -static -enforce-exclusivity=checked -stats-output-dir /Users/ycho/Snapchat/Dev/rules_swift/stats -trace-stats-events -Onone -D DEBUG -debug-prefix-map /Applications/Xcode-16.0.0.app/Contents/Developer=/PLACEHOLDER_DEVELOPER_DIR -file-prefix-map /Applications/Xcode-16.0.0.app/Contents/Developer=/PLACEHOLDER_DEVELOPER_DIR -file-prefix-map /private/var/tmp/_bazel_ycho/3a6430e9cbe016187d832ee8479890da/bazel-workers/worker-5-SwiftCompile/_main=. -file-prefix-map /Applications/Xcode-16.0.0.app/Contents/Developer=DEVELOPER_DIR -new-driver-path /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -no-clang-module-breadcrumbs -const-gather-protocols-file swift/toolchains/config/const_protocols_to_gather.json -internalize-at-link -no-serialize-debugging-options -color-diagnostics -disable-clang-spi -enable-experimental-feature AccessLevelOnImport -enable-bare-slash-regex -empty-abi-descriptor -disable-sandbox -resource-dir /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /private/var/tmp/_bazel_ycho/3a6430e9cbe016187d832ee8479890da/bazel-workers/worker-5-SwiftCompile/main -Xcc -iquote. -Xcc -iquotebazel-out/darwin_arm64-fastbuild/bin -Xcc -fmodule-map-file=bazel-out/darwin_arm64-fastbuild/bin/examples/apple/objc_interop_modulemap/PrintStream_modulemap//module.modulemap -Xcc -O0 -Xcc -DDEBUG=1 -module-name examples_apple_objc_interop_modulemap_Printer -disable-clang-spi -target-sdk-version 15.0 -target-sdk-name macosx15.0 -external-plugin-path '/Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -emit-module-doc-path bazel-out/darwin_arm64-fastbuild/bin/examples/apple/objc_interop_modulemap/examples_apple_objc_interop_modulemap_Printer.swiftdoc -emit-module-source-info-path bazel-out/darwin_arm64-fastbuild/bin/examples/apple/objc_interop_modulemap/examples_apple_objc_interop_modulemap_Printer.swiftsourceinfo -emit-objc-header-path bazel-out/darwin_arm64-fastbuild/bin/examples/apple/objc_interop_modulemap/generated_header/Printer-Swift.h -parse-as-library -o bazel-out/darwin_arm64-fastbuild/bin/examples/apple/objc_interop_modulemap/examples_apple_objc_interop_modulemap_Printer.swiftmodule -emit-abi-descriptor-path bazel-out/darwin_arm64-fastbuild/bin/examples/apple/objc_interop_modulemap/examples_apple_objc_interop_modulemap_Printer.abi.json
error: emit-module command failed due to signal 9 (use -v to see invocation)
Target //examples/apple/objc_interop_modulemap:objc_interop_modulemap failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.736s, Critical Path: 1.61s
INFO: 2 processes: 2 internal.
ERROR: Build did NOT complete successfully