Allow local build with local sdk
The RUNTIME snap is derived from the corresponding SDK snap, but currently, the SDK is directly downloaded from the store, from the CANDIDATE branch. This prevents building a RUNTIME snap with a locally built SDK snap. But this is a very desirable thing to do because it's the only way of testing a change in the SDK and ensure that it doesn't break any snap that depends on them.
This patch includes a python script that allows to build the RUNTIME using a local SDK snap.
This allows to build the RUNTIME locally with a new, still not uploaded, SDK, and test it.
@3v1n0 Ok, I moved everything into an external script. This should be much safer.
What would be an external envvar?
Am 15/10/2025 um 05:17 schrieb @.***:
@sergio-costas commented on this pull request.
if line.strip() == '#begin':
jump_over = Trueconfig_file.write(f"""echo Using local $CRAFT_PROJECT_DIR/{sdk_file}snap install --dangerous $CRAFT_PROJECT_DIR/{sdk_file}sdk_version=localcp -a /snap/gnome-46-2404-sdk/current/usr $CRAFT_PART_INSTALL/cp -a /snap/gnome-46-2404-sdk/current/etc $CRAFT_PART_INSTALL/cp -a /snap/gnome-46-2404-sdk/current/var $CRAFT_PART_INSTALL/cp -a /snap/gnome-46-2404-sdk/current/lib $CRAFT_PART_INSTALL/+""")
continueif line.strip() == '#end':jump_over = Falsecompleted = Truecontinueif not jump_over:config_file.write(line)The point is that we must ensure that there is no risk of an external envvar triggering it accidentally... I'll try another way.
@nteodosio Changes done.
The motivation for snapcraft.yaml -> snap/snapcraft.yaml is because we have to modify it, and since the one in the project folder has priority over the one at snap folder, we can preserve the original one and just create a modified version that will be used over the original one.
An external envvar is an evironment variable not defined inside the script, but in the snapcraft.yaml file or when calling snapcraft.
Oh sorry response by email put it out of thread... I'll respond in the thread.
By the way, I'm opening https://launchpad.net/bugs/2127927 so that this can eventually addressed where it should be, namely Snapcraft itself.