Closed jslew closed 1 year ago
Hi @jslew, sorry to hear. I haven't see this unfortunately. Are you able to reproduce in a simple project so that we can see the problem?
And have you tried cleaning the project to see if that fixes it?
Trying to repro in a test app, so far no luck reproducing in that scenario. For reasons too complicated to get into, we are integrating TCA and dependencies as dynamic frameworks (using tuist) so looking into whether that might be triggering anything bad.
On Thu, Jun 29, 2023 at 2:45 PM Brandon Williams @.***> wrote:
Hi @jslew https://github.com/jslew, sorry to hear. I haven't see this unfortunately. Are you able to reproduce in a simple project so that we can see the problem?
And have you tried cleaning the project to see if that fixes it?
— Reply to this email directly, view it on GitHub https://github.com/pointfreeco/swift-composable-architecture/issues/2245#issuecomment-1613627894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3T5WGNE3IR3QHW5W3TGCLXNXEN7ANCNFSM6AAAAAAZY3TJL4 . You are receiving this because you were mentioned.Message ID: @.*** com>
And yeah definitely tried cleaning, derived data, and all those usual suspects. the swiftc crash is happening to someone else on my team too, identically. I will see if I can switch to Xcode 14.3 (which we can probably use to build this but not our main app unfortunately) and see if there's any change there.
On Thu, Jun 29, 2023 at 2:45 PM Brandon Williams @.***> wrote:
Hi @jslew https://github.com/jslew, sorry to hear. I haven't see this unfortunately. Are you able to reproduce in a simple project so that we can see the problem?
And have you tried cleaning the project to see if that fixes it?
— Reply to this email directly, view it on GitHub https://github.com/pointfreeco/swift-composable-architecture/issues/2245#issuecomment-1613627894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3T5WGNE3IR3QHW5W3TGCLXNXEN7ANCNFSM6AAAAAAZY3TJL4 . You are receiving this because you were mentioned.Message ID: @.*** com>
Hey @mbrandonw,
I've isolated the problem to these few lines of code from NavigationStackStore.swift
:
fileprivate var path: PathView {
_read { yield PathView(base: self) }
_modify {
var path = PathView(base: self)
yield &path
self = path.base
}
set { self = newValue.base }
}
If I change the _read/_modify
parts to a typical get { PathView(base:self) }
, the compiler crash disappears.
I have never used that construct myself, so I don't know if it would be possible/reasonable to try changing this in some way (I'm assuming a straight get
is not correct).
Figured it out. Disabling incremental compilation for the package within my target sorts it out (who knows why). But I'll take it, and def. not your problem. Thanks!
That is still very strange though. And this did not happen in 0.54.0 of the library?
The lines with the _read
and _modify
were there in 0.54.0, so strange that it would start acting up now.
We skipped from 0.53.2 -> 0.55.0 so I haven't tried 54. I would guess that it happens there too.
SwiftCompile normal arm64 Compiling\ NavigationStackStore.swift,\ Popover.swift,\ PresentationModifier.swift,\ Sheet.swift,\ SwitchStore.swift
These files all crop up with the same problem under incremental compiler in Xcode 14.2. Same solution works, Xcode 14.3 doesn't seem to have this issue, so probably not worth digging into much more.
Since _read
and _modify
are optimizations that haven't been made official yet, and because we've seen they can lead to compiler crashes like the one you're seeing, we could maybe consider using get
and set
instead.
Description
Just upgraded to 0.55.0 due to issue #2244 and now getting an error building my app. I don't think this is a TCA bug per-se, because the swift compiler seems to be crashing, however I'm wondering if other people are getting it. On Xcode 14.2 at the moment and can't upgrade yet for unrelated reasons.
Checklist
main
branch of this package.Expected behavior
Project should compile
Actual behavior
Compiler crashes
Steps to reproduce
No response
The Composable Architecture version information
0.55.0
Destination operating system
n/a
Xcode version information
14.2
Swift Compiler version information