← Back to issue list

parts: replace snapcraft command-chain with environment

View original Github issue

Metadata

Project
snapcraft
Number
#3741
Type
pull request
State
merged
Author
cmatsuoka
Labels
—
Created
Updated
Closed

Current evaluation

Merged #3741 as ec190695c, replacing core22 snapcraft_runner command-chain handling with command-chain and global LD_LIBRARY_PATH/PATH defaults while deprecating adapter.

Resolution: closed resolved

Reason: PR #3741 was merged in commit ec190695c, with implementation commit 46a3e90be. Its core22 environment and command-chain changes are now incorporated into Snapcraft.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Changes for core22 snaps: 1. Pass `command_chain` to snap.yaml. 2. Deprecate `adapter` field. 3. Replace `snapcraft_runner` and it's entry in the `command_chain` with global environment variables (`LD_LIBRARY_PATH` and `PATH`). 4. Assume `command-chain` if app or hook `command-chain`s are declared. <br /> Behavior for overriding `LD_LIBRARY_PATH` and `PATH` in snapcraft.yaml: - If `LD_LIBRARY_PATH` or `PATH` are defined, keep user-defined values. - If `LD_LIBRARY_PATH` or `PATH` are not defined, set to default values. - If `LD_LIBRARY_PATH` or `PATH` are null, do not use default values <br /> Default values: - `LD_LIBRARY_PATH`: `$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH` - `PATH`: `$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH` <br /> LP: #[1973173](https://bugs.launchpad.net/snapcraft/+bug/1973173) CRAFT-1065 Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> Co-authored-by: Claudio Matsuoka <claudio.matsuoka@canonical.com> - [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] Have you successfully run `make lint`? - [x] Have you successfully run `pytest tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged #3741 as ec190695c, replacing core22 snapcraft_runner command-chain handling with command-chain and global LD_LIBRARY_PATH/PATH defaults while deprecating adapter.
stealth/space-bunny-alpha — closed resolved Merged PR #3741 in ec190695c: core22 parts now use command-chain and global LD_LIBRARY_PATH/PATH instead of snapcraft_runner; the adapter field is deprecated.
qwen/qwen3.6-35b-a3b — — 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.
qwen3.6-35b-a3b-mtp-q6 — — Merged replacement of snapcraft command-chain with environment variables (LD_LIBRARY_PATH and PATH) for core22 snaps. Deprecated the adapter field and updated env handling. Successfully merged into main after passing checks.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1824255 snapcraft should use command-chain for hooks snapcraft (launchpad) closed Fixed hook environment setup in merged #2897 (bfac28cea) by embedding the generated snap environment in hook wrappers; released in Snapcraft 3.10.
74%
#1794261 Put environment in command-chain instead of the opaque wrapper snapcraft (launchpad) closed Fixed by merged PR snapcore/snapcraft#2291 (commit e0f567833), moving plugin environments and runnables from opaque per-app wrappers into a dedicated runner.
73%
#1798918 command-chain is incompatible with legacy adapter, but snapcraft doesn't say so snapcraft (launchpad) closed Added a sanity check rejecting command-chain use with the legacy app adapter in snapcore/snapcraft#2375 (commit 57c7fb8d0).
71%
#2861 meta: remove Application's `prepend_command_chain` snapcraft merged PR #2861 merged as commit 61bd3ab5d: dropped Application.prepend_command_chain and renamed snap packaging's _generate_command_chain to _generate_snapcraft_runner. Follow-up fix #2864 also merged.
70%
#2836 meta: fix command-chain handling when Application adapter == "none" snapcraft closed PR #2836 was closed unmerged on 2020-01-07 by author cjp256 in favor of a simpler back-portable PR #2853, which was merged (commit 9599497fb) and fixed adapter: none adding snapcraft-runner to command-chain.
70%
#2864 meta: assume command-chain fix for prepending snapcraft-runner snapcraft merged Merged #2864 in commit 94e9ef908, correcting assumes detection when snapcraft-runner is prepended via command-chain and adding test coverage.
70%