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

[Dependencies.swift][SPM] Compile errors when install DatadogCrashReporting through tuist dependencies #4901

Closed
Dmitry-Pliushchai opened this issue Dec 1, 2022 · 10 comments
Labels
bounty Resolving this issue is rewarded with a bounty: https://github.com/tuist/tuist/discussions/4982 type:bug Something isn't working

Comments

@Dmitry-Pliushchai
Copy link
Contributor

Dmitry-Pliushchai commented Dec 1, 2022

What happened?

Hi. I faced the issue that compiler fails with "Redefinition of enumerator..' errors. The issue reproduces only with installing DatadogCrashReporting as spm dependency via tuist dependencies. It works ok if I use native spm integration.

How do we reproduce it?

  • add datadog through Dependencies.swift
  • add DatadogCrashReporting as external dependency to app target
  • tuist fetch
  • tuist generate
  • run project

Sample project with tuist spm dependecies
DatadogCrashReportingTuistSpm.zip

Sample project with native spm
DatadogCrashReportingNativeSpm.zip

Error log

Screenshot 2022-12-01 at 13 25 25

macOS version

13.0.1

Tuist version

3.12.1

Xcode version

14.1

@Sakhanko-Pavel
Copy link

Hi! Could you please help with this bug?

@Sakhanko-Pavel
Copy link

@danyf90 hi! Any updates here? Could you please help?

@danieleformichelli danieleformichelli added the bounty Resolving this issue is rewarded with a bounty: https://github.com/tuist/tuist/discussions/4982 label Feb 7, 2023
@danieleformichelli
Copy link
Collaborator

Nope, added a bounty to the ticket in case someone wants to have a look at it 🙏

@MartinStrambach
Copy link
Contributor

The issue is with USE_HEADERMAP build setting. In the original project (https://github.com/microsoft/plcrashreporter) it is set to YES. In Tuist, inside PackageInfoMapper it is always set to NO. Maybe @danyf90 can explain why it's needed.
If you change this build setting in the generated PLCrashReporter dependency project the whole example app builds just fine.

@danieleformichelli
Copy link
Collaborator

Hi @MartinStrambach looking at the code seems like we are trying to mimick SPM behavior and that looked the default in SPM, but maybe there is some logic to change it in some scenarios.

In the original project (https://github.com/microsoft/plcrashreporter) it is set to YES

Where to you see this?

@MartinStrambach
Copy link
Contributor

MartinStrambach commented Mar 13, 2023

In the original project (https://github.com/microsoft/plcrashreporter) it is set to YES

I meant the framework in the original repository. Since SPM modifies settings, anything can happen during the build phase. It would be really helpful to have a command which would produce similar output like xcodebuild -scheme "schemeName" -showBuildSettings >> mynew.xcconfig but for packages integrated via SPM. Maybe I'm missing something, but I couldn't find settings that are used for packages in Xcode nor build logs.

@DimaMishchenko
Copy link
Contributor

Workaround:

targetSettings: [
  "CrashReporter": [
    "USE_HEADERMAP": "YES"
  ]
]

@github-actions
Copy link
Contributor

Hola 👋,

We want to inform you that the issue has been marked as stale. This means that there hasn't been any activity or updates on it for quite some time, and it's possible that it may no longer be relevant or actionable.
If you still believe that this issue is valid and requires attention, please provide an update or any additional information that can help us address it. Otherwise, we may consider closing it in the near future.
Thank you for your understanding.

@github-actions github-actions bot added the stale label Jul 11, 2023
@github-actions
Copy link
Contributor

Hola 👋,

We want to inform you that we have decided to close this stale issue as there hasn't been any activity or response regarding it after marking it as stale.

We understand that circumstances may have changed or priorities may have shifted, and that's completely understandable. If you still believe that this issue needs to be addressed, please feel free to reopen it and provide any necessary updates or additional information.

We appreciate your understanding and look forward to your continued contributions to the project.

Thank you.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2023
@lpbas
Copy link

lpbas commented Aug 18, 2023

Workaround:

targetSettings: [
  "CrashReporter": [
    "USE_HEADERMAP": "YES"
  ]
]

We are facing the exact same issue with our Datadog integration with Tuist.

Setting the USE_HEADERMAP flag to YES manually in the project does indeed fix the issue, but adding the target settings that @DimaMishchenko suggested still keeps the flag set to NO when running tuist generate. Other target settings we are using in our project are working fine on the generated project. Is there any clue to why this happens and how can we resolve this?

(the build settings does not get applied neither in the provided example project, not in our own project that we are trying to integrate Datadog)

Important Update: I've realised that targetSettings get applied when running tuist fetch instead of tuist generate, so the workaround does work properly. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty Resolving this issue is rewarded with a bounty: https://github.com/tuist/tuist/discussions/4982 type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants