← Back to issue list

Environment stops working in snapcraft if defined

View original Github issue

Metadata

Project
snapcraft
Number
#4159
Type
issue
State
closed
Author
sergiusens
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

PATH and LD_LIBRARY_PATH are now retained when top-level environment variables are defined for core22+, via merged PR #3741 (ec190695c).

Resolution: closed resolved

Reason: Merged PR #3741 (commit ec190695c) introduced core22 environment defaults that preserve PATH and LD_LIBRARY_PATH. A maintainer subsequently confirmed the bug is fixed in core22+.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description if I defined environment in snapcraft.yaml PATH and LD_LIBRARY_PATH are no longer valid ### To Reproduce ``` environment: foo: foo ``` then PATH and LD_LIBRARY_PATH are no longer set ### Environment N/A ### snapcraft.yaml ```shell N/A ``` ### Relevant log output ```shell N/A ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved PATH and LD_LIBRARY_PATH are now retained when top-level environment variables are defined for core22+, via merged PR #3741 (ec190695c).
stealth/space-bunny-alpha — closed resolved Fixed for core22+: PATH and LD_LIBRARY_PATH are retained when another top-level environment variable is defined; defaults were introduced by merged PR #3741 (ec190695c).
qwen/qwen3.6-35b-a3b — — The regression causing PATH and LD_LIBRARY_PATH to disappear when defining environment variables in snapcraft.yaml was fixed in core22+.
qwen/qwen3.6-35b-a3b — — Fixed in core22+. Defining environment variables in snapcraft.yaml previously broke PATH and LD_LIBRARY_PATH. The update restores default paths while allowing custom environment definitions.
qwen/qwen3.6-35b-a3b — — Defining environment variables in snapcraft.yaml previously broke PATH and LD_LIBRARY_PATH. This bug has been fixed in core22+, as the maintainer noted the change could be disruptive for older bases.
qwen/qwen3.6-35b-a3b — — Defining environment variables in snapcraft.yaml previously overwrote default PATH and LD_LIBRARY_PATH. This bug has been fixed in core22+ to restore proper environment handling without disrupting existing snaps.
qwen3.6-35b-a3b-mtp-q6 — — Defining environment variables in snapcraft.yaml previously broke PATH and LD_LIBRARY_PATH. The bug was fixed in core22+, restoring proper environment handling. Closed.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/snapcraft#3741 (confidence 98%)

    The merged change introduced global PATH and LD_LIBRARY_PATH handling for core22 parts.

Related issues

Issue Project State Summary Similarity
#4187 Environment is being set for classic snaps snapcraft closed Classic-confinement snaps no longer receive top-level LD_LIBRARY_PATH and PATH; fixed by merged PR #4216 in commit 9b6e58337.
75%
#2011842 Incorrect default LD_LIBRARY_PATH snapcraft (launchpad) open Core22+ Snapcraft emits unsupported shell expansion for LD_LIBRARY_PATH; the behavior is reproduced and remains blocked on snapd environment-list support.
72%
#1975498 PATH/LD_LIBRARY_PATH not set in snapcraft 7.0 snapcraft (launchpad) closed PATH/LD_LIBRARY_PATH regression in core22 snaps was fixed by PR #3758, merged as 6e8835dc8 and released in Snapcraft 7.1.
72%