← Back to issue list

meta: make hooks executable instead of complaining they're not

View original Github issue

Metadata

Project
snapcraft
Number
#2440
Type
pull request
State
merged
Author
Saviq
Labels
—
Created
Updated
Closed

Current evaluation

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.

Resolution: closed resolved

Reason: Merged into master with commit c2f5a0dc0 ("meta: make hooks executable instead of complaining they are not"), changing snapcraft/internal/meta/snap.py hook handling from a permissions error to setting the executable bit, and adding tests. Maintainer sergiusens noted whitelist filtering was deferred to a follow-up PR.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] 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)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh tests/unit`? ----- Fixes https://bugs.launchpad.net/snapcraft/+bug/1812003

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved 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.
stealth/space-bunny-alpha — closed resolved Merged #2440 into master (c2f5a0dc0), making hooks executable instead of erroring over missing permissions; #2441 cherry-picked the fix to legacy.
stealth/space-bunny-alpha — closed resolved Merged as commit c2f5a0dc0, making snapcraft hook files executable instead of rejecting them; fixes Launchpad bug 1812003.
qwen/qwen3.6-35b-a3b — — Merged into master. Hooks are now made executable instead of triggering an error, resolving bug #1812003. The change passed CI, received approval, and achieved 100% diff coverage. Whitelisting was deferred to a follow-up PR.
qwen3.6-35b-a3b-mtp-q6 — — Merged, resolving bug #1812003 by making hooks executable instead of raising errors. Achieved 100% diff coverage with negligible overall decrease. Future whitelisting logic will be handled separately.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: snapcraft#2441 (confidence 92%)

    Cherry-pick of #2440 into the legacy snapcraft branch, merged, so 2.x also makes hooks executable

  • Related To: snapcraft#2478 (confidence 55%)

    Later commit 496ebba10 'meta: handle symlinked hooks' extends the same hook-permission handling area

Related issues

Issue Project State Summary Similarity
#2441 legacy/meta: make hooks executable instead of complaining they're not snapcraft merged Merged into legacy in #2441, cherry-picking #2440 (c2f5a0dc0), so hook files are made executable instead of causing a permissions error; fixes Launchpad bug #1812003.
81%
#1812003 hooks should be made executable instead of erroring out snapcraft (launchpad) closed Fixed by merged PR snapcore/snapcraft#2440 (commit c2f5a0dc0), which packages recognized hooks as executable instead of rejecting non-executable source files.
81%
#3386 meta: don't overwrite preconfigured hooks with stubs snapcraft merged Hook stub generation now preserves existing primed meta/hooks scripts; merged in snapcraft#3386 via commit bb9525144, with added unit-test fixtures and coverage.
73%
#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.
72%
#3659 meta: add support for hooks snapcraft merged Merged snapcraft#3659 via commit 00eed7dc9 (merge 795294fd5) into snapcraft/7.0, adding hooks support in snapcraft.yaml for CRAFT-808.
71%