Not sure if this is a bug but it feels like one.
The prime stage doesn’t have the SNAPCRAFT_PART_INSTALL
variable avaialble. Attempting to use it in an override-prime
section produces the following error:
/bin/bash: line 41: SNAPCRAFT_PART_INSTALL: unbound variable
Perhaps this is deliberate, but it feels like a mistake, since the prime stage " copies the staged files from SNAPCRAFT_PART_INSTALL to the shared SNAPCRAFT_PRIME".
The relevant code:
def get_snapcraft_part_directory_environment(
part: "PluginHandler", *, step: Optional[steps.Step] = None
) -> Dict[str, str]:
env = {
"SNAPCRAFT_PART_SRC": part.part_source_dir,
"SNAPCRAFT_PART_SRC_WORK": part.part_source_work_dir,
}
if step is None or step == steps.BUILD:
env.update(
{
"SNAPCRAFT_PART_BUILD": part.part_build_dir,
"SNAPCRAFT_PART_BUILD_WORK": part.part_build_work_dir,
"SNAPCRAFT_PART_INSTALL": part.part_install_dir,
}
)
return env
Should this be amended to provide it to the prime stage?
Thanks.