variable 'version' can only be set in a part that adopts external metadata.
But, you give override-<step> and I fail to find what a āpart that adopts external metadataā means Is there any example of setting the version from a command that reads the version from the sources that works with core22?
Is there a way to have both the snapcraft default and append to it? Rather than just override.
In core20, if I do e.g:
environment:
PATH: ${SNAP}/custom/bin
Then this will be appended to the default $PATH. With the new logic, itās entirely replaces the default path, and the following doesnāt work.
PATH: ${SNAP}/custom/bin:${PATH}
Where this is more problematic is for $LD_LIBRARY_PATH, because of the common usage of architecture triplets in file paths, you end up having to resort to using a wrapper script to append the value or else the alternative would be hardcoding the value in a way that would probably only work on a single architecture.
Plus, personally, I liked the old way for being cleaner!
name: polka
base: core22
summary: Polka Snap App
description: A Snap package for the Polka app.
adopt-info: polka-app
grade: stable
confinement: strict
apps:
polka:
command: bin/polka
parts:
polka-app:
plugin: dump
source: https://github.com/erik78se/polka.git
source-tag: v0.9.44
override-pull: |
craftctl default
craftctl set version "$(craftctl get part.polkadot.source-tag)-$(git rev-parse --short HEAD)"
2023-06-21 00:24:09.848 :: 2023-06-20 22:24:07.917 :: error: āoverride-pullā in part āpolka-appā executed an invalid control API call: āpart.polkadot.source-tagā is not a valid variable name.
How can I access the source-tag and use it in my version of the snap?
@sergiusens Is there any specific reason for not transforming SNAPCRAFT_PROJECT_VERSION to something like CRAFT_PROJECT_VERSION since using craftctl get version doesnt seem to work on fetching sources for e.g -->
source: https:xyz.com/$(craftctl get version).deb
It would have been great if a better and working modern variant of the SNAPCRAFT_PROJECT_VERSION be provided.
I have a problem also migrating from core18 to core22 that maybe someone could assist with. I want to be able to access systemd-journal-remote from my snap, but it seems not to be enough to list it as a stage package anymore as I get many linker errors (examples of which are shown)
bin/bash: relocation error: /bin/bash: symbol dlclose version GLIBC_2.17 not defined in file libdl.so.2 with link time reference
Running linter: library - (2.0s)
Unable to determine library dependencies for āusr/lib/aarch64-linux-gnu/libroken.so.18.1.0ā /bin/bash: relocation error: /bin/bash: symbol dlclose version GLIBC_2.17 not defined in file libdl.so.2 with link time reference
I have made some progress in porting snapcraft.yaml files with the filesets keyword to core22.
In the end, it was not difficult, here is an example which may help you:
Example part definition from before which was using dump plugin to move some but not all files:
move-ext-lib:
plugin: dump
source: ./ext-lib/
filesets:
platformIndependentJarFiles2: [ext-lib/*.jar, ext-lib/jaxrs-ri/*, -ext-lib/RXTXcomm.jar]
platformDependentFiles:
- on armhf: [rasp-pi/*]
- on amd64: [amd64/*]
- on arm64: [arm64/*]
organize:
"*": ext-lib/
stage:
- $platformIndependentJarFiles2