Bug 2255013 - Versions installed explicitly and through requires differ
Summary: Versions installed explicitly and through requires differ
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: postgresql
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Filip Januš
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-12-18 13:48 UTC by Lukáš Zaoral
Modified: 2024-11-13 10:17 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Lukáš Zaoral 2023-12-18 13:48:37 UTC
The system version of PostgreSQL should be 15.  However, any unversioned BuildRequires or Requires in spec will install version 16.

Reproducible: Always

Steps to Reproduce:
1. `dnf install postgreqsl`
2. Get some SRPM that has `BuildRequires: postgresql`, `BuildRequires: postgresql-devel`, etc.
3. `dnf builddep ${SRPM}`
Actual Results:  
First command will install version 15, the second one will install version 16.

Expected Results:  
Both commands succeed and both will install PostgreSQL 15.

Comment 1 Filip Januš 2024-01-02 10:10:06 UTC
Hi Lukas,
The report is missing the fedora version. My assumption is F-39, as you mentioned, the default version is Postgresql 15. 

I have checked both F39 and Rawhide, too. But I haven't spotted any issue.
dnf builddep works in the same way as dnf install.
To be able to help you, please provide me with more details about your use case.

Comment 2 Kamil Dudka 2024-01-02 10:43:51 UTC
(In reply to Filip Januš from comment #1)
> The report is missing the fedora version.

I can see `Product: Fedora` and `Version: 39` in bug metadata.

Comment 3 Filip Januš 2024-01-02 10:48:38 UTC
Yes, I am sorry for my mistake.

Comment 4 Filip Januš 2024-01-09 15:11:19 UTC
First of all, thank you for your report and investigation. My first attempt to test it encountered the accidentally working case (osm2pgsql package). 

Our design relied on consistent dnf functionality across all its modules (install, builddep, update, etc.). It means dnf install works the same as dnf builddep.
Unfortunately, dnf has a feature that causes different behavior between dnf install and dnf builddep.
More about this issue: https://github.com/rpm-software-management/dnf5/issues/620

Our concept relied on the priority of package names over provides. It works fine for dnf install but not for the builddep, which doesn't consider package name. Our new concept of packaging did not cover such functionality. Then, it leads to the above-described wrong behavior. But only when the default postgresql stream is lower than the other supported streams. As in the case of Fedora 39, the default version of postgresql is 15, but there is also an alternative stream of postgresql - version 16. 

Possible workaround:
In case you need to build your app with postgresql dependency pin, the desired version of postgresql.
Example Requires: postgresql-server < 16

Proposed solution:
Since we relied on the package name to select the default postgresql stream, a more significant change was necessary in the concept to address this issue.
For the selection of default, postgresql stream should be used postgresql provide. The symbol postgresql(or postgresql-*) will be provided only by the default stream. Alternative streams will be delivered with symbols in the format: postgresqlNN(or postgresqlNN-*) where NN represents the version of the PostgreSQL stream. 
In case the postgresql stream doesn't matter, all packages provide symbol -any (postgresql-any, postgresql16-any, postgresql-server-any, postgresql16-server-any,...).
Proposed adjustment of demodularization: https://src.fedoraproject.org/rpms/postgresql16/pull-request/1

Comment 5 Filip Januš 2024-01-18 13:21:52 UTC
Proposed fix for F39: https://src.fedoraproject.org/rpms/postgresql/pull-request/63

Comment 6 Aoife Moloney 2024-11-13 10:17:24 UTC
This message is a reminder that Fedora Linux 39 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 39 on 2024-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '39'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 39 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.


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