-
Notifications
You must be signed in to change notification settings - Fork 97
[objective_c] Fix path resolving for test files on MacOS #2991
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
Conversation
dcharkes
left a comment
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.
Thanks @progamax! 🙏
Could you please add a test to cover this? Either add a test or make it so that an existing test that runs in a temp dir runs in a subdir with characters that get encoded.
PR HealthLicense Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with
API leaks
|
| Package | Leaked API symbol | Leaking sources |
|---|---|---|
| objective_c | _FinalizablePointer | internal.dart::_ObjCReference::new::_finalizable |
This check can be disabled by tagging the PR with skip-leaking-check.
Breaking changes ✔️
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
|---|---|---|---|---|---|
| objective_c | None | 9.2.3 | 9.2.3 | 9.2.3 | ✔️ |
This check can be disabled by tagging the PR with skip-breaking-check.
Changelog Entry ✔️
| Package | Changed Files |
|---|
Changes to files need to be accounted for in their respective changelogs.
This check can be disabled by tagging the PR with skip-changelog-check.
|
@dcharkes |
|
Ah, the fix is in the hook, not in If you want, you could try making a PR so that @liamappelbe owns |
ff93ce8 to
c3b55c1
Compare
liamappelbe
left a comment
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.
Description
This PR fixes a build failure introduced in version 9.2.0 (native assets migration) when the package is fetched from a custom pub repository (e.g., Artifactory).
Issue
When using a custom pub host, the pub cache directory often contains URL-encoded characters (e.g., %47 or %25). The hook/build.dart script was handling file paths inconsistently:
Source files (src/): Were retrieved using Directory.listSync(). The file.path property correctly returned the decoded OS file system path.
Test files (test/util.c): Were retrieved using uri.resolve(path).path. This returned the encoded URI path (e.g., retaining %2547), causing clang to fail with no such file or directory.
Fix
I updated the resolution of testFiles to use File.fromUri(...).path. This ensures that the path is correctly decoded to the OS file system format, matching the behavior used for the source files.
fixes: #2990
Contribution guidelines:
dart format.Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.