8000 Tuist cache mismatch causing missing symbols · Issue #7555 · tuist/tuist · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tuist cache mismatch causing missing symbols #7555

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
danibachar opened this issue May 5, 2025 · 4 comments · Fixed by #7556
Closed

Tuist cache mismatch causing missing symbols #7555

danibachar opened this issue May 5, 2025 · 4 comments · Fixed by #7556
Labels
type:bug Something isn't working

Comments

@danibachar
Copy link
Collaborator
danibachar commented May 5, 2025

What happened?

Working on a Tuist update we faced an issue building from cache.
It seems like there is an issue with caching mis-match transitive external dependencies.

This repo shows the issue, and state the steps and version to use to reproduce it.

I didn't pin point the exact version regression, but I can say that with Tuist 4.33.0 it is not reproducible.
I suspect some change between Tuist 4.34.0 - 4.39.1 caused it but it also could be later

How do we reproduce it?

Follow up on the README of this repo

But if you want all the steps here they are:

  1. Clone this repo - git clone https://github.com/danibachar/TuistCacheMismatch
  2. cd TuistCacheMismatch
  3. Run tuist clean for a clean cached environment
  4. Run tuist install
  5. Run tuist generate
  6. Make sure the app builds and runs (you might see Datadog logs due to init RUM initialization before SDK init)
  7. Close the opened xcode project
  8. Run tuist cache. This command should cache all the external dependencies of the project (Datadog, and DatadogProxy), locally
  9. Run tuist generate. The generated app should link against the cached binaries, and not generate projects for the external dependencies (i.e. you should not see the Dependencies folder)
  10. Make sure the app builds and runs (you might see Datadog logs due to init RUM initialization before SDK init)
  11. Run tuist edit
  12. Go to Tuist/Package.swift and change the Datadog SDK version to 2.26.0
  13. Run tuist install
  14. Run tuist generate
  15. The newly generate project should include the changes, and have no cache hits (i.e. you should see the Dependencies folder)
  16. Make sure the app builds and runs (you might see Datadog logs due to init RUM initialization before SDK init)
  17. Run tuist cache
  18. Run tuist generate
  19. Observe build failure with the following error
Showing All Errors Only
Undefined symbol: DatadogRUM.RUM.Configuration.init(applicationID: Swift.String, sessionSampleRate: Swift.Float, uiKitViewsPredicate: DatadogRUM.UIKitRUMViewsPredicate?, uiKitActionsPredicate: DatadogRUM.UITouchRUMActionsPredicate?, urlSessionTracking: DatadogRUM.RUM.Configuration.URLSessionTracking?, trackFrustrations: Swift.Bool, trackBackgroundEvents: Swift.Bool, longTaskThreshold: Swift.Double?, appHangThreshold: Swift.Double?, trackWatchdogTerminations: Swift.Bool, vitalsUpdateFrequency: DatadogRUM.RUM.Configuration.VitalsFrequency?, viewEventMapper: ((DatadogRUM.RUMViewEvent) -> DatadogRUM.RUMViewEvent)?, resourceEventMapper: ((DatadogRUM.RUMResourceEvent) -> DatadogRUM.RUMResourceEvent?)?, actionEventMapper: ((DatadogRUM.RUMActionEvent) -> DatadogRUM.RUMActionEvent?)?, errorEventMapper: ((DatadogRUM.RUMErrorEvent) -> DatadogRUM.RUMErrorEvent?)?, longTaskEventMapper: ((DatadogRUM.RUMLongTaskEvent) -> DatadogRUM.RUMLongTaskEvent?)?, onSessionStart: ((Swift.String, Swift.Bool) -> ())?, customEndpoint: Foundation.URL?, telemetrySampleRate: Swift.Float) -> DatadogRUM.RUM.Configuration

It seems like either Tuist has issue with the hashing of the cached binaries and it mixes cache. Or alternatively, it has a caching issue, and it caches the Proxy library with the wrong version of Datadog SDK.

Error log

Build error in Xcode

Showing All Errors Only
Undefined symbol: DatadogRUM.RUM.Configuration.init(applicationID: Swift.String, sessionSampleRate: Swift.Float, uiKitViewsPredicate: DatadogRUM.UIKitRUMViewsPredicate?, uiKitActionsPredicate: DatadogRUM.UITouchRUMActionsPredicate?, urlSessionTracking: DatadogRUM.RUM.Configuration.URLSessionTracking?, trackFrustrations: Swift.Bool, trackBackgroundEvents: Swift.Bool, longTaskThreshold: Swift.Double?, appHangThreshold: Swift.Double?, trackWatchdogTerminations: Swift.Bool, vitalsUpdateFrequency: DatadogRUM.RUM.Configuration.VitalsFrequency?, viewEventMapper: ((DatadogRUM.RUMViewEvent) -> DatadogRUM.RUMViewEvent)?, resourceEventMapper: ((DatadogRUM.RUMResourceEvent) -> DatadogRUM.RUMResourceEvent?)?, actionEventMapper: ((DatadogRUM.RUMActionEvent) -> DatadogRUM.RUMActionEvent?)?, errorEventMapper: ((DatadogRUM.RUMErrorEvent) -> DatadogRUM.RUMErrorEvent?)?, longTaskEventMapper: ((DatadogRUM.RUMLongTaskEvent) -> DatadogRUM.RUMLongTaskEvent?)?, onSessionStart: ((Swift.String, Swift.Bool) -> ())?, customEndpoint: Foundation.URL?, telemetrySampleRate: Swift.Float) -> DatadogRUM.RUM.Configuration

macOS version

15.4.1

Tuist version

4.48.2

Xcode version

16.1

@danibachar danibachar added the type:bug Something isn't working label May 5, 2025
@danibachar
Copy link
Collaborator Author
danibachar commented May 5, 2025

Some more notes and updates

  • If the cache is clean it doesn't matter if you build the cache with DD 2.17.0 first and then upgrade to 2.26.0 and rebuild or vise versa - the error persist (you might see a bit of a different error, but it would basically mean the same thing)
  • DD did update that Rum.Configuration initializer between those versions (commit)

@danibachar
Copy link
Collaborator Author
danibachar commented May 5, 2025

I can confirm that this goes back to Tuist 4.34.3 (i.e. something between 4.33.0 and 4.34.3 caused this regression)

@danibachar
Copy link
Collaborator Author
danibachar commented May 6, 2025

Could this commit be the issue - link?

@pepicrft
Copy link
Contributor
pepicrft commented May 6, 2025

Could this commit be the issue - link?

It's definitively that commit. After that change, we use the information from the lockfile to determine the hash of a package target, but we forgot to include the hashes of its dependencies.

In that particular fixture, DatadogProxy's hash remains the same after updating DataDog/dd-sdk-ios, which is wrong. That's why if you clean the cache and warm it again it works. I'll look into a solution for it.

Image

5262
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

Successfully merging a pull request may close this issue.

2 participants
0