- The following assignment doesn’t work:
It expands toparts: _part_name_: build-environment: - PYTHONPATH: $SNAPCRAFT_PART_INSTALL/lib/python3.6
/lib/python3.6
in theoverride-build
scriptlet - Why does the type of
environment
is a dict, whilebuild-environment
is an array?
The following assignment doesn’t work:
You’re right in assuming that it should. This is a regression introduced by this PR:
Please log a bug, CC @sergiusens.
Why does the type of
environment
is a dict, whilebuild-environment
is an array?
I will refrain from guessing why environment
is a dict, but build-environment
is an array so that the order is well-defined in the YAML spec. It means you can do things like this:
my-part:
plugin: nil
build-environment:
- FOO: "bar"
- BAZ: "$FOO/qux"
override-pull: |
echo "Look, the order is obvious: $BAZ"
Which works as expected:
$ snapcraft pull
Pulling my-part
Look, the order is obvious: bar/qux
It also means that extensions can add things to the build-environment without clashing with what the user put there.
1 Like
Thanks, here’s the bug: Bug #1822375 “SNAPCRAFT_PART_INSTALL doesn’t expand in build-env…” : Bugs : Snapcraft