Skip to content

[Swift 6.0] Xcode Beta 16 build failure #2844

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

Closed
SouzaRodrigo61 opened this issue Sep 8, 2024 · 16 comments · Fixed by #2862
Closed

[Swift 6.0] Xcode Beta 16 build failure #2844

SouzaRodrigo61 opened this issue Sep 8, 2024 · 16 comments · Fixed by #2862
Labels
bug Something isn't working

Comments

@SouzaRodrigo61
Copy link

Description

'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module

#if compiler(>=6)
extension AccessorBlockSyntax: @retroactive ExpressibleByStringInterpolation {}
#endif
Captura de Tela 2024-09-08 às 13 48 26

Version 16.0 beta 6 (16A5230g)

Steps to Reproduce

Project dependencies:
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.5"),
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.3.9"),
.package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.2.0"),
.package(url: "https://github.com/airbnb/epoxy-ios", branch: "master"),

Package.resolved:

{
 "originHash" : "b5cc99b627187e3e55bcd531e531927c1956cfe9585549e5df30af7445bf045f",
 "pins" : [
   {
     "identity" : "combine-schedulers",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/pointfreeco/combine-schedulers",
     "state" : {
       "revision" : "9fa31f4403da54855f1e2aeaeff478f4f0e40b13",
       "version" : "1.0.2"
     }
   },
   {
     "identity" : "epoxy-ios",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/airbnb/epoxy-ios",
     "state" : {
       "branch" : "master",
       "revision" : "93178a5be0692261c34cbf2882ea1033a01d4f71"
     }
   },
   {
     "identity" : "swift-case-paths",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/pointfreeco/swift-case-paths",
     "state" : {
       "revision" : "642e6aab8e03e5f992d9c83e38c5be98cfad5078",
       "version" : "1.5.5"
     }
   },
   {
     "identity" : "swift-clocks",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/pointfreeco/swift-clocks",
     "state" : {
       "revision" : "b9b24b69e2adda099a1fa381cda1eeec272d5b53",
       "version" : "1.0.5"
     }
   },
   {
     "identity" : "swift-collections",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/apple/swift-collections",
     "state" : {
       "revision" : "9bf03ff58ce34478e66aaee630e491823326fd06",
       "version" : "1.1.3"
     }
   },
   {
     "identity" : "swift-concurrency-extras",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/pointfreeco/swift-concurrency-extras",
     "state" : {
       "revision" : "bb5059bde9022d69ac516803f4f227d8ac967f71",
       "version" : "1.1.0"
     }
   },
   {
     "identity" : "swift-custom-dump",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/pointfreeco/swift-custom-dump",
     "state" : {
       "revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1",
       "version" : "1.3.3"
     }
   },
   {
     "identity" : "swift-dependencies",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/pointfreeco/swift-dependencies",
     "state" : {
       "revision" : "3ef38bb702a1a2f39c7e19fc0578403b8ee52b17",
       "version" : "1.3.9"
     }
   },
   {
     "identity" : "swift-navigation",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/pointfreeco/swift-navigation",
     "state" : {
       "revision" : "e834b3760731160d7d448509ee6a1408c8582a6b",
       "version" : "2.2.0"
     }
   },
   {
     "identity" : "swift-perception",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/pointfreeco/swift-perception",
     "state" : {
       "revision" : "bc67aa8e461351c97282c2419153757a446ae1c9",
       "version" : "1.3.5"
     }
   },
   {
     "identity" : "swift-syntax",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/swiftlang/swift-syntax",
     "state" : {
       "revision" : "515f79b522918f83483068d99c68daeb5116342d",
       "version" : "600.0.0-prerelease-2024-09-04"
     }
   },
   {
     "identity" : "xctest-dynamic-overlay",
     "kind" : "remoteSourceControl",
     "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
     "state" : {
       "revision" : "96beb108a57f24c8476ae1f309239270772b2940",
       "version" : "1.2.5"
     }
   }
 ],
 "version" : 3
}

@SouzaRodrigo61 SouzaRodrigo61 added the bug Something isn't working label Sep 8, 2024
@ahoppen
Copy link
Member

ahoppen commented Sep 8, 2024

Synced to Apple’s issue tracker as rdar://135508784

@ahoppen
Copy link
Member

