-
Notifications
You must be signed in to change notification settings - Fork 35
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: Replicates SPM default behavior for publicHeadersPath: If this is nil, the directory is set to include #1429
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # swiftpkg/internal/modulemap_parser/collect_module.bzl # swiftpkg/internal/swiftpkg_build_files.bzl
Does this fix a certain use case? If so, can we add or adjust an example to show it? |
It was causing tree-sitter build to fail, but after fixing the What do you suggest in this case? |
if [[ "${expected}" != "${actual}" ]]; then | ||
echo >&2 "${err_msg}" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests were passed even when they didn't match. Just add a small fix and improve the clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the pattern check was failing, we should understand why it was failing. The test is using Bash regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have context on that. The other tests in this file aren't running regex match asserts, they use full strings, so I thought the best decision was to keep things simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have put up #1458 to fix the existing issues with the test. Please revert your changes, removing the assert_match
in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!! Let me revert my changes
…earch-when-not-specified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of my comments are around the example and the affect on a unit test.
if [[ "${expected}" != "${actual}" ]]; then | ||
echo >&2 "${err_msg}" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the pattern check was failing, we should understand why it was failing. The test is using Bash regex.
We will wait for the #1458 to merge, then rebase this PR on those changes. |
As pointed out #1429, the `pkg_manifest_minimal` example was calling `ComplexClass.greet()` and printing the result, but the function did not return anything. Instead, it was printing in `greet()` function. That was not the original intent. I updated `ComplexClass.greet()` to return the greeting so that the executable can print it. I also added a check in `do_test` to confirm that it was being output properly. All of this was a miss on my part. Thanks to @0xLucasMarcal for pointing this. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…-folder-search-when-not-specified # Conflicts: # examples/pkg_manifest_minimal/do_test # swiftpkg/tests/swiftpkg_build_files_tests.bzl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you need to execute bazel run //:tidy
to update some source files. Also, it looks like some integration tests are failing. Let me know when they are green and I will review.
Match SPM's default behavior for public headers path
When SPM processes a target without an explicit
publicHeadersPath
, it follows these rules:publicHeadersPath
is nil and aninclude/
directory exists, useinclude/
as the public headers pathinclude/
directory visible to dependent targetsThis PR replicates this canonical behavior by:
include/
directory whenpublicHeadersPath
is not setinclude/
as the public headers path if it existsinclude/*.h
visible to clang targetshttps://developer.apple.com/documentation/packagedescription/target/publicheaderspath