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

Compilation fails with no helpful clues on Swift 6, with certain upcoming feature flags #76764

Open
MahdiBM opened this issue Sep 28, 2024 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@MahdiBM
Copy link

MahdiBM commented Sep 28, 2024

Description

Compilation fails with no helpful clues on Swift 6 when a previously-valid upcoming feature flag is used in Package.swift, which is now enabled by default in Swift 6.
I was able figure out the "why", because on Linux test CI it was just actually mentioning the problem and asking to remove those upcoming feature flags:

<unknown>:0: error: upcoming feature 'ConciseMagicFile' is already enabled as of Swift version 6
<unknown>:0: error: upcoming feature 'ForwardTrailingClosures' is already enabled as of Swift version 6
<unknown>:0: error: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
<unknown>:0: error: upcoming feature 'BareSlashRegexLiterals' is already enabled as of Swift version 6
<unknown>:0: error: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6

Reproduction

Clone Vapor's PennyBot. Checkout b976b803a3867279abad4edba5d482a126fcd254.

then set these env vars:

PENNY_DIR="path/to/cloned/penny-bot"
TOOLCHAIN_DIR="/path/to/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"
DERIVED_DATA_DIR="/path/to/DerivedData"
PENNY_DERIVED_DATA_DIR="$DERIVED_DATA_DIR/penny-bot-bgzmrsylptrxaregfntbbyweebqd" 
XCODE_DEVELOPER_DIR="/path/to/Xcode.app/Contents/Developer"

then invoke swift-frontend:

