Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5b2241e

Browse files
authored
[et] Fix path canonicalization (#52274)
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. ## 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
1 parent 3db86b3 commit 5b2241e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/et

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function follow_links() (
2727
echo "$file"
2828
)
2929

30-
SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")")
30+
SCRIPT_DIR="$(dirname -- "$(follow_links "${BASH_SOURCE[0]}")")"
3131
ENGINE_DIR="$(cd "$SCRIPT_DIR/.."; pwd -P)"
3232

3333
case "$(uname -s)" in

0 commit comments

Comments
 (0)