meta: include environment in hook wrappers
Metadata
Current evaluation
Merged a fix restoring environment variable inclusion for Snapcraft hook wrappers, correcting a regression that limited it to apps. Approved, passed CI, and modified three files. Resolves LP #1824255.
Suggested action: —
No scores available.
Issue body
Snapcraft regressed in how it handled environment for app wrappers and
hook wrappers in that is no longer includes it for hooks (only apps).
Add back the environment inclusion for hooks.
LP: #1824255
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
Signed-off-by: Chris Patterson <chris.patterson@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/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix restoring environment variable inclusion for Snapcraft hook wrappers, correcting a regression that limited it to apps. Approved, passed CI, and modified three files. Resolves LP #1824255. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix restoring environment variable inclusion for Snapcraft hook wrappers, resolving a regression that previously excluded them. Closes LP: #1824255. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix restoring environment variable inclusion for hook wrappers in Snapcraft. This resolves a regression where environment variables were only applied to app wrappers, aligning hook behavior with app behavior per LP: #1824255. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2893 [legacy] meta: include environment in hook wrappers | snapcraft | merged | Merged into legacy to fix a regression excluding environment variables from hook wrappers. Approved by two reviewers and passed CI. Temporarily closed to align with master, then reopened and merged to resolve Launchpad bug #1824255. | |
| #4607 fix(application): support snap/craft environment variables | snapcraft | merged | Merged after three approvals and passing CI. The PR adds snap/craft environment variable support across two files. Initial spread test failures and merge conflicts from a concurrent PR were resolved before final integration. | |
| #3645 meta: parse environment variables (CRAFT-835) | snapcraft | merged | Merged into snapcraft/7.0. Implements parsing for the environment dictionary in snapcraft.yaml at the root and app levels. Approved, passed CI and unit tests, and achieved 100% diff coverage. | |
| #1206 snap: remove passthrough for hook environment | charmcraft | merged | Merged after three approvals. Removes snap hook environment passthrough. A failing spread test was bypassed during merge as it was unrelated and tracked in issue #1218. | |
| #1583259 Snappy needs to influence environment variables in applications | snapcraft (launchpad) | closed | Fixed via SRUs for snapcraft and click-reviewers-tools. Added an environment keyword to snapcraft.yaml that populates snap.yaml, enabling the launcher to apply variables directly and reducing wrapper scripts. Verified and closed. | |
| #3741 parts: replace snapcraft command-chain with environment | snapcraft | merged | Merged updates replacing snapcraft command-chain with global environment variables (LD_LIBRARY_PATH and PATH) for core22 snaps. The adapter field is deprecated. Approved and merged after passing CI checks. | |
| #2744 project_loader: load build-environment after snapcraft environment | snapcraft | merged | Merged fix to load the build-environment after the snapcraft environment, enabling access to internal variables like $SNAPCRAFT_PART_INSTALL. The change swaps the evaluation order in the project loader and was approved by maintainers. |