← Back to issue list

meta: handle symlinked hooks

View original Github issue

Metadata

Project
snapcraft
Number
#2478
Type
pull request
State
merged
Author
sergiusens
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #2478 by sergiusens fixes a regression from #2440: symlinked hooks broke because the code stat'd the symlink target that may not exist, raising FileNotFoundError. Merged as commit 496ebba10.

Resolution: closed resolved

Reason: The PR was approved and merged into master as commit 496ebba10 ('meta: handle symlinked hooks (#2478)'), resolving symlinks before applying stat-based permission changes to hooks so broken symlinks no longer raise FileNotFoundError.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Handling of symlinked hooks broke with the introduction of #2440 which tries to change permissions of their file type which can lead to FileNotFoundErrors as the symlinked file may not be available at the time of the stat change. Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [ ] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #2478 by sergiusens fixes a regression from #2440: symlinked hooks broke because the code stat'd the symlink target that may not exist, raising FileNotFoundError. Merged as commit 496ebba10.
stealth/space-bunny-alpha — closed resolved Merged PR #2478 fixed the symlinked-hook regression from #2440 by resolving symlinks before stat-based permission changes, preventing FileNotFoundError (commit 496ebba10).
stealth/space-bunny-alpha — closed resolved Merged PR #2478 in commit 496ebba10, fixing symlinked hooks to resolve links before permission changes and avoid FileNotFoundError regressions from #2440.
qwen/qwen3.6-35b-a3b — — Merged PR #2478 resolves a regression from #2440 that broke symlinked hooks. The fix prevents FileNotFoundErrors during permission changes by properly resolving symlinks before stat operations. Approved, passed CI, and merged into master.
qwen3.6-35b-a3b-mtp-q6 — — Merged into master. Resolves a regression from PR #2440 where permission changes on symlinked hooks triggered FileNotFoundErrors. The fix correctly handles symlinks, achieving 100% diff coverage.

Update history

No update history recorded yet.

Related work

  • Caused By: canonical/snapcraft#2440 (confidence 95%)

    PR body states handling of symlinked hooks broke with #2440 (commit c2f5a0dc0), which changed permissions of the symlink's file type; #2441 cherry-picked that fix to legacy.

  • Related To: canonical/snapcraft#2441 (confidence 55%)

    Backport of #2440 to the legacy snapcraft branch, so the same symlink regression would apply there too.

Related issues

Issue Project State Summary Similarity
#2481 meta: handle symlinked hooks (#2478) snapcraft merged PR #2481 merged as commit 496ebba10 ("meta: handle symlinked hooks"), fixing the regression from #2440 by resolving symlinked hooks before stat/chmod so FileNotFoundError is no longer raised.
89%
#2480 Legacy symlinked hooks snapcraft closed Closed unmerged after about 7.6 years without reviews or CI; no resolving change was found. Related symlink-hook support had landed earlier in 496ebba10 via #2478.
74%