pointfreeco / swift-composable-architecture

A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
https://www.pointfree.co/collections/composable-architecture
MIT License
12.35k stars 1.44k forks source link

TCA 0.54.0. Linker command failed with exit code 1 (use -v to see invocation) #2189

Closed larryonoff closed 1 year ago

larryonoff commented 1 year ago

Description

Application doesn't compile for release configuration.

Please see the error on attachment.

Screenshot 2023-06-09 at 17 27 31

BTW. Release 0.54.0 has issue only with navigationIDPath, when navigation-beta branch had issue with dismiss and navigationIDPath.

The same issue happens for @ski-u

PS. I decided to create issue, since issue happens for 3 of my projects. And I still don't know how to resolve it

Checklist

Expected behavior

Application compiles in release configuration.

Actual behavior

Application doesn't compile in release configuration.

Steps to reproduce

No response

The Composable Architecture version information

0.42.0

Destination operating system

No response

Xcode version information

14.3.1

Swift Compiler version information

swift-driver version: 1.75.2 Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0
mbrandonw commented 1 year ago

Hi @larryonoff, are you able to reproduce this in a simple project so that we can see what is going on?

And can you expand a bit more on what you mean here:

BTW. Release 0.54.0 has issue only with navigationIDPath, when navigation-beta branch had issue with dismiss and navigationIDPath.

larryonoff commented 1 year ago

Hi @larryonoff, are you able to reproduce this in a simple project so that we can see what is going on?

And can you expand a bit more on what you mean here:

BTW. Release 0.54.0 has issue only with navigationIDPath, when navigation-beta branch had issue with dismiss and navigationIDPath.

I'll try to make simple project in a few days. If not, I'll give you access to one of my private projects.

BTW. Release 0.54.0 has issue only with navigationIDPath, when navigation-beta branch had issue with dismiss and navigationIDPath.

I mean that previously (before release) there were two undefined symbols errors as on the screenshot

  1. Undefined symbol: _$s 12Dependencies16DependencyValuesV22ComposableArchitectureE 16navigationIDPathAD010NavigationGOVACTKg the same as in release
  2. Undefined symbol: _$s12Dependencies16DependencyValuesV22ComposableArchitectureE7dismissAD13DismissEffectVpACTkq. This's not present in release.
dvosscricut commented 1 year ago

Having same issue with private project when archiving (which I can't share) on TCA 0.54.0. But perhaps I'll try to replicate with a sample project as well.

dvosscricut commented 1 year ago

@larryonoff @mbrandonw

I found an open source project that uses TCA and replicated the error!

https://github.com/prose-im/prose-app-macos

Just update signing info and then run the "Release" target

get this similar error about nativationIDPath:

error: :0: unsupported relocation with subtraction expression, symbol '_$s12Dependencies16DependencyValuesV22ComposableArchitectureE16navigationIDPathAD010NavigationG0VvpACTKq' can not be undefined in a subtraction expression

Screenshot 2023-06-09 at 7 34 46 PM

If I change the swift-composable-architecture version to .upToNextMinor(from: "0.53.0") it resolves to TCA 0.53.2 and builds and runs successfully:

Screenshot 2023-06-09 at 7 40 08 PM
salmin-skelia commented 1 year ago

@mbrandonw Any updated on this one?

mbrandonw commented 1 year ago

Hi everyone, thanks for the sample project! We were able to reproduce the problem. It appears to be a Swift bug related to inlining. Removing the inlineable from NavigationID makes it work again:

https://github.com/pointfreeco/swift-composable-architecture/blob/4f823d9341ab3ac99bfc0ac74c67fa12c31c8601/Sources/ComposableArchitecture/Internal/NavigationID.swift#L3C1-L9

We will get a fix out soon.

larryonoff commented 1 year ago

@mbrandonw thanks! looking forward to bugfix.

larryonoff commented 1 year ago

Version 0.54.1 works now! Thank you!