How to properly BuildRequire an older version of a python package?
Hi all, python-ansible-compat had a new release 4.0.2, which brings improvements but is not compatible with the older 3.0.2 release. ansible-lint works with the new one, molecule does not yet. I wanted to package both until molecule gets updated, but as soon as the new one is present, molecule is "unresolvable". And I thought this worked for similar problems in the past, so I might just miss something.
https://build.opensuse.org/project/show/home:ojkastl_buildservice:Branch_sys...
python-ansible-compat is 4.0.2 python-ansible-compat-3 is 3.0.2 Both have "Use for build" enabled. molecule has this in the spec: BuildRequires: (%{ansible_python}-ansible-compat >= 2.2.0 with %{ansible_python}-ansible-compat < 4) I also tried to use "... >= 3.0.0" or "== 3.0.2", but I only get this: unresolvable: nothing provides python311-ansible-compat = 3.0.2 (got version 4.0.2-lp154.28.2) or unresolvable: nothing provides python3-ansible-compat = 3.0.2 (got version 4.0.2-28.3) Can someone spot my mistake? What am I missing? Kind Regards, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
On Thu, May 11, 2023 at 10:54 AM Johannes Kastl <kastl@b1-systems.de> wrote:
Hi all,
python-ansible-compat had a new release 4.0.2, which brings improvements but is not compatible with the older 3.0.2 release.
ansible-lint works with the new one, molecule does not yet.
I wanted to package both until molecule gets updated, but as soon as the new one is present, molecule is "unresolvable". And I thought this worked for similar problems in the past, so I might just miss something.
https://build.opensuse.org/project/show/home:ojkastl_buildservice:Branch_sys...
python-ansible-compat is 4.0.2 python-ansible-compat-3 is 3.0.2 Both have "Use for build" enabled.
molecule has this in the spec: BuildRequires: (%{ansible_python}-ansible-compat >= 2.2.0 with %{ansible_python}-ansible-compat < 4)
I also tried to use "... >= 3.0.0" or "== 3.0.2", but I only get this:
unresolvable: nothing provides python311-ansible-compat = 3.0.2 (got version 4.0.2-lp154.28.2)
or
unresolvable: nothing provides python3-ansible-compat = 3.0.2 (got version 4.0.2-28.3)
Can someone spot my mistake? What am I missing?
I assume you need %{ansible_python}-ansible-compat-3 because this is the package that has version 3.
Hi Andrei, thanks for the quick reply. On 11.05.23 at 09:57 Andrei Borzenkov wrote:
On Thu, May 11, 2023 at 10:54 AM Johannes Kastl <kastl@b1-systems.de> wrote:
python-ansible-compat is 4.0.2 python-ansible-compat-3 is 3.0.2
I assume you need %{ansible_python}-ansible-compat-3 because this is the package that has version 3.
The package content is the same as python-ansible-compat, just an older version. So the package name is "python-ansible-compat", not "...-3". Using "...-3" in the BuildRequires does not work.
nothing provides python3-ansible-compat-3 = 3.0.2
Should I properly rename the old package? I'll have a look how that is done with other packages... Kind Regards, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
On Thu, May 11, 2023 at 11:06 AM Johannes Kastl <kastl@b1-systems.de> wrote:
Hi Andrei,
thanks for the quick reply.
On 11.05.23 at 09:57 Andrei Borzenkov wrote:
On Thu, May 11, 2023 at 10:54 AM Johannes Kastl <kastl@b1-systems.de> wrote:
python-ansible-compat is 4.0.2 python-ansible-compat-3 is 3.0.2
I assume you need %{ansible_python}-ansible-compat-3 because this is the package that has version 3.
The package content is the same as python-ansible-compat, just an older version. So the package name is "python-ansible-compat", not "...-3". Using "...-3" in the BuildRequires does not work.
nothing provides python3-ansible-compat-3 = 3.0.2
It really sounds like OBS only looks for the latest package version when checking build dependencies. Renaming the package may help with build, I am not sure about run-time dependencies though. What is the expected result at runtime? Can you install version 3 and version 4 in parallel?
Should I properly rename the old package? I'll have a look how that is done with other packages...
Kind Regards, Johannes
-- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de
B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
Hi Andrei, On 11.05.23 at 11:59 Andrei Borzenkov wrote:
It really sounds like OBS only looks for the latest package version when checking build dependencies.
Yes, indeed. I thought his was working with older versions of rubygem packages in the past.
What is the expected result at runtime? Can you install version 3 and version 4 in parallel?
No, you can't. But this should not matter to OBS during build? I am hoping that molecule will be adapted pretty soon to work with the newer version. So it is not that big of a problem, I can hold back the update for some time. I was more puzzled how to do that in general. Kind Regards, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
On 11.05.23 at 10:05 Johannes Kastl wrote:
Should I properly rename the old package? I'll have a look how that is done with other packages...
Callum was kind enough to prepare an SR to rename files inside the python-ansible-compat-3 package, rename the package itself in the spec and add Provides/Obsoletes, and after that it worked. So my guess would be that even though there were two packages in the repository (one with 3.0.2, one with 4.0.2), OBS ignored the former and only used the latter. Just as it would ignore any older versions of packages it finds in other repositories in the build target's setup. As a working hypothesis this is good enough. Thanks Callum! Have a nice weekend everyone. Kind Regards, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
participants (2)
-
Andrei Borzenkov
-
Johannes Kastl