-
Notifications
You must be signed in to change notification settings - Fork 835
Arm backend: Use symbolic links for dev pre-commit/push hooks #17411
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
base: main
Are you sure you want to change the base?
Arm backend: Use symbolic links for dev pre-commit/push hooks #17411
Conversation
This ensure latests checkout versions are always used instead of the version when you last runned the script. Signed-off-by: Zingo Andersen <Zingo.Andersen@arm.com> Change-Id: Id2200d77c04d6780417d6b5200fe0fbb74cc87ff
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17411
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New FailuresAs of commit c5c2d91 with merge base 2478798 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
Pull request overview
Switches Arm backend dev hook installation from hard links to symbolic links so Git hooks always point at the current checkout’s hook scripts.
Changes:
- Update copyright header year range.
- Replace
lnhard-link hook installation withln -susing resolved paths.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ln -s "$(realpath "$git_dir/../backends/arm/scripts/pre-push")" "$(realpath "$git_dir")/hooks" | ||
| ln -s "$(realpath "$git_dir/../backends/arm/scripts/pre-commit")" "$(realpath "$git_dir")/hooks" No newline at end of file |
Copilot
AI
Feb 12, 2026
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.
ln -s SOURCE DESTDIR only works as intended if DESTDIR already exists and is a directory; otherwise it will create a symlink named hooks (or fail), which is not what you want for Git hooks. Consider linking to explicit destination filenames (e.g., .../hooks/pre-push and .../hooks/pre-commit) and making the script idempotent by using -f (or removing existing hooks first).
| ln -s "$(realpath "$git_dir/../backends/arm/scripts/pre-push")" "$(realpath "$git_dir")/hooks" | |
| ln -s "$(realpath "$git_dir/../backends/arm/scripts/pre-commit")" "$(realpath "$git_dir")/hooks" | |
| hooks_dir="$(realpath "$git_dir")/hooks" | |
| mkdir -p "$hooks_dir" | |
| ln -sf "$(realpath "$git_dir/../backends/arm/scripts/pre-push")" "$hooks_dir/pre-push" | |
| ln -sf "$(realpath "$git_dir/../backends/arm/scripts/pre-commit")" "$hooks_dir/pre-commit" |
| ln -s "$(realpath "$git_dir/../backends/arm/scripts/pre-push")" "$(realpath "$git_dir")/hooks" | ||
| ln -s "$(realpath "$git_dir/../backends/arm/scripts/pre-commit")" "$(realpath "$git_dir")/hooks" No newline at end of file |
Copilot
AI
Feb 12, 2026
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.
Using realpath forces absolute symlink targets, which can break if the repo is moved (e.g., relocating a workspace). A relative symlink (computed from the hooks directory to backends/arm/scripts/...) typically preserves the 'always use latest checkout' behavior while remaining robust to path changes; also note realpath isn’t universally available in minimal environments.
| ln -s "$(realpath "$git_dir/../backends/arm/scripts/pre-push")" "$(realpath "$git_dir")/hooks" | |
| ln -s "$(realpath "$git_dir/../backends/arm/scripts/pre-commit")" "$(realpath "$git_dir")/hooks" | |
| mkdir -p "$git_dir/hooks" | |
| ( | |
| cd "$git_dir/hooks" || exit 1 | |
| ln -s "../../backends/arm/scripts/pre-push" pre-push | |
| ln -s "../../backends/arm/scripts/pre-commit" pre-commit | |
| ) |
This ensure latest checkout versions are always used instead of the version when you last runned the script.
cc @freddan80 @per @oscarandersson8218 @digantdesai