aptly icon indicating copy to clipboard operation
aptly copied to clipboard

Version detection in Makefile fails when building from tarball

Open triallax opened this issue 1 year ago • 2 comments

Detailed Description

See title. The issue is with this particular line in the Makefile:

https://github.com/aptly-dev/aptly/blob/f0a85b2b6e746f6da90ca85187ec2bb658490740/Makefile#L2

This won't work if the current directory isn't a Git repo. The most common case is when installing from a source tarball.

Context

This change is important to pretty much all package repos that package aptly; if a version with this Git version detection is released, they will have to patch the Makefile with the correct version.

Possible Implementation

Perhaps just leave it as it was before, passing a main.Version tag to the Go build, and allowing passing a VERSION variable to the Makefile.

Your Environment

There shouldn't be relevant information about my environment.

triallax avatar Jul 21 '22 20:07 triallax

The behaviour actually shouldn't be different than before: https://github.com/aptly-dev/aptly/pull/1090/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L2

The only difference is that you can now specify a VERSION file and go will embed that at build time. Maybe there should be a check if the VERSION file and only run git describe when it doesn't exist.

randombenj avatar Aug 04 '22 13:08 randombenj

The only difference is that you can now specify a VERSION file and go will embed that at build time. Maybe there should be a check if the VERSION file and only run git describe when it doesn't exist.

Hmm, I think that should be okay, yeah.

triallax avatar Aug 04 '22 13:08 triallax