ahoppen commented Sep 9, 2024

I was unable to reproduce this issue by creating new package with the following package manifest and building it using Xcode 16.0 beta 6 (16A5230g), which does build SwiftSyntaxBuilder.

// swift-tools-version: 6.0

import PackageDescription

let package = Package(
  name: "a",
  platforms: [.macOS(.v13)],
  products: [.library(name: "a", targets: ["a"]),],
  dependencies: [
    .package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.2.0"),
  ],
  targets: [
    .target(name: "a", dependencies: [.product(name: "SwiftNavigation", package: "swift-navigation")])
  ]
)

Do you have an example package that reproduces the issue?

@SouzaRodrigo61
Copy link
Author

Problem Description:

I encountered an issue when using Tuist to build my project. Here is my configuration:

Product.swift:

import ProjectDescription

let project = Project(
  name: "GetUpTime",
  settings: .settings(configurations: [
    .debug(name: "Debug", xcconfig: "./xcconfigs/GetUpTime-Project.xcconfig"), 
    .release(name: "Release", xcconfig: "./xcconfigs/GetUpTime-Project.xcconfig"), 
  ]),
  targets: [
    .target( 
      name: "GetUpTime", 
      destinations: .iOS, 
      product: .app,
      bundleId: "com.getuptime.app.GetUpTime",
      deploymentTargets: .iOS("16.0"),
      sources: ["GetUpTime/**"],
      resources: [
        "GetUpTime/Resources/Assets.xcassets/**",
        "GetUpTime/Resources/Preview Content/**"
      ], 
      entitlements: "GetUpTime/GetUpTime.entitlements",
      dependencies: [
        .external(name: "Epoxy"),               // Epoxy from epoxy-ios
        .external(name: "Dependencies"),        // Dependencies from swift-dependencies
        .external(name: "DependenciesMacros"),  // DependenciesMacros from swift-dependencies
        .external(name: "SwiftNavigation"),     // SwiftNavigation from swift-navigation
        .external(name: "AppKitNavigation"),    // AppKitNavigation from swift-navigation
        .external(name: "SwiftUINavigation"),   // SwiftUINavigation from swift-navigation
        .external(name: "UIKitNavigation"),     // UIKitNavigation from swift-navigation
      ],
      settings: .settings(configurations: [
        .debug(name: "Debug", xcconfig: "./xcconfigs/GetUpTime.xcconfig"), 
        .release(name: "Release", xcconfig: "./xcconfigs/GetUpTime.xcconfig"), 
      ])
    ),
    .target(
      name: "GetUpTimeTests",
      destinations: .iOS,
      product: .unitTests,
      bundleId: "com.getuptime.app.GetUpTime.unitTest",
      sources: ["GetUpTimeTests/**"],
      dependencies: [
          .target(name: "GetUpTime")
      ]
    ),
    .target(
      name: "GetUpTimeUITests",
      destinations: .iOS,
      product: .uiTests,
      bundleId: "com.getuptime.app.GetUpTime.uiTests",
      sources: ["GetUpTimeUITests/**"],
      dependencies: [
          .target(name: "GetUpTime")
      ]
    ),
  ]
)

Tuist/Package.swift:

// swift-tools-version: 6.0
import PackageDescription

#if TUIST
  import ProjectDescription

  let packageSettings = PackageSettings(
    productTypes: [:]
  )
#endif

let package = Package(
  name: "GetUpTime",
  dependencies: [
    // You can read more about dependencies here: https://docs.tuist.io/documentation/tuist/dependencies
    .package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.5"),
    .package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.3.9"),
    .package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.2.0"),
    .package(url: "https://github.com/airbnb/epoxy-ios", branch: "master"),
  ]
)

Tuist/Config.swift:

import ProjectDescription

let config = Config(
    generationOptions: .options(enforceExplicitDependencies: true)
)
  • xcconfigs/GetUpTime.xcconfig
ASSETCATALOG_COMPILER_APPICON_NAME=AppIcon
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME=AccentColor
CODE_SIGN_STYLE=Automatic
CURRENT_PROJECT_VERSION=1
DEVELOPMENT_ASSET_PATHS="GetUpTime/Resources/Preview Content"
DEVELOPMENT_TEAM=Z42V6W967K
ENABLE_PREVIEWS=YES
GENERATE_INFOPLIST_FILE=YES
INFOPLIST_KEY_UIApplicationSceneManifest_Generation=YES
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents=YES
INFOPLIST_KEY_UILaunchScreen_Generation=YES
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad=UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone=UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight
MARKETING_VERSION=1.0.0
PRODUCT_BUNDLE_IDENTIFIER=com.getuptime.app.GetUpTime
PRODUCT_NAME=$(TARGET_NAME)
SWIFT_EMIT_LOC_STRINGS=YES
SWIFT_VERSION=5.0
TARGETED_DEVICE_FAMILY=1,2
INFOPLIST_KEY_CFBundleDisplayName=GetUp
INFOPLIST_KEY_LSApplicationCategoryType=public.app-category.healthcare-fitness

LD_RUNPATH_SEARCH_PATHS[config=Debug]=$(inherited) @executable_path/Frameworks
LD_RUNPATH_SEARCH_PATHS[config=Release]=$(inherited) @executable_path/Frameworks
  • xcconfigs/GetUpTime-Project.xcconfig
ALWAYS_SEARCH_USER_PATHS=NO
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS=YES
CLANG_ANALYZER_NONNULL=YES
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION=YES_AGGRESSIVE
CLANG_CXX_LANGUAGE_STANDARD=gnu++20
CLANG_ENABLE_MODULES=YES
CLANG_ENABLE_OBJC_ARC=YES
CLANG_ENABLE_OBJC_WEAK=YES
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING=YES
CLANG_WARN_BOOL_CONVERSION=YES
CLANG_WARN_COMMA=YES
CLANG_WARN_CONSTANT_CONVERSION=YES
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS=YES
CLANG_WARN_DIRECT_OBJC_ISA_USAGE=YES_ERROR
CLANG_WARN_DOCUMENTATION_COMMENTS=YES
CLANG_WARN_EMPTY_BODY=YES
CLANG_WARN_ENUM_CONVERSION=YES
CLANG_WARN_INFINITE_RECURSION=YES
CLANG_WARN_INT_CONVERSION=YES
CLANG_WARN_NON_LITERAL_NULL_CONVERSION=YES
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF=YES
CLANG_WARN_OBJC_LITERAL_CONVERSION=YES
CLANG_WARN_OBJC_ROOT_CLASS=YES_ERROR
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER=YES
CLANG_WARN_RANGE_LOOP_ANALYSIS=YES
CLANG_WARN_STRICT_PROTOTYPES=YES
CLANG_WARN_SUSPICIOUS_MOVE=YES
CLANG_WARN_UNGUARDED_AVAILABILITY=YES_AGGRESSIVE
CLANG_WARN_UNREACHABLE_CODE=YES
CLANG_WARN__DUPLICATE_METHOD_MATCH=YES
COPY_PHASE_STRIP=NO
ENABLE_STRICT_OBJC_MSGSEND=YES
ENABLE_USER_SCRIPT_SANDBOXING=YES
GCC_C_LANGUAGE_STANDARD=gnu17
GCC_NO_COMMON_BLOCKS=YES
GCC_WARN_64_TO_32_BIT_CONVERSION=YES
GCC_WARN_ABOUT_RETURN_TYPE=YES_ERROR
GCC_WARN_UNDECLARED_SELECTOR=YES
GCC_WARN_UNINITIALIZED_AUTOS=YES_AGGRESSIVE
GCC_WARN_UNUSED_FUNCTION=YES
GCC_WARN_UNUSED_VARIABLE=YES
IPHONEOS_DEPLOYMENT_TARGET=18.0
LOCALIZATION_PREFERS_STRING_CATALOGS=YES
MTL_FAST_MATH=YES
SDKROOT=iphoneos

DEBUG_INFORMATION_FORMAT[config=Debug]=dwarf
DEBUG_INFORMATION_FORMAT[config=Release]=dwarf-with-dsym
ENABLE_NS_ASSERTIONS[config=Release]=NO
ENABLE_TESTABILITY[config=Debug]=YES
GCC_DYNAMIC_NO_PIC[config=Debug]=NO
GCC_OPTIMIZATION_LEVEL[config=Debug]=0
GCC_PREPROCESSOR_DEFINITIONS[config=Debug]=DEBUG=1 $(inherited)
MTL_ENABLE_DEBUG_INFO[config=Debug]=INCLUDE_SOURCE
MTL_ENABLE_DEBUG_INFO[config=Release]=NO
ONLY_ACTIVE_ARCH[config=Debug]=YES
SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=Debug]=DEBUG $(inherited)
SWIFT_COMPILATION_MODE[config=Release]=wholemodule
SWIFT_OPTIMIZATION_LEVEL[config=Debug]=-Onone
VALIDATE_PRODUCT[config=Release]=YES

@SouzaRodrigo61
Copy link
Author

@SouzaRodrigo61
Copy link
Author

@ahoppen you can see problem here: https://github.com/SouzaRodrigo61/GetUpTime/actions/runs/10778617329/job/29890353442

I create ci for running testing and show this error:

...
[SwiftSyntaxBuilder] Copy module.modulemap -> module.modulemap
[EpoxyLayoutGroups] Touching EpoxyLayoutGroups.framework
Error: 'retroactive' attribute does not apply; 'ExpressibleByBooleanLiteral' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByFloatLiteral' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByIntegerLiteral' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
[SwiftSyntaxBuilder] Compiling ConvenienceInitializers.swift
Error: 'retroactive' attribute does not apply; 'ExpressibleByBooleanLiteral' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByFloatLiteral' is declared in this module
Error: 'retroactive' attribute does not apply; 'ExpressibleByIntegerLiteral' is declared in this module
[SwiftSyntaxBuilder] Compiling Indenter.swift
[SwiftSyntaxBuilder] Compiling ListBuilder.swift
[SwiftSyntaxBuilder] Compiling ResultBuilderExtensions.swift
The 'xcodebuild' command exited with error code 65 and message:
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:00433E64-48E5-40DC-A6D9-539ECB5716F6, OS:18.1, name:iPad Pro 13-inch (M4) }
{ platform:iOS Simulator, id:00433E64-48E5-40DC-A6D9-539ECB5716F6, OS:18.1, name:iPad Pro 13-inch (M4) }
Testing failed:
	'retroactive' attribute does not apply; 'ExpressibleByBooleanLiteral' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByFloatLiteral' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByIntegerLiteral' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module
	Command SwiftCompile failed with a nonzero exit code
	Testing cancelled because the build failed.

** TEST FAILED **


The following build commands failed:
	EmitSwiftModule normal arm64 (in target 'SwiftSyntaxBuilder' from project 'swift-syntax')
	SwiftEmitModule normal arm64 Emitting\ module\ for\ SwiftSyntaxBuilder (in target 'SwiftSyntaxBuilder' from project 'swift-syntax')
	SwiftCompile normal arm64 Compiling\ ConvenienceInitializers.swift,\ DeclSyntaxParseable.swift,\ Indenter.swift,\ ListBuilder.swift,\ ResultBuilderExtensions.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/ConvenienceInitializers.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/DeclSyntaxParseable.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/Indenter.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/ListBuilder.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/ResultBuilderExtensions.swift (in target 'SwiftSyntaxBuilder' from project 'swift-syntax')
	SwiftCompile normal arm64 /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/ConvenienceInitializers.swift (in target 'SwiftSyntaxBuilder' from project 'swift-syntax')
	SwiftCompile normal x86_64 Compiling\ WithTrailingCommaSyntax+EnsuringTrailingComma.swift,\ BuildableNodes.swift,\ RenamedChildrenBuilderCompatibility.swift,\ ResultBuilders.swift,\ SyntaxExpressibleByStringInterpolationConformances.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/WithTrailingCommaSyntax+EnsuringTrailingComma.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/generated/BuildableNodes.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/generated/RenamedChildrenBuilderCompatibility.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/generated/ResultBuilders.swift /Users/runner/work/GetUpTime/GetUpTime/Tuist/.build/checkouts/swift-syntax/Sources/SwiftSyntaxBuilder/generated/SyntaxExpressibleByStringInterpolationConformances.swift (in target 'SwiftSyntaxBuilder' from project 'swift-syntax')
	Testing workspace GetUpTime with scheme GetUpTime-Workspace
(6 failures)

Consider creating an issue using the following link: https://github.com/tuist/tuist/issues/new/choose
Error: Process completed with exit code 1.

@ahoppen
Copy link
Member

ahoppen commented Sep 9, 2024

Could you share the generated Xcode project files? Looks like tuist from Homebrew isn’t code signed, which makes me uncomfortable to run it.

@SouzaRodrigo61
Copy link
Author

No problem, do you want the complete project in a zip file or should I publish it on GitHub?

@ahoppen
Copy link
Member

ahoppen commented Sep 9, 2024

Whatever you prefer

@SouzaRodrigo61
Copy link
Author

I find the problem, this occurs when

// swift-tools-version: 6.0 ( generate project using swift 6.0, but project not config to swift 6.0 completely )
// swift-tools-version: 5.10 ( working )
import PackageDescription

#if TUIST
  import ProjectDescription

  let packageSettings = PackageSettings(
    productTypes: [:]
  )
#endif

let package = Package(
  name: "GetUpTime",
  dependencies: [
    // You can read more about dependencies here: https://docs.tuist.io/documentation/tuist/dependencies
    .package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.5"),
    .package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.3.9"),
    .package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.2.0"),
    .package(url: "https://github.com/airbnb/epoxy-ios", branch: "master"),
  ]
)

Thanks for your help @ahoppen

@ahoppen
Copy link
Member

ahoppen commented Sep 12, 2024

I don’t fully understand the problem, maybe because I’m lacking knowledge about tuist. Is this an issue because you configured your tuist project incorrectly? Does it also happen in a SwiftPM project (where you should always be able to build swift-syntax with both swift-tools-version 5.10 and 6.0)?

@adarhef
Copy link

adarhef commented Sep 19, 2024

I'm still experiencing this using Tuist, and I'm pretty sure it's an issue on their end.
When settings "SWIFT_VERSION": "6.0" on external dependencies, swift-syntax appears to build fine (other packages don't, so it muddies the water a bit, but still).
I didn't try reproducing on a SwiftPM project, but I'm willing to bet it's fine.
I think Tuist might not be configuring the dependencies properly according to the tools version.

@fortmarek
Copy link

@ahoppen this was partly a Tuist bug where we were not respecting the condition of adding the -package-name build flag only when a package's swift-tools-version is >= 5.9 as defined here.

However, I was able to reproduce the issue in a vanilla Xcode project (without using Tuist at all) by forking swift-syntax and just bumping the swift-tools-version from 5.8 to 5.9.

Here's the reproducer:
TestSwiftSyntax.zip

Here's the fork and the changes (again, just bumping the swift-tools-version):
fortmarek@84abf89

From what I can tell, the Swift compiler doesn't consider modules built with the same -package-name as being external, which leads to the build error when adding @retroactive statements in different modules, but in the same package.

While this is not an issue now, it will be once swift-syntax bumps the version to 5.9.

You can find the Tuist fix PR here – it includes a more detailed explanation but some of the description is specific to Tuist.

@ahoppen
Copy link
Member

ahoppen commented Sep 26, 2024

Thank you for the reduced example. It appears that there were two issues here:

  1. The error messages is confusing. It probably should say 'retroactive' attribute does not apply; 'AttributeListSyntax' is declared in this package instead of 'retroactive' attribute does not apply; 'ExpressibleByStringInterpolation' is declared in this module. I filed 'retroactive' attribute does not apply; 'ExpressibleByBooleanLiteral' is declared in this module when adding retroactive conformance of type defined in the same package swift#76724 to improve that.
  2. As you correctly analyzed, it looks like conformances within the same package domain are not considered retroactive. I opened Use fully-qualified types instead of @retroactive conformances #2862 to allow swift-syntax to build with -package-name set and without.

@fortmarek
Copy link

Wow, amazingly fast turnaround, y'all rock 👏

@robmaceachern
Copy link

Is it possible to include this in a release for the 600.x series of releases? It's a bummer to have to downgrade the swift-tools-version to workaround this.

@ahoppen
Copy link
Member

ahoppen commented Feb 14, 2025

In which setup are you seeing this issue? Do you have a SwiftPM Package that depends on swift-syntax and is experiencing this issue? My understanding was that this issue was caused due to a bug in Tuist, incorrectly setting -package-name even though swift-syntax has a swift-tools-version of <5.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants