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

Manifest targets are now static frameworks (to avoid link errors) #287

Merged
merged 2 commits into from Mar 14, 2019

Conversation

kwridan
Copy link
Collaborator

@kwridan kwridan commented Mar 13, 2019

Resolves #286

Short description 📝

The generated manifest target (e.g. "MyProject-Manifest") is used to allow code completion on the project manifest files (Project.swift) as well as validate the code written within it is syntacticly valid.

Building this target will succeed however a few linker errors do appear as a consequence:

e.g.

error: unable to open dependencies file ( .../Build/Intermediates.noindex/MainApp.build/Debug/MainApp-Manifest.build/Objects-normal/x86_64/MainApp_Manifest_dependency_info.dat)Command Ld emitted errors but did not return a nonzero exit code to indicate failure

Solution 📦

The link step can be skipped all together by declaring the manifest target will be staticly linked.

Implementation 👩‍💻👨‍💻

  • Modify the manifest target product type to be a .staticFramework

Test Plan 🛠

  • Run tuist generate on any fixture within fixtures
  • Open the generated workspace (you can use tuist focus as a shortcut to those steps)
  • Build the <Project>-Manifest scheme in Xcode
  • Verify no link errors appear

- The manifest target can be built to ensure there are no syntax errors in the project manifests
- This target doesn't need to be linked, a compilation step is sufficient to serve its purpose
- By converting the manifest target to a static framework, the link step is skipped and the errors that were obtained during that step can be avoided all together

Test Plan:

- Run `tuist generate` on any fixture within `fixtures`
- Open the generated workspace (you can use `tuist focus` as a shortcut to those steps)
- Build the `<Project>-Manifest` scheme in Xcode
- Verify no link errors appear
@kwridan kwridan changed the title Manifest targets are now static frameworks to prevent link errors Manifest targets are now static frameworks (to avoid link errors) Mar 13, 2019
@tuistbot
Copy link
Contributor

tuistbot commented Mar 13, 2019

1 Warning
⚠️ Have you introduced any user-facing changes? If so, please take some time to update the documentation. Keeping the documentation up to date makes it easier for users to learn how to use Tuist.

Generated by 🚫 Danger

Copy link
Collaborator Author

@kwridan kwridan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't a fix per se - but rather another approach that doesn't yield those issues

buildSettings["SWIFT_INCLUDE_PATHS"] = frameworkParentDirectory.asString
buildSettings["SWIFT_VERSION"] = Constants.swiftVersion
buildSettings["LD"] = "/usr/bin/true"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I omitted these settings as they are no longer needed to get the target to compile while it's a static framework.

@codecov
Copy link

codecov bot commented Mar 13, 2019

Codecov Report

Merging #287 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #287      +/-   ##
==========================================
- Coverage   87.92%   87.91%   -0.02%     
==========================================
  Files         268      268              
  Lines        9402     9393       -9     
==========================================
- Hits         8267     8258       -9     
  Misses       1135     1135
Impacted Files Coverage Δ
...s/TuistKit/Generator/ManifestTargetGenerator.swift 100% <100%> (ø) ⬆️
...Tests/Generator/ManifestTargetGeneratorTests.swift 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b369ae6...88757af. Read the comment docs.

Copy link
Contributor

@pepicrft pepicrft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @kwridan

@pepicrft pepicrft merged commit d348c83 into tuist:master Mar 14, 2019
@kwridan kwridan deleted the fixes/manifest-target-errors branch March 17, 2019 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building the manifest target yields a linking error
3 participants