← Back to issue list

meta: handle symlinked hooks (#2478)

View original Github issue

Metadata

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

Current evaluation

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.

Resolution: closed resolved

Reason: The PR was approved and merged into the legacy branch as commit 496ebba10 ("meta: handle symlinked hooks (#2478)"), reversing the breakage caused by c2f5a0dc0 (#2440) which chmod'ed hook file types without following symlinks.

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 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.
stealth/space-bunny-alpha — closed resolved Merged PR #2481 as commit 496ebba10, restoring symlinked-hook support by avoiding permission stat failures introduced by #2440.
stealth/space-bunny-alpha — closed resolved Merged in PR #2481 via commit 496ebba10, resolving the #2440 regression by safely handling symlinked hooks when changing permissions.
qwen/qwen3.6-35b-a3b — — Merged a fix for a regression in symlinked hook handling that caused FileNotFoundErrors during permission changes. Approved by reviewer, passed CI, and updated 2 files to safely resolve symlinks before stat operations.
qwen3.6-35b-a3b-mtp-q6 — — Merged fix for symlinked hooks handling broken by PR #2440. Resolves FileNotFoundErrors during permission changes by resolving symlinks before stat operations. Achieved 100% diff coverage.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#2440 (confidence 90%)

    Prior change (commit c2f5a0dc0) that made hooks executable and introduced the symlink regression this PR fixes.

  • Duplicate Of: canonical/snapcraft#2478 (confidence 60%)

    Issue corpus records the canonical numbering of this change as PR #2478, same title and commit 496ebba10; one of the two references is a duplicate/renumber.

Related issues

Issue Project State Summary Similarity
#2478 meta: handle symlinked hooks snapcraft merged 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.
89%
#2440 meta: make hooks executable instead of complaining they're not snapcraft merged PR #2440 by Saviq merged to master as commit c2f5a0dc0: snapcraft's meta no longer errors on non-executable hook scripts and instead chmods them +x. Fixes Launchpad bug #1812003.
72%
#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.
70%