Closed jmbene closed 7 months ago
@danyf90 The Realm package has a lot CXX settings the Package.swift
here. Would this be the cause of the build errors?
They should be handled by the mapping logic. Given the error is only on REALM_VERSION_EXTRA maybe it's empty and that case is not handled properly?
@danyf90 Yah that looks like it may be the case there is the possibility it's empty as the package has some logic in there to determine if it's set or not
You can check the generated project and see if the variable is there
any update?
hi @InViZz , we believe this got fixed in #3995 feel free to use the branch to try it out.
I am going to reopen, this, there is a HEADER_SEARCH_PATH
which must inherit from Realm framework to compile correctly. There is a WIP at #4002. Currently Realm on its own will compile fine, but not when imported.
We are currently also facing the issue with Realm. When we include an external SPM dependency that relies on Realm
it fails to build. I already tried out the main
branch of tuist
and the issue still persists in the generated project.
is there any workaround which I can use until this problem is solved?
@Drag0ndust a part of the fix will be included in the next version (which probably will be released today in some hours), yet there will be the need of a second fix and it won't compile yet. But you may workaround this second issue by adding the correct HEADER_SEARCH_PATH
Hi guys, have you figured correct path for header paths? I tried many, but no luck...
Also, is there any updates for this issue? Thanks
@vexonius I think you need to add the HEADER_SEARCH_PATHS to the target depending on Realm (i.e. in the Project.swift), I'll try to add it to the app_with_spm_dependencies
fixture if I find the time to try it :rocket:
Hi @danyf90! Were you able to find some time trying to verify the workaround for the Realm integration issue?
@danyf90 It looks like the Project file that is generated for Realm is missing the 'Headers' build phase. If I compare it to another library that requires public header files the one generated by Tuist for that does have a Headers build phase, whereas the Project file for Realm has none on any of it's targets.
@lordcodes there is a "complex" logic to understand whether to define the headers as build phase or add them to the project search path that we are mimicking from SPM. It's possible that there is some problem there, but I think it's more likely that we just need to fix the header search paths of the targets depending on realm. There is a PR by @adellibovi introducing imparted settings that should go in that direction, but it still need some adjustments 🚀
@danyf90 As a test I altered the generated Realm project to add a Headers build phase, then added all the header files to it and it allowed it to get further, however, it failed at a later stage due to symbols and warnings about the header files not being in Realm.h umbrella header. I will have been hacking it to try and add the header files so likely did something wrong there.
Thanks for the information. For now I will move all my other SPM dependencies to use Dependencies.swift and will leave Realm using the previous approach for now.
Make sense, I hope we can solve this soon! 🤞
I see the exact thing I raised was discussed on that PR you linked to, concerning using the Headers build phase vs other approaches. Good to have the context.
Hey can you please let us know if and when can we expect this to be resolved? Is there any plan regarding the same. Thanks!
Folks, this is an open source project. I imagine the maintainers don't actively use Realm so it's not immediately something we can budget time for, it would be helpful to get a PR that adds a test for this / attempts a fix we can then review and help further
There is this open PR, but it still need some fixes before being ready. If anyone wants to contribute they are welcome!
Is there any progress??
Would be nice with some updates regarding this issue. Would love to help but I think I won't be able to :D
I solved this issue by using a xcframework instead of SPM or Carthage.
I solved this issue by using a xcframework instead of SPM or Carthage.
@marciliojrs could you please elaborate on that (e.g. which xcframework have you used)?
Apologies for my previous brief response, I was on a mobile device. So explaining a bit better... In the testing phase of migrating my project to Tuist, I encountered a several obstacles when trying to integrate Realm. Despite trying various Tuist and Realm versions, I was unable to get it to work as an SPM or Carthage dependency. So, to overcome this issue, I opted to store an xcframework
version of Realm in an S3 bucket and download it to my local directory. This allowed me to use it as a local xcframework
dependency in my project.
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.
Anyone has solution for this?
Not yet @Jaeki-Lee
@Jaeki-Lee @pepicrft I was able to solve this problem by passing these settings to the Project's SettingDictionary:
"HEADER_SEARCH_PATHS": [
"$(SRCROOT)/Tuist/Dependencies/SwiftPackageManager/.build/checkouts/realm-swift/include",
"$(inherited)"
]
Describe the bug I’m having problems with version 2.0 of Tuist and the Realm dependency when I’m trying to add a SPM dependency in the new
Dependencies.swift
file. If I fetch the dependencies and then try to warm the cache I receive the following error:If I generate the project, focus in the app target and build it without warming the cache I receive the same error:
To Reproduce Steps to reproduce the behavior:
I have a super small project that includes
Realm
dependency to reproduce the issue: tuist2.zipThen follow these commands to warm the cache:
It is also replicable when generating and focusing the project and then building in Xcode:
Expected behavior The SPM package compiles
Screenshots N/A
Desktop (please complete the following information):
Additional context I suspect there are some issues relate wrong C++ dialect or some flags that aren't applied property or missing build settings when compiling.