Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Adding specific tool/package versions to build

  1. #1
    Join Date
    Jul 2022
    Posts
    6

    Default Adding specific tool/package versions to build

    A project I'm trying to build has Fedora Rawhide (added by clicking "Add from a distribution") as target.
    I need python3 <= 3.10 to build source but get "unresolvable" error message (nothing provides python3 < 3.11 got 3.11.0..).
    How can I add for example python3.10 to the build environment?

  2. #2
    Join Date
    Sep 2012
    Posts
    8,243

    Default Re: Adding specific tool/package versions to build

    There is only one RPM with the name python3 - which is the version 3.11. There are RPMs python3.10 etc.

  3. #3
    Join Date
    Jul 2022
    Posts
    6

    Default Re: Adding specific tool/package versions to build

    ok, understand.
    Is it possible to blacklist python3.11 from being installed or perhaps set python3 to use 3.10? (from .spec-file or other obs-file)?
    Now I seem to get both 3.10 and 3.11 if I interpret the log correct. Closer to where I think I want to be.

  4. #4

    Default Re: Adding specific tool/package versions to build

    Should be possible to define it in your spec file:

    Requires: python3 = 3.10

    But it seems like that Fedora Rawhide only has python3-3.11.0 in the repos...

  5. #5
    Join Date
    Jul 2022
    Posts
    6

    Default Re: Adding specific tool/package versions to build

    Ok, is it somehow possible to use use 'sudo update-alternatives ...' in the %prep-phase?
    Right now I get sudo: a password is required



  6. #6
    Join Date
    Jul 2022
    Posts
    6

    Default Re: Adding specific tool/package versions to build

    sudo since running w/o result in
    failed to create /var/lib/alternatives/python3.new: Permission denied


  7. #7
    Join Date
    Sep 2012
    Posts
    8,243

    Default Re: Adding specific tool/package versions to build

    Quote Originally Posted by mgp View Post
    Now I seem to get both 3.10 and 3.11 if I interpret the log correct.
    And why exactly is it bad?
    Is it possible to blacklist python3.11 from being installed or perhaps set python3 to use 3.10? (from .spec-file or other obs-file)?
    This question should be directed to Fedora lists/forums, not here. OBS is just a tool to automate package building. It can do only what target distribution supports. If Fedora offers some settings to switch between Python versions, they can then be integrated in OBS.

    But I doubt very much it is possible. It most certainly would not be possible in openSUSE. While multiple Python versions are available in distribution, at any given point there is one version that is default system version, that provides /usr/bin/python3 link and that is implicit dependency of any other Python based tool built in this distribution. As far as I know RedHat traditionally used a lot Python-based tools which means default Python is pulled in.
    Closer to where I think I want to be.
    As you did not describe what you are trying to achieve, it is rather hard to give any advice.

    But let's assume you somehow managed to fake /usr/bin/python3 to be version 3.10 and built package for Fedora. This package won't work on any real system because on all real systems out there /usr/bin/python3 will be version 3.11 and presumably your software fails to work with this version. If your software absolutely needs Python 3.10 (or any lower version) then you must build your software to explicitly use Python 3.10 and require python3.10 package.

  8. #8
    Join Date
    Sep 2012
    Posts
    8,243

    Default Re: Adding specific tool/package versions to build

    Quote Originally Posted by hui View Post
    Should be possible to define it in your spec file:

    Requires: python3 = 3.10
    "Should be" as in "I do not know and I did not even look what Fedora RPM provides but it sounds like easy question"?

  9. #9

    Default Re: Adding specific tool/package versions to build

    Quote Originally Posted by arvidjaar View Post
    "Should be" as in "I do not know and I did not even look what Fedora RPM provides but it sounds like easy question"?
    If you believe so...
    True i'm not 100% sure how Fedora specs look like but in most distributions you define a specific version with "requires = x.xx.


    Any other smart-ass comments that don't contribute to the topic?

  10. #10
    Join Date
    Sep 2012
    Posts
    8,243

    Default Re: Adding specific tool/package versions to build

    Quote Originally Posted by arvidjaar View Post
    This question should be directed to Fedora lists/forums, not here.
    Reading https://docs.fedoraproject.org/en-US...elines/Python/, that is probably not possible:
    Code:
    In Fedora, Python libraries are packaged for a single version of Python, called python3. For example, in Fedora 32, python3 is Python 3.8.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •