#68923 closed defect (fixed)

jq @1.7.1: version is reporting as `jq-`, not `jq-1.7.1`

Reported by: halostatue (Austin Ziegler) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: herbygillot (Herby Gillot)
Port: jq

Description

This happens on the buildbot versions or build from source.

$ sudo port uninstall jq && sudo port install -s jq
--->  Deactivating jq @1.7.1_0
--->  Cleaning jq
--->  Uninstalling jq @1.7.1_0
--->  Cleaning jq
--->  Computing dependencies for jq
--->  Verifying checksums for jq
--->  Extracting jq
--->  Configuring jq
--->  Building jq
--->  Staging jq into destroot
--->  Installing jq @1.7.1_0
--->  Activating jq @1.7.1_0
--->  Cleaning jq
--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.

$ jq --version
jq-

Getting the same distfile (port fetch jq), extracting it, and then configuring and building it creates a version which contains the version, *unless* autoreconf is run:

$ port fetch jq
…
$ cp /opt/local/var/macports/distfiles/jq/jq-1.7.1.tar.gz .
$ tar xfz jq-1.7.1.tar.gz
$ cd jq-1.7.1
$ ./configure --disable-docs --disable-silent-urle --with-oniguruma=/opt/local --disable-maintainer-mode && make && ./jq --version
# lots of output
jq-1.7.1
$ autoreconf && $ ./configure --disable-docs --disable-silent-urle --with-oniguruma=/opt/local --disable-maintainer-mode && make && ./jq --version
# lots of output
jq-

The problem appears to be that scripts/version expects to be run from the git repository and exits out if there is no .git directory (and it would require tags in any case).

I have a possible PR (https://github.com/macports/macports-ports/compare/master...halostatue:macports-ports:fix-jq-version), but I don't particularly like this approach since the releases tarball is already properly configured by the jq project (this may differ from previous versions). The simpler fix would be:

  • sysutils/jq/Portfile

    diff --git i/sysutils/jq/Portfile w/sysutils/jq/Portfile
    index f1c4d3bcc65e..04335e284aa8 100644
    i w configure.args --disable-docs \ 
    4141                    --with-oniguruma=${prefix} \
    4242                    --disable-maintainer-mode
    4343
    44 use_autoreconf      yes
    45 
    4644livecheck.type      regex
    4745livecheck.regex     ${name}-(\\d+(\.\\d+)+)\.tar
    4846

Change History (4)

comment:1 Changed 11 months ago by halostatue (Austin Ziegler)

Summary: jq version is reporting as `jq-`, not `jq-1.7` or `jq-1.7.1`jq version is reporting as `jq-`, not `jq-1.7.1`

comment:2 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)

Not running autoreconf is preferred; we only want to use autoreconf if there's a reason to do so. Looks like it was initially added in [05ec0097df09635392ab134d8fa7ea7304160643/macports-ports] when it was necessary to patch the build system. The build system patch was removed in [a8e7dcaa0ce500e22d41e027abfe8594e943eb0b/macports-ports] and use_autoreconf yes should have been removed at that time, unless there is a second reason why autoreconf is being used. It's a good idea always to put a comment above the use_autoreconf yes line to explain why it is being used, so that if that reason goes away the necessity for the line can be reexamined.

comment:3 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: herbygillot added
Keywords: haspatch added
Owner: set to raimue
Status: newassigned
Summary: jq version is reporting as `jq-`, not `jq-1.7.1`jq @1.7.1: version is reporting as `jq-`, not `jq-1.7.1`

comment:4 Changed 11 months ago by herbygillot (Herby Gillot)

Resolution: fixed
Status: assignedclosed

In 676edeedbd6386f77f6b20da89c5f3c6bb8744e2/macports-ports (master):

jq: do not autoreconf

Fixes: #68923

Note: See TracTickets for help on using tickets.