Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Migration to 1.8 & 1.9.x Fails Documentation Builds #2931

xaverlutz started this conversation in General
Discussion options

Description

Hi,

after migrating our app to 1.8 and adjusting the Destination enums, we are unable to build the documentation using either Xcode or the xcodebuild command. The error can be seen in the image below.

documentation-error

The error is from my dummy project, as I wanted to verify if we migrated something wrong. The project can be accessed at this link.

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

  1. Migrate an app to v1.8 & use a destination enum reducer
  2. Try to build the documentation (either with Xcode or xcodebuild command)

The Composable Architecture version information

1.8 & 1.9.2

Destination operating system

iOS 17.0

Xcode version information

Version 15.3 (15E204a)

Swift Compiler version information

1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
You must be logged in to vote

Replies: 4 comments · 5 replies

Comment options

Hi @xaverlutz, are you sure this is a TCA-specific issue? It seems more likely that it's a Swift/DocC bug where docs fail to build anytime a macro is involved that generates inner types. Can you try reproducing the problem in a fresh project without TCA involved, and if you succeed then I think this needs to be filed with Apple. I'm not sure there is much we can do to fix this.

You must be logged in to vote
0 replies
Comment options

Hi @xaverlutz, I'm going to move this to a discussion since I'm not sure it's actually a TCA-specific issue. Sounds like a general Swift/macro issue. Please let us know if you uncover anything new.

You must be logged in to vote
0 replies
Comment options

Hi @mbrandonw,
unfortunately I have the same problem as @xaverlutz.

Based on your suggestion I've created a test project (here) with a macro package that just adds an inner type and an additional macro that adds a type to the inner type.
All this seems to be building the documentation correctly via Xcode 15.3.

As soon as the TCA is introduced with the Destination/Path enums and the State/Action types are used, the documentation doesn't build anymore with the same errors as above.

Of course this still doesn't rule out that it is an issue with Swift/DocC, so I hope you might have a lead on what we should might try next.

You must be logged in to vote
1 reply
@mbrandonw
Comment options

Hi @rszczepanski, I would continue adding more features to your @OuterMacro until things break. Perhaps you need to add a protocol conformance such that the inner type satisfies a protocol requirement. Or maybe you need to add multiple inner types and a computed property. I would imagine that if you keep adding things that @Reducer does then eventually DocC will break.

And I just doubt there is anything that we are doing in TCA that should be breaking DocC. As a matter of principle that just shouldn't be possible, and so it seems more likely that this is just a bug with macros and DocC.

By the way, the repro of this problem is far simpler than using Destination reducers. Just this breaks DocC:

@Reducer
struct TestStruct {}

I think this makes it even more clear that this is a DocC issue, and so it should be possible to get a minimal reproducible project to share with Apple.

Comment options

Hi! Are there any updates on resolving this issue? The problem still persists and DocC is still broken. It's really upsetting. Has anyone found a solution by any chance?

You must be logged in to vote
4 replies
@stephencelis
Comment options

It appears that Apple is tracking some bugs internally: swiftlang/swift-docc#849

I think the best bet is to continue to repro using small examples that can be filed with Apple.

@Alexminator99
Comment options

Hi!! Still having the same issue with Xcode 16. @stensmir did you manage to get solution?

@fruitcoder
Comment options

Well the only workaround right now seems to be: expand the macro and copy the generated Action/State enums in your codebase

@xaverlutz
Comment options

It seems like Xcode 16.3 fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants
Converted from issue

This discussion was converted from issue #2921 on March 19, 2024 22:29.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.