Skip to content

Inject the application's base snap into the managed instance #952

@lengau

Description

@lengau

What needs to get done

If we're running from a snap, we currently inject the app snap from the host. See:

if util.is_running_from_snap(self._app.name):
# use the aliased name of the snap when injecting
name = os.getenv("SNAP_INSTANCE_NAME", self._app.name)
channel = None
emit.debug(
f"Setting {self._app.name} to be injected from the "
"host into the build environment because it is running "
"as a snap."
)
else:
# use the snap name when installing from the store
name = self._app.name
channel = os.getenv("CRAFT_SNAP_CHANNEL", "latest/stable")
emit.debug(
f"Setting {self._app.name} to be installed from the {channel} "
"channel in the build environment because it is not running "
"as a snap."
)
self.snaps.append(Snap(name=name, channel=channel, classic=True))

We should inject the base snap that the app is using from the host as well.

Why it needs to get done

If the managed instance doesn't have this base snap (e.g. the app uses core24 and we're building on a 22.04 managed instance), the instance is currently downloading the base snap.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions