Environment variable customization should be possible with scriptlet+snapcraftctl
Bug #1778174 reported by
林博仁(Buo-ren Lin)
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Wishlist
|
Kyle Fazzari |
Bug Description
Currently, snapcraftctl doesn't honor environment variable customization like setting a new command search PATH, bug #1600035 mentions `build-environment` key that should have this functionality but it doesn't seems to be implemented.
Changed in snapcraft: | |
milestone: | none → 3.0 |
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
We have a snap project where multiple binaries depend on a single custom library. With environment variables we could build the library part, then have the binary parts reference the lib output.
override-build: | PATH=$SNAPCRAFT _PRIME/ opt/myproject/ lib PATH=$SNAPCRAFT _PRIME/ opt/myproject/ lib/pkgconfig
export LD_LIBRARY_
export PKG_CONFIG_
# ^ environment settings above are discarded by snapcraftctl
snapcraftctl -d build
Alternatively if perhaps the cmake module had an option to pass environment variables in addition to "configflags", that'd be another way to resolve our issue.