cd $PENNY_DIR/.swiftpm/xcode
    $TOOLCHAIN_DIR/swift-frontend -c $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/DerivedSources/resource_bundle_accessor.swift $PENNY_DIR/Lambdas/GitHubAPI/+Client.swift -primary-file $PENNY_DIR/Lambdas/GitHubAPI/+Repository.swift -primary-file $PENNY_DIR/Lambdas/GitHubAPI/+User.swift $PENNY_DIR/Lambdas/GitHubAPI/Aliases.swift $PENNY_DIR/Lambdas/GitHubAPI/AuthorizationHeader.swift $PENNY_DIR/Lambdas/GitHubAPI/Changes.swift $PENNY_DIR/Lambdas/GitHubAPI/Events+Action.swift $PENNY_DIR/Lambdas/GitHubAPI/GHEvent.swift $PENNY_DIR/Lambdas/GitHubAPI/GHMiddleware.swift $PENNY_DIR/Lambdas/GitHubAPI/GeneratedSources/Client.swift $PENNY_DIR/Lambdas/GitHubAPI/GeneratedSources/Types.swift $PENNY_DIR/Lambdas/GitHubAPI/Verifier.swift $PENNY_DIR/Lambdas/GitHubAPI/exports.swift $PENNY_DIR/Lambdas/GitHubAPI/uiName+.swift -emit-dependencies-path $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+Repository.d -emit-const-values-path $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+Repository.swiftconstvalues -emit-reference-dependencies-path $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+Repository.swiftdeps -serialize-diagnostics-path $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+Repository.dia -emit-dependencies-path $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+User.d -emit-const-values-path $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+User.swiftconstvalues -emit-reference-dependencies-path $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+User.swiftdeps -serialize-diagnostics-path $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+User.dia -target arm64-apple-macos14.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk $XCODE_DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -I $DERIVED_DATA_DIR/Build/Products/Debug -I $XCODE_DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/usr/lib -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug/PackageFrameworks -F $DERIVED_DATA_DIR/Build/Products/Debug -F $XCODE_DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/Library/Frameworks -no-color-diagnostics -enable-testing -g -debug-info-format\=dwarf -dwarf-version\=4 -module-cache-path $DERIVED_DATA_DIR/ModuleCache.noindex -profile-generate -profile-coverage-mapping -swift-version 6 -enforce-exclusivity\=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D Xcode -serialize-debugging-options -const-gather-protocols-file $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/GitHubAPI_const_extract_protocols.json -enable-experimental-feature DebugDescriptionMacro -enable-experimental-feature OpaqueTypeErasure -enable-upcoming-feature ExistentialAny -enable-upcoming-feature FullTypedThrows -empty-abi-descriptor -plugin-path $XCODE_DEVELOPER_DIR/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing -validate-clang-modules-once -clang-build-session-file $DERIVED_DATA_DIR/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc $PENNY_DIR/.swiftpm/xcode -resource-dir $XCODE_DEVELOPER_DIR/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir $PENNY_DIR/.swiftpm/xcode -Xcc -fmodule-map-file\=$DERIVED_DATA_DIR/Build/Intermediates.noindex/GeneratedModuleMaps/CNIOLLHTTP.modulemap -Xcc -fmodule-map-file\=$DERIVED_DATA_DIR/Build/Intermediates.noindex/GeneratedModuleMaps/CNIOBoringSSLShims.modulemap -Xcc -fmodule-map-file\=$DERIVED_DATA_DIR/Build/Intermediates.noindex/GeneratedModuleMaps/CNIOBoringSSL.modulemap -Xcc -fmodule-map-file\=$DERIVED_DATA_DIR/Build/Intermediates.noindex/GeneratedModuleMaps/CNIOExtrasZlib.modulemap -Xcc -fmodule-map-file\=$DERIVED_DATA_DIR/Build/Intermediates.noindex/GeneratedModuleMaps/CNIOWASI.modulemap -Xcc -fmodule-map-file\=$DERIVED_DATA_DIR/Build/Intermediates.noindex/GeneratedModuleMaps/CNIOLinux.modulemap -Xcc -fmodule-map-file\=$DERIVED_DATA_DIR/Build/Intermediates.noindex/GeneratedModuleMaps/CNIODarwin.modulemap -Xcc -fmodule-map-file\=$DERIVED_DATA_DIR/Build/Intermediates.noindex/GeneratedModuleMaps/CNIOAtomics.modulemap -Xcc -fmodule-map-file\=$DERIVED_DATA_DIR/Build/Intermediates.noindex/GeneratedModuleMaps/CAsyncHTTPClient.modulemap -Xcc -D_LIBCPP_HARDENING_MODE\=_LIBCPP_HARDENING_MODE_DEBUG -Xcc -ivfsstatcache -Xcc $DERIVED_DATA_DIR/SDKStatCaches.noindex/macosx15.1-24B5046f-cc0fef0e302a5c173b4160f869a79156.sdkstatcache -Xcc -I$DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/swift-overrides.hmap -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-nio/Sources/CNIOLLHTTP/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-nio-ssl/Sources/CNIOBoringSSLShims/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-nio-ssl/Sources/CNIOBoringSSL/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-nio-extras/Sources/CNIOExtrasZlib/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-nio/Sources/CNIOWASI/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-nio/Sources/CNIOWindows/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-nio/Sources/CNIOLinux/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-nio/Sources/CNIODarwin/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-nio/Sources/CNIOAtomics/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-numerics/Sources/_NumericsShims/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/async-http-client/Sources/CAsyncHTTPClient/include -Xcc -I$DERIVED_DATA_DIR/SourcePackages/checkouts/swift-atomics/Sources/_AtomicsShims/include -Xcc -I$DERIVED_DATA_DIR/Build/Products/Debug/include -Xcc -I$DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/DerivedSources-normal/arm64 -Xcc -I$DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/DerivedSources/arm64 -Xcc -I$DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG\=1 -module-name GitHubAPI -package-name penny_bot -frontend-parseable-output -disable-clang-spi -target-sdk-version 15.1 -target-sdk-name macosx15.1 -external-plugin-path $XCODE_DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins\#$XCODE_DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path $XCODE_DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins\#$XCODE_DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path $XCODE_DEVELOPER_DIR/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path $XCODE_DEVELOPER_DIR/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+Repository.o -o $DERIVED_DATA_DIR/Build/Intermediates.noindex/Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+User.o -index-unit-output-path /Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+Repository.o -index-unit-output-path /Penny.build/Debug/GitHubAPI.build/Objects-normal/arm64/+User.o -index-store-path $DERIVED_DATA_DIR/Index.noindex/DataStore -index-system-modules

This succeeds.

Now add -enable-upcoming-feature InferSendableFromCaptures to the command.
Observe that it fails with non-zero "exit-status": 1.

You could also just try to build the package in Xcode and see if it throws build errors for you as well or not.

Expected behavior

"exit-status": 0.

Environment

Xcode 16.1 beta 2

swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.11 clang-1600.0.26.2)
Target: arm64-apple-macosx15.0

Additional information

No response

@MahdiBM MahdiBM added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant