Karim/exclude non yoga search paths #1779

Open
karim-alweheshy wants to merge 1 commits from karim-alweheshy/karim/exclude_non_yoga_search_paths into main
karim-alweheshy commented 2025-01-21 02:21:42 -08:00 (Migrated from github.com)

in rules_swift_package_manager this is necessary to exclude these from search path for public headers that will fail to compile eventually

in rules_swift_package_manager this is necessary to exclude these from search path for public headers that will fail to compile eventually
vercel[bot] commented 2025-01-21 02:21:46 -08:00 (Migrated from github.com)

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yoga-website Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2025 10:27am
[vc]: #N6H/impIy3ibEwZNjRpx4IZh/sbakjXIKLHGOfmCg4Y=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ5b2dhLXdlYnNpdGUiLCJyb290RGlyZWN0b3J5Ijoid2Vic2l0ZSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9mYm9wZW5zb3VyY2UveW9nYS13ZWJzaXRlL1pxVm54akt2WVhpZXNFUHFBbXpvTTFmaVNNRGUiLCJwcmV2aWV3VXJsIjoieW9nYS13ZWJzaXRlLWdpdC1mb3JrLWthcmltLWFsd2VoZXNoeS1rYXJpbS0xOWQwMTEtZmJvcGVuc291cmNlLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoieW9nYS13ZWJzaXRlLWdpdC1mb3JrLWthcmltLWFsd2VoZXNoeS1rYXJpbS0xOWQwMTEtZmJvcGVuc291cmNlLnZlcmNlbC5hcHAifX1dfQ== **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more) | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **yoga-website** | ✅ Ready ([Inspect](https://vercel.com/fbopensource/yoga-website/ZqVnxjKvYXiesEPqAmzoM1fiSMDe)) | [Visit Preview](https://yoga-website-git-fork-karim-alweheshy-karim-19d011-fbopensource.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/yoga-website-git-fork-karim-alweheshy-karim-19d011-fbopensource.vercel.app?via=pr-comment-feedback-link) | Jan 21, 2025 10:27am |
facebook-github-bot commented 2025-01-21 02:21:48 -08:00 (Migrated from github.com)

Hi @karim-alweheshy!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Hi @karim-alweheshy! Thank you for your pull request and welcome to our community. # Action Required In order to merge **any pull request** (code, docs, etc.), we **require** contributors to sign our **Contributor License Agreement**, and we don't seem to have one on file for you. # Process In order for us to review and merge your suggested changes, please sign at <https://code.facebook.com/cla>. **If you are contributing on behalf of someone else (eg your employer)**, the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the **pull request will be tagged** with `CLA signed`. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it. If you have received this in error or have any questions, please contact us at [cla@meta.com](mailto:cla@meta.com?subject=CLA%20for%20facebook%2Fyoga%20%231779). Thanks!
facebook-github-bot commented 2025-01-21 04:06:25 -08:00 (Migrated from github.com)

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
NickGerleman commented 2025-01-21 11:31:55 -08:00 (Migrated from github.com)

Could you help provide a bit more context? What error are you seeing?

We have a modulemap for generated umbrella header for Swift usage with the list of public header: https://github.com/facebook/yoga/blob/main/yoga/module.modulemap Wonder if rules_swift_package_manager might not be picking this up?

includes within the target shouldn't ever reference anything outside the yoga directory then.

Could you help provide a bit more context? What error are you seeing? We have a modulemap for generated umbrella header for Swift usage with the list of public header: https://github.com/facebook/yoga/blob/main/yoga/module.modulemap Wonder if `rules_swift_package_manager` might not be picking this up? includes within the target shouldn't ever reference anything outside the `yoga` directory then.
karim-alweheshy commented 2025-01-23 05:48:04 -08:00 (Migrated from github.com)

Could you help provide a bit more context? What error are you seeing?

We have a modulemap for generated umbrella header for Swift usage with the list of public header: https://github.com/facebook/yoga/blob/main/yoga/module.modulemap Wonder if rules_swift_package_manager might not be picking this up?

includes within the target shouldn't ever reference anything outside the yoga directory then.

Because the public headers search path is set to be on the whole repo, rules_swift_package_manager compiles all public headers from all folders. This compilation fails because imported symbols in these headers are not part of the source.

Excluding the other folders enables rules_swift_package_manager to use the public header only in the yoga folder and not the rest

> Could you help provide a bit more context? What error are you seeing? > > We have a modulemap for generated umbrella header for Swift usage with the list of public header: https://github.com/facebook/yoga/blob/main/yoga/module.modulemap Wonder if `rules_swift_package_manager` might not be picking this up? > > includes within the target shouldn't ever reference anything outside the `yoga` directory then. Because the public headers search path is set to be on the whole repo, rules_swift_package_manager compiles all public headers from all folders. This compilation fails because imported symbols in these headers are not part of the source. Excluding the other folders enables rules_swift_package_manager to use the public header only in the `yoga` folder and not the rest
NickGerleman commented 2025-01-23 17:18:30 -08:00 (Migrated from github.com)

Describing the set of public headers, for the purpose of creating an umbrella header, is what the modulemap is for, at least when consuming as a Clang module. Or is rules_swift_package_manager combining headers for some non Clang module purpose? Having a copy of the error would be helpful here.

Getting the SwiftPM package to work with Bazel seems like good goal, but this behavior seems funky compared to what SwiftPM itself does/expects. Trying to understand more, to know if maybe this is a bug with rules_swift_package_manager that should be reported.

Describing the set of public headers, for the purpose of creating an umbrella header, is what the modulemap is for, at least when consuming as a Clang module. Or is `rules_swift_package_manager` combining headers for some non Clang module purpose? Having a copy of the error would be helpful here. Getting the SwiftPM package to work with Bazel seems like good goal, but this behavior seems funky compared to what SwiftPM itself does/expects. Trying to understand more, to know if maybe this is a bug with `rules_swift_package_manager` that should be reported.
karim-alweheshy commented 2025-02-05 05:30:09 -08:00 (Migrated from github.com)

Describing the set of public headers, for the purpose of creating an umbrella header, is what the modulemap is for, at least when consuming as a Clang module. Or is rules_swift_package_manager combining headers for some non Clang module purpose? Having a copy of the error would be helpful here.

Getting the SwiftPM package to work with Bazel seems like good goal, but this behavior seems funky compared to what SwiftPM itself does/expects. Trying to understand more, to know if maybe this is a bug with rules_swift_package_manager that should be reported.

There is a difference between how rules_spm work vs SPM itself

I want to double click on this issue specifically, do you agree that the public headers search path for the core target should exclude the mentioned folders?

> Describing the set of public headers, for the purpose of creating an umbrella header, is what the modulemap is for, at least when consuming as a Clang module. Or is `rules_swift_package_manager` combining headers for some non Clang module purpose? Having a copy of the error would be helpful here. > > Getting the SwiftPM package to work with Bazel seems like good goal, but this behavior seems funky compared to what SwiftPM itself does/expects. Trying to understand more, to know if maybe this is a bug with `rules_swift_package_manager` that should be reported. There is a difference between how rules_spm work vs SPM itself I want to double click on this issue specifically, do you agree that the public headers search path for the `core` target should exclude the mentioned folders?
NickGerleman commented 2025-03-05 13:50:35 -08:00 (Migrated from github.com)

Sorry for the long delay in response!

It's unfortunate that rules_spm is not respecting modulemaps. I'm a bit surprised there isn't a way to tell it to. I would definitely recommend creating an issue for them, if there really isn't a way to even explicitly tell it to use Yoga's modulemap.

We can add workarounds to Yoga for this, so long as we have a way to check that they aren't broken in the future. E.g. if we had a CI rule that could check that things worked, I would feel a lot better about this. One-off changes which may break in the future with unrelated changes, I have been more reluctant to add though.

Sorry for the long delay in response! It's unfortunate that `rules_spm` is not respecting modulemaps. I'm a bit surprised there isn't a way to tell it to. I would definitely recommend creating an issue for them, if there really isn't a way to even explicitly tell it to use Yoga's modulemap. We can add workarounds to Yoga for this, so long as we have a way to check that they aren't broken in the future. E.g. if we had a CI rule that could check that things worked, I would feel a lot better about this. One-off changes which may break in the future with unrelated changes, I have been more reluctant to add though.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin karim-alweheshy/karim/exclude_non_yoga_search_paths:karim-alweheshy/karim/exclude_non_yoga_search_paths
git checkout karim-alweheshy/karim/exclude_non_yoga_search_paths
Sign in to join this conversation.
No description provided.