Bug 2277743 - jq prints an invalid version string
Summary: jq prints an invalid version string
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: jq
Version: 40
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jonathan Wright
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-29 11:53 UTC by Mihai Donțu
Modified: 2024-05-01 04:14 UTC (History)
5 users (show)

Fixed In Version: jq-1.7.1-7.fc40
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-05-01 04:14:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mihai Donțu 2024-04-29 11:53:21 UTC
The problem is quite obvious:

$ rpm -q jq
jq-1.7.1-4.fc40.x86_64

$ jq --version
jq-

This breaks tools that check the version to ensure the used query syntax is supported.

Reproducible: Always

Steps to Reproduce:
1. install jq
2. run 'jq --version'
3. notice the incomplete string
Actual Results:  
The command prints 'jq-'.

Expected Results:  
The command should print 'jq-1.7.1'.

Comment 1 Mihai Donțu 2024-04-29 12:50:40 UTC
I think the expected result should be 'jq-1.7', that's because on Fedora 39 the displayed version is made of just two digits.

Comment 2 Jonathan Wright 2024-04-29 17:26:40 UTC
This appears to be an upstream bug/regression introduced in 1.7, and still exists in 1.7.1.

Can you please report the bug upstream?  Their tracker is at https://github.com/jqlang/jq/issues

I've been unsuccessful in patching this thus far as I'm not a C developer, but I'm still trying to find where the root issue lies.

Comment 3 Jonathan Wright 2024-04-29 18:08:52 UTC
I came up with a fix.

https://github.com/jqlang/jq/pull/3099

Comment 4 Fedora Update System 2024-04-29 18:45:15 UTC
FEDORA-2024-f1e93cb927 (jq-1.7.1-7.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-f1e93cb927

Comment 5 Fedora Update System 2024-04-30 02:07:07 UTC
FEDORA-2024-f1e93cb927 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f1e93cb927`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f1e93cb927

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2024-05-01 04:14:36 UTC
FEDORA-2024-f1e93cb927 (jq-1.7.1-7.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.