CI: Bump CI Lint base image from bionic to jammy #26572

pull robigan wants to merge 17 commits into bitcoin:master from robigan:ci-bump changing 24 files +562 −512
  1. robigan commented at 10:55 AM on November 25, 2022: none

    As the title says, this PR aims to address #26548 by switching the lint CI job from ubuntu's bionic base image which has python 3.6.5 to ubuntu jammy and use pyenv to install the correct python version as dictated in the project's .python-version file.

    I have tested this in a VS Code Dev Container to as closely emulate the Cirrus CI Service

  2. Bump lint task base image from bionic to jammy
    Bumps the base image used in the linting task for the cirrus CI service to use jammy instead of bionic
    3e0f0c5a15
  3. Prepare install lint script for usage with pyenv e4bddd1b98
  4. DrahtBot commented at 10:55 AM on November 25, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #25797 (build: Add CMake-based build system by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  5. DrahtBot added the label Tests on Nov 25, 2022
  6. in ci/lint/04_install.sh:13 in d62c12a46a outdated
      16 | -  ${CI_RETRY_EXE} apt-get install -y --reinstall git
      17 | -)
      18 | +${CI_RETRY_EXE} apt-get install -y curl git gawk jq
      19 | +${CI_RETRY_EXE} apt-get install -y make build-essential libssl-dev zlib1g-dev \
      20 | +libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
      21 | +libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
    


    maflcko commented at 10:58 AM on November 25, 2022:

    Why is all of this needed? Is pyenv compiling itself and then the python version?


    robigan commented at 11:02 AM on November 25, 2022:

    Yes just noticed, gonna inspect this rq to see why this happens. As for the deps, pyenv requires this according to the docs


    robigan commented at 11:03 AM on November 25, 2022:

    Pyenv seems to exit prematurely and somehow I stupidly didn't pick this up.


    maflcko commented at 11:13 AM on November 25, 2022:

    Ah interesting. I wonder if this even works then. Initially, I tried using https://launchpad.net/%7Edeadsnakes/+archive/ubuntu/ppa , however it notes " for jammy, older python versions requre libssl<3 so they are not currently built".


    robigan commented at 11:34 AM on November 25, 2022:

    In my dev container, it does indeed build the python version without issue. I of course used the ubuntu:jammy image


    robigan commented at 11:45 AM on November 25, 2022:

    Why is all of this needed? Is pyenv compiling itself and then the python version?

    If this was Github Actions I would have cached the build of Python 3.6.15, but I don't think Cirrus supports this

  7. maflcko commented at 11:00 AM on November 25, 2022: member

    looks like the CI is aborting green with empty output?

    https://cirrus-ci.com/task/6096893982277632?logs=lint#L1575

  8. robigan commented at 11:29 AM on November 25, 2022: none

    @MarcoFalke I have addressed the issues in the new commit, and now it follows through with the rest of the testing. Except that the test scripts in the repo seem to error out with git (See attached) <img width="1074" alt="image" src="https://user-images.githubusercontent.com/35210888/203976009-19ec849e-209e-40de-9783-4f264d8968e4.png"> I am not going to try to address this issue as it's got to do with the linting scripts themselves which are interacting with Git, and Git throwing an issue. And given that I haven't touched any of that I'll leave it be unless I am missing something which in that case I'll try to remedy the issue that this change causes

  9. maflcko commented at 11:59 AM on November 25, 2022: member

    Looks like it does OOM

  10. robigan commented at 12:44 PM on November 25, 2022: none

    Just took a look at Deadsnake's PPA. They claim they don't build Python 3.6.15 because it's already built by ubuntu's repos. Yet the files list contains a tar ball for python 3.6.15 for focal fossa release. I'd say it's possible to untar the tar ball into pyenv's version if it all works smoothly. As for ssl, I am not sure, how come does the test ci job use jammy despite the repo's python version being set to python 3.6.15?

  11. maflcko commented at 12:51 PM on November 25, 2022: member

    I'd guess that maybe python 3.6 supports building on Jammy by now? You may be able to fix the OOM by bumping the memory or by using clang. Though, I think we'll also want to cache the python binary, otherwise too much time is spent on compiling it for every push.

  12. robigan commented at 3:50 PM on November 25, 2022: none

    I'd guess that maybe python 3.6 supports building on Jammy by now? You may be able to fix the OOM by bumping the memory or by using clang. Though, I think we'll also want to cache the python binary, otherwise too much time is spent on compiling it for every push.

    Python 3.6.15 with pyenv definitely compiles (at least for me which was in a dev container which is pretty close to a real ubuntu jammy based machine). The issue is caching the builds. I'll try bump the memory and see if that works, I don't think using Clang is possible as it doesn't seem that pyenv supports it, and using a custom script to download python and compile it requires maintenance that I can't assure. Using pyenv makes maintaining way easier and simple.

  13. robigan commented at 5:34 PM on November 25, 2022: none

    I have discovered that it is indeed possible to cache builds. I have added more commits that try to implement this as automagically as possible

  14. robigan commented at 5:51 PM on November 25, 2022: none

    @MarcoFalke The fixes have been implemented. I just don't understand why lint fails despite saying that no issues were found

    Edit: I didn't realize it was shell check erroring out. Gonna try to fix this

  15. robigan commented at 7:18 PM on November 25, 2022: none

    It actually works. Finally. @MarcoFalke Sorry for the excessive amount of pings, but feel free to merge this. Lmk if any squashing is necessary

  16. hebasto commented at 9:14 PM on November 25, 2022: member

    Lmk if any squashing is necessary

    Yes, it is necessary.

  17. robigan force-pushed on Nov 25, 2022
  18. Use pyenv and switch to python 3.6.5
    - Install build environment dependencies for pyenv (https://github.com/pyenv/pyenv#install-python-build-dependencies)
    - Curl https://pyenv.run installer and pipe it to bash
    - Add pyenv's bin directory to path
    - Run pyenv's init script (https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv)s
    - Use pyenv's CLI to install python 3.6.15
    - Use python cache in Cirrus
    - Use intermediary directory for interacting with Cirrus's caching functions
    - Assign more resources to the cirrus task to compile python 3.6.15
    8357d1e281
  19. Comply with test casess c32c7e9db8
  20. doc: add tr() descriptor example to deriveaddresses
    add a tr() descriptor example to the help deriveaddresses examples
    af531a17f0
  21. fuzz: Move-only net utils 2909e4a5cc
  22. guix: bump recommended hash for manual installation
    Tracks time-machine bump in 298389e3b51edf561a2b636df0948a232167693a.
    ae8ae7f496
  23. guix: recommend mounting a tmpfs on /tmp
    This was already suggested in the troubleshooting section, but recommending it upfront would prevent the issue in the first place and speed up builds.
    cf0f4fcda7
  24. guix: add guile-gnutls and guile-json to install list
    They are mentioned in the figure above, but having them in the table makes it easier to (apt) install everything required.
    1a1ee55456
  25. guix: reminder to migrate guix-daemon-original customization 5adfef737e
  26. guix: OpenSSL test failure workaround
    Co-Authored-By: Stephan Oeste <emzy@emzy.de>
    2d0800e7f0
  27. doc: move Guix uninstall instructions to INSTALL.md
    Also drop unused links.
    a8c3396ccf
  28. guix: Drop no longer used `prepend_to_search_env_var()`
    It was introduced in c1ae726a13ecfa5e7e9fdc3030a8110b8bb263f8, and it
    has no longer been used since 1dd8cbfbc6318308b5e75023568f818ef6a9c7e4.
    4e6594b2e2
  29. guix: Drop non-existent directories ab74ef0b6a
  30. script: Improve `test-{security,symbol}-check.py` robustness
    This change allows to use the `test-{security,symbol}-check.py` scripts
    when building out of source tree with no need to link scripts into the
    build directory.
    4d92597b56
  31. build: Drop unneeded linking of `contrib/devtools/` scripts
    Th build system targets run those scripts from the top source directory.
    37b72d8f7d
  32. Address shellcheck
    This:
    - Removes previously created env variables
    - Adds echo for the copy to cache process
    - Uses cp instead of any mv just to be safe
    - Removes any comments that are not relevant
    86e9e0e76c
  33. robigan force-pushed on Nov 25, 2022
  34. robigan commented at 11:24 PM on November 25, 2022: none

    Lmk if any squashing is necessary

    Yes, it is necessary.

    Now that I have done a destructive action, I start to believe that I can't have squashed those commits in the first place...

  35. robigan commented at 7:52 AM on November 26, 2022: none

    Now that I've slept on it, I think it might convene me to just generate a patch file for the files I have modified, and open up a new PR. As I forgot merging instead of rebasing does this kind of stuff. I'll wait for further comment from you guys

  36. robigan commented at 8:19 AM on November 26, 2022: none

    Yea no I'll do that

  37. robigan closed this on Nov 26, 2022

  38. robigan deleted the branch on Nov 26, 2022
  39. bitcoin locked this on Nov 26, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-15 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me