meta: always generate snapcraft-runner to workaround classic (#2889) (#2891)
Snapcraft previously generated wrappers for most commands. Once
snapcraft became more conserative about generating unnecessary wrappers,
issues began to surface with regard to PATH being set incorrectly
for classic snap apps that did not use shell.
To work around the issue, this commit adds an empty snapcraft-runner to
the command-chain for all apps, where they typically would have none.
Once this issue is resolved in snapd, we can probably remove this
workaround.
Add unit tests for snapcraft-runner generation
Add some additional parameters to the SnapcraftYaml fixture
to make it more configurable.
plugs/slots: match output format read in snapcraft.yaml (#2884)
Snapcraft recently started always writing the long-form
of plugs for consistency, where the `interface` attribute
is always defined.
Unfortunately this seems to have tripped up a bug in review-tools
that won't likely be fixed for a while. This commit restores
the 3.8 behavior to ensure the output snap.yaml matches the syntax
used in the snapcraft.yaml.
Signed-off-by: Chris Patterson <email address hidden>
lifecycle: only warn when a default provider snap is missing (#2885)
Snapcraft gained the ability to check for artifacts from snaps listed as plugs
when using the content interface.
The side effect, is that the snap needs to be published on the main Snap Store,
this is a requirement brand stores cannot meet, so instead of failing,
Snapcraft resorts to warning instead.
meta: ensure Snap's `assumes` is initialized as a set
When reading the config data dictionary, convert the list to a set.
The `assumes` property is defined as a set in Snap meta, but derives
from a list in the the snap meta. This causes an exception when
using `command-chain`, but `command-chain` is not already in
the `assumes` (due to the use of Snap's usage of `.add()` on the
set, which is not available for lists).
Add a test for coverage/verification.
Fixes SNAPCRAFT-16C
Signed-off-by: Chris Patterson <email address hidden>
If the object is a string, use that string as the interface.
To ease the handling of this, we introduce cls.from_object() for
Slot and Plug to handle None, string, and dict cases. Snap will
now use these methods when populating the slots and plugs, instead
of cls.from_dict().
Add tests for coverage of from_object() and the string case.
LP #1859806
Signed-off-by: Chris Patterson <email address hidden>
The expected_snap.yaml includes the architecture definition,
which breaks when building on other architectures. Since
adapter isn't relevant to arch, simply limit the tests to amd64.
Signed-off-by: Chris Patterson <email address hidden>