gnome-sdk icon indicating copy to clipboard operation
gnome-sdk copied to clipboard

Allow local build with local sdk

Open sergio-costas opened this issue 3 months ago • 7 comments

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.

sergio-costas avatar Sep 02 '25 08:09 sergio-costas

@3v1n0 Ok, I moved everything into an external script. This should be much safer.

sergio-costas avatar Sep 03 '25 17:09 sergio-costas

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 = True
    
  •            config_file.write(f"""
    
  •  echo Using local $CRAFT_PROJECT_DIR/{sdk_file}
    
  •  snap install --dangerous $CRAFT_PROJECT_DIR/{sdk_file}
    
  •  sdk_version=local
    
  •  cp -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/
    

+""")

  •            continue
    
  •        if line.strip() == '#end':
    
  •            jump_over = False
    
  •            completed = True
    
  •            continue
    
  •    if 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 avatar Oct 15 '25 12:10 nteodosio

@nteodosio Changes done.

sergio-costas avatar Oct 15 '25 12:10 sergio-costas

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.

sergio-costas avatar Oct 15 '25 12:10 sergio-costas

An external envvar is an evironment variable not defined inside the script, but in the snapcraft.yaml file or when calling snapcraft.

sergio-costas avatar Oct 15 '25 12:10 sergio-costas

Oh sorry response by email put it out of thread... I'll respond in the thread.

nteodosio avatar Oct 15 '25 13:10 nteodosio

By the way, I'm opening https://launchpad.net/bugs/2127927 so that this can eventually addressed where it should be, namely Snapcraft itself.

nteodosio avatar Oct 15 '25 13:10 nteodosio