-
Notifications
You must be signed in to change notification settings - Fork 6k
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Previously we were getting the enclosing directory path of the `et` tool (via the `dirname` builtin), then canonicalising the path by resolving symlinks. This doesn't work if the `et` on the path is itself a symlink. For example, if a user created a symlink `et` in a concrete directory at `~/.local/bin`: ``` ~/.local/bin/et -> ~/src/flutter/engines/src/flutter/bin/et ``` first we'd compute the dirname of the script: ``` ~/.local/bin ``` then we'd resolve symlinks: ``` ~/.local/bin ``` and incorrectly assume that was the engine directory. Instead, we now resolve symlinks, then compute the enclosing directory.
ee78ee8
to
59f5b1a
Compare
In order to canonicalise paths, previously we were doing an iterative computation to resolve symlinks to a canonical path, directory by directory. This was because on macOS and other BSDs, readlink doesn't support the `-f` (follow symlinks) option. However, macOS and other BSD-based systems *do* bundle the `realpath` utility, which resolves symlinks. This patch is stacked on top of #52274 and is the second commit (dec38dd). ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [X] I listed at least one issue that this PR fixes in the description above. - [ ] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] I signed the [CLA]. - [X] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
…147099) flutter/engine@3db86b3...6f4d753 2024-04-20 [email protected] Roll Skia from 1910252ea26a to 514d7fc627b3 (6 revisions) (flutter/engine#52277) 2024-04-20 [email protected] [et] Fix path canonicalization (flutter/engine#52274) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#147099) flutter/engine@3db86b3...6f4d753 2024-04-20 [email protected] Roll Skia from 1910252ea26a to 514d7fc627b3 (6 revisions) (flutter/engine#52277) 2024-04-20 [email protected] [et] Fix path canonicalization (flutter/engine#52274) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
You could test this change in the scenario you describe by adding a test to https://github.com/flutter/engine/blob/main/tools/engine_tool/test/entry_point_test.dart that creates such a symlink. |
Previously we were getting the enclosing directory path of the
et
tool (via thedirname
builtin), then canonicalising the path by resolving symlinks. This doesn't work if theet
on the path is itself a symlink. For example, if a user created a symlinket
in a concrete directory at~/.local/bin
:first we'd compute the dirname of the script:
then we'd resolve symlinks:
and incorrectly assume that was the engine directory.
Instead, we now resolve symlinks, then compute the enclosing directory.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.