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

Fix integration of local packages with Objective C targets #5957

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

fortmarek
Copy link
Member

Resolves #5955

Short description πŸ“

A project with a local Swift package that contains objc code would fail to build. This is because we'd:

  • Generate a module map into the Derived directory (a different directory is used for remote packages)
  • And then we would always delete it. Since the DeleteDerivedDirectoryProjectMapper is always run after the SPM graph is loaded, the modulemap would never be preserved

For now, I make sure the mapper does not delete the modulemap. This is not an optimal solution but one that works for now. As we make Package.swift first-class citizens, we will also move away from preloading the whole SPM graph and running operations on it before the rest of the graph – instead, the SPM Package.swift manifests will be treated the same way as any other manifest.

How to test the changes locally 🧐

app_with_spm_dependencies should build (I also tried the example in the attached issue)

Contributor checklist βœ…

  • The code has been linted using run mise run lint:fix
  • The change is tested via unit testing or acceptance testing, or both
  • The title of the PR is formulated in a way that is usable as a changelog entry
  • In case the PR introduces changes that affect users, the documentation has been updated

Reviewer checklist βœ…

  • The code architecture and patterns are consistent with the rest of the codebase
  • Reviewer has checked that, if needed, the PR includes the label changelog:added, changelog:fixed, or changelog:changed, and the title is usable as a changelog entry

@fortmarek fortmarek added the changelog:fixed PR will be listed in the Fixed section of CHANGELOG label Feb 20, 2024
@fortmarek fortmarek changed the title Fix/local package modulemap Fix integration of a local package with Objective C targets Feb 20, 2024
@fortmarek fortmarek changed the title Fix integration of a local package with Objective C targets Fix integration of local packages with Objective C targets Feb 20, 2024
@fortmarek fortmarek merged commit c54cf61 into main Feb 20, 2024
8 checks passed
@fortmarek fortmarek deleted the fix/local-package-modulemap branch February 20, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:fixed PR will be listed in the Fixed section of CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SPM framework that contains both Swift and Objective-C frameworks fails to build
2 participants