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

Can't build project while defining swift settings for a package and configuration only (wrong SWIFT_ACTIVE_COMPILATION_CONDITIONS) #6091

Closed
iphilgood opened this issue Mar 18, 2024 · 1 comment
Labels
type:bug Something isn't working

Comments

@iphilgood
Copy link

What happened?

Hello

I'm currently upgrading from tuist version 3.39.0 to 4.6.0 and noticed that swift settings for a package are not considered when they're only defined for configurations.

In the attached workspace, there's a project which has a dependency to a local package. Within this package, there's a class that only gets provided when the DEVELOPMENT compiler flag is enabled.

In the local package, there are swift settings defined for the compiler flag when the configuration is .debug:

swiftSettings: [
    .define("DEVELOPMENT", .when(configuration: .debug)),
]

Actual Result

The workspace doesn't compile.

Expected Result

The workspace compiles without any errors.

Findings

It compiles as as soon as I specify platforms and change the swift settings for the core package to this:

swiftSettings: [
    .define("DEVELOPMENT", .when(platforms: [.iOS], configuration: .debug)),
]

I also found the issue #5642 which might be related.

How do we reproduce it?

  1. Use the attached workspace
  2. Run tuist install & tuist generate
  3. Run project on iOS Simulator

Error log

CleanShot 2024-03-18 at 10 53 12@2x

macOS version

14.4

Tuist version

4.6.0

Xcode version

15.3.0

@iphilgood iphilgood added the type:bug Something isn't working label Mar 18, 2024
@pepicrft
Copy link
Contributor

Hey @iphilgood
I tested this with Tuist 4.12.1 and the provided project running:

  1. tuist install
  2. tuist generate
  3. Compile the app

And it worked as expected. It was addressed as part of this

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

No branches or pull requests

2 participants