raphaelcohn / swaddle

swaddle creates RPM, Deb and tarball packages using shell script. Everything you need to package is in Source Control in simple directories. No rpminfo cruft, no DEB makefile hell. No Python, Ruby, Perl or other unnecessary stuff required
Other
128 stars 2 forks source link

Package with version *and* timestamp? #32

Open ringods opened 9 years ago

ringods commented 9 years ago

My initial packages just had the timestamp detected via git as their version. For some of our work, we have parallel branches in which we want to identify the "major" release, but append the timestamp for consecutive builds.

Is this possible with swaddle? I tried setting the version in swaddle.conf but then the timestamp is gone. It seems to be one or the other.

E.g in a git-flow setup

https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version

The examples above show the version I set in swaddle.conf as the upstream_version and the date+iteration as the debian_revision. Would match nicely. :smile:

raphaelcohn commented 9 years ago

I'm not sure I'm exactly clear on what you're asking for me. However, I can go over how things work currently. Right now the version is one of two things:-

The challenges with versioning are:

Speaking personally, and from very long experience of managing massively complex projects, using date based versioning which matches git revision is preferable, since it makes a very rapid way to diagnose in production where an asset has come from. It also monotonically increases. What I no longer favour is any sort of semantic versioning, etc. In practice, it's completely meaningless, because it's the downstream users who determine if a change is breaking, and, with a large internal set up (or the internet at large), impossible to know (cf soname versioning - just as broken). I treat every package revision of anything now as 'breaking' - hence my current project to build a secure, built from source in git Linux which rebuilds downstream components on every change (it's a nightmare to do, because the GNU autocruft is hideous). However, I want you to be free as a swaddle user to use whatever versioning you want, provided it's sane and doesn't cause pain (or insecurity) to users. What swaddle won't support explicitly is build revisions - doing the same build, with the same source, should have the same version (incl iteration). This is something a lot of CI servers get wrong. It's also occasionally hard, because some linkers and the java jar embed a build timestamp.

Specifically in the Debian world, things are a little more refined than most versioning approaches. However, if one is producing one's own packages, I ought to point out I believe there is no upstream revision. And it also gets a little funky with remixes like Ubuntu, which do strange things to the iteration count.

So here are some proposals:-