Dirty snap release?


#1

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?


#2

Hmm, maybe this is why:


#3

#4

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


#5

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.


#6

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.


#7

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


#8

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:
      - ...
...

#9

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


#10

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


#11

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


#12

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.


#13

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?


#14

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.


#15

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 .