Dirty snap release?

Wekan snapcraft.yaml is here:

It has this code:
version-script: git describe --dirty --tags | cut -c 2-

Previously when I built releases, it had generated versions like:
3.24
3.25-15-ga97360d

Now when it does not find any errors when building, it generates versions like:
3.29-dirty

I presume I can not fix this just by going to shower more often.

Any other ways to fix this?

Hmm, maybe this is why:
https://stackoverflow.com/questions/16035240/why-is-git-describe-dirty-adding-a-dirty-suffix-when-describing-a-clean-ch

1 Like

Oops, it did not work.
Determining the version from the project repo (version-script).
The version-script failed to run (exit code 1)

https://launchpadlibrarian.net/439398441/buildlog_snap_ubuntu_xenial_amd64_wekan-devel_BUILDING.txt.gz

Couple of options, perhaps you’re running git in the wrong place. Maybe you need to:-

version-script: git describe --dirty --tags -C parts/wekan | cut -c 2- to coerce it to look in parts/wekan.

Alternatively, remove version and version-script and use adopt-info: wekan then in the override-build section of the wekan part, at the end:

snapcraftctl set-version $(git describe --dirty --tags | cut -c 2-)

No need for -C there as you’ll be in the right place.

1 Like

It’s worth mentioning that adopt-into combined with snapcraftctl set-version is the way to do this going forward, because version-script is deprecated and will at the least raise a warning when building.

4 Likes

Running pull phase…
Failed to load plugin: properties failed to load for wekan: Additional properties are not allowed (‘adopt-info’ was unexpected)

https://launchpadlibrarian.net/439447515/buildlog_snap_ubuntu_xenial_amd64_wekan-devel_BUILDING.txt.gz

try this:

name: wekan
...
adopt-info: mypart
...
summary: The open-source kanban
description: |

part:
  mypart:
  ...
    override-build: |
      snapcraftctl set-version "$(git describe --dirty --tags | cut -c 2-)"
      snapcraftctl build
   stage-packages:
      - ...
...
1 Like

Sorry, I wasn’t clear. Yes, adopt-info is in the metadata, snapcraftctl goes in the override section.

Currently I’m trying to build with these changes, I don’t know are they correct:

My changes did not work:
https://launchpadlibrarian.net/439451580/buildlog_snap_ubuntu_xenial_amd64_wekan-devel_BUILDING.txt.gz

You added a new part called mypart which wasn’t necessary. Just add the snapcraftctl line to the override-build section in the wekan part, and make adopt-info: wekan then remove the mypart. I think @ogra was giving you generic advice about the placement of pieces in a yaml, rather than copy/pastable code.

2 Likes

It seems I have failed.

https://launchpadlibrarian.net/439488689/buildlog_snap_ubuntu_xenial_amd64_wekan-devel_BUILDING.txt.gz

It did build snap and upload to store, but snap store rejected because of these files, that AFAIK are deleted in snapcraft.yaml file. I did also try recursive delete of .swp files, but it did not work, those did still exists.

found potentially sensitive files in package: lib/node_modules/wekan/.build/bundle/programs/server/npm/node_modules/tar/lib/.mkdir.js.swp, lib/node_modules/wekan/.build/bundle/programs/server/node_modules/node-pre-gyp/node_modules/tar/lib/.mkdir.js.swp, lib/node_modules/wekan/node_modules/tar/lib/.mkdir.js.swp lint-snap-v2_iffy_files

And Wekan release still has word dirty in it.

I did about 8 releases of Wekan today, trying to make it work in various ways.

I did also go to shower and sauna.

How can I get it cleaned up?

While you should be using adopt-info as suggested above, it may be that you are seeing “dirty” because package-lock.json is tracked and might be modified by npm?

If any files in the git tree end up modified, it will result in the “dirty” label.

1 Like

I did have problems with deleting temporary .swp files with those newer version codes, build service did not accept Wekan package at all, so I had to go back to original version script and remove from command --dirty to get Wekan released.

Is there some reason there is plans to remove support for version script? Could it still be kept? I would like to still have version detection working, and to be able to release new Snap packages. It has taken countless of hours to get build service even to accept Wekan package at all. Or can someone help with making required changes to snapcraft.yaml ?

Wekan also still uses core-16. I was not able to get core-18 working at all with snap. Is it possible that someone would help with getting core-18 version of script working?

Can also someone help make Wekan snap for other CPU architectures? For that, Wekan source bundle is made like in current snapcraft.yaml on x64, then that bundle that is also at https://releases.wekan.team as wekan-3.xx.zip is on other CPU architecture unzipped and run npm install commands as described at bundle section of page https://github.com/wekan/wekan/wiki/Platforms .