Bug 2277743

Summary: jq prints an invalid version string
Product: [Fedora] Fedora Reporter: Mihai Donțu <mihai.dontu>
Component: jqAssignee: Jonathan Wright <jonathan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 40CC: david, fpercoco, jonathan, karlthered, lhh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: jq-1.7.1-7.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-05-01 04:14:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.