Skip to content

Conversation

@kwvg
Copy link
Collaborator

@kwvg kwvg commented Nov 9, 2024

Motivation

This PR is a spiritual continuation of dash#5375 to help catch issues like the ones resolved in dash#5064 during CI.

Additional Information

  • Earlier iterations of this PR built GCC 14 as the toolchain PPA wouldn't go higher than GCC 12 for jammy (source) (GCC 13 if we were willing to use the test branch, source) and we ruled out upgrading our base image to noble (which does offer GCC 14 even without a PPA, source) so we could test against the lowest supported LTS.

    • Unfortunately, staying on jammy was no longer tenable as we require at least GCC 11.1 (since dash#6389) but jammy shipped GCC 10.3 for the Windows cross-compiler (source) and this proved to be a blocker for backports. See dash#6564 for more information.
  • Since we've upgraded to noble now, we not only can use GCC 14 (the latest major version of GCC as of this writing), we can also use older versions and GCC 11.4 is readily available on noble (source), which can help us test for unexpected regressions on the lowest supported version and versions likely to be used by rolling release distros.

Breaking Changes

None expected.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas (note: N/A)
  • I have added or updated relevant unit/integration/functional/e2e tests (note: N/A)
  • I have made corresponding changes to the documentation (note: N/A)
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@kwvg kwvg added this to the 22 milestone Nov 9, 2024
@kwvg kwvg force-pushed the gcc_and_friends branch 2 times, most recently from 29101ef to 62d4636 Compare November 10, 2024 10:11
@kwvg
Copy link
Collaborator Author

kwvg commented Nov 10, 2024

@github-actions
Copy link

This pull request has conflicts, please rebase.

@kwvg kwvg changed the title ci: build more recent GCC and compile with it, bump Clang to 18, stage built packages in /opt, fix LLDB personality issue ci: build GCC 14, build nowallet depends and source with it, stage built packages in /opt, allowlist LLVM libc++ Nov 21, 2024
@kwvg
Copy link
Collaborator Author

kwvg commented Nov 21, 2024

@github-actions
Copy link

This pull request has conflicts, please rebase.

@kwvg kwvg mentioned this pull request Dec 15, 2024
5 tasks
PastaPastaPasta added a commit that referenced this pull request Dec 17, 2024
04ce1fe ci: deduplicate macOS SDK setup logic (Kittywhiskers Van Gogh)
8dd0db7 ci: fix "LC_ALL: cannot change locale (en_US.UTF-8)" in Guix container (Kittywhiskers Van Gogh)
187fe17 ci: don't stage packages in `/tmp`, reduce layers for `cppcheck` build (Kittywhiskers Van Gogh)
eef8635 ci: install `i386` packages only if host is `amd64`, merge layers (Kittywhiskers Van Gogh)
e770229 ci: purge package manager cache after each interaction (Kittywhiskers Van Gogh)
b7099ee ci: remove redundant `version` attribute, avoid `lldb` personality error (Kittywhiskers Van Gogh)
64cdc42 ci: add LLVM library path to `LD_LIBRARY_PATH` and GDB allowlist (Kittywhiskers Van Gogh)
440fd3f ci: drop distro LLVM packages, move Clang install up, set defaults (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * This pull request pulls container-specific changes from [dash#6387](#6387), [dash#6400](#6400) and [dash#6421](#6421)

  * The `HOST` check before running `setup_sdk.sh` isn't a part of the script itself as the script is written to be independent of external variables set. The caller is expected to know the conditions needed to run `setup_sdk.sh` as the script is _relatively_ agnostic to its environment.

  * The `version` attribute in the [`develop`](https://github.com/dashpay/dash/blob/a8e2316d6f9c6726a498bcae2c5c5d7354769511/contrib/containers/develop/docker-compose.yml) and [`guix`](https://github.com/dashpay/dash/blob/a8e2316d6f9c6726a498bcae2c5c5d7354769511/contrib/containers/guix/docker-compose.yml) container's `docker-compose.yml` has been dropped as the attribute has been deprecated in the compose spec ([source](https://github.com/compose-spec/compose-spec/blob/65ef9f4a5d713b405a77c45c64263f2543e65267/spec.md#version-top-level-element-obsolete)).

  * Using `LD_LIBRARY_PATH` to point to LLVM's libraries are acceptable and will not interfere with executing binaries built using the distro's packaged compiler as it will eventually search default paths and find the libraries shipped with the distro ([source](https://man7.org/linux/man-pages/man8/ld.so.8.html)).

  * Currently, running LLDB will result in a "personality set failed: Operation not permitted" error ([source](https://discourse.llvm.org/t/running-lldb-in-a-container/76801)). This is caused by its attempt at disabling ASLR for debugging.

    To work around this error, the container will now operate under relaxed restrictions (`seccomp=unconfined`). As disabling ASLR is valuable when debugging and the container is meant for developers (i.e. it isn't used for CI), we have opted to relax restrictions instead of skipping ASLR disablement.

  * As of `develop` (a8e2316), packages built by the container are stored in `/tmp`, which is inadvisable as it is the same directory used to store functional test runs and it's not too difficult to delete `/tmp`'s contents to save space in a long running [`develop`](https://github.com/dashpay/dash/blob/a8e2316d6f9c6726a498bcae2c5c5d7354769511/contrib/containers/develop/docker-compose.yml) container and then realize that both `shellcheck` and `cppcheck` are stored there and now you have to ditch the container you're working in and restart it.
    * To remedy this, packages are now built and stored in `/opt` in accordance with the FHS ([source](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s13.html)). `/usr/local` was a contender but it's pre-populated, meanwhile `ls /opt` would give you a very quick picture of what's built for the container.

    * `/tmp` will not be entirely empty because [pypa/pip#10753](pypa/pip#10753) results in residual `.pem` files leaking into `/tmp` and `pyenv` stores its build log there and keeping it around has some debug value.

  ## Breaking Changes

  None expected.

  ## Checklist:

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
  - [x] I have made corresponding changes to the documentation **(note: N/A)**
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    ACK 04ce1fe
  PastaPastaPasta:
    utACK 04ce1fe

Tree-SHA512: 5442ae06cb73b9bc4eec908803548195ae8fd9150422789e5f98578ad01a303b5361f9ba42fe8faee27ac91e38328b7771e4ba42b296dfa70ecbbfc7d10436b6
@kwvg kwvg modified the milestones: 22.1, 22 Jan 14, 2025
@kwvg kwvg added this to the 23 milestone Jan 14, 2025
@kwvg kwvg changed the title ci: build GCC 14, build nowallet depends and source with it, stage built packages in /opt, allowlist LLVM libc++ ci: use GCC 14 for building nowallet source and depends, GCC 11 for building sqlite source Feb 18, 2025
@kwvg kwvg marked this pull request as ready for review February 18, 2025 15:00
@kwvg
Copy link
Collaborator Author

kwvg commented Feb 18, 2025

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2025

Walkthrough

This pull request introduces explicit compiler specifications to various build configuration scripts and updates the Docker container setup. In the ci/test/00_setup_env_native_nowallet.sh script, the DEP_OPTS and BITCOIN_CONFIG environment variables are modified to include directives for using GCC version 14 compilers. Similarly, the ci/test/00_setup_env_native_sqlite.sh script updates its BITCOIN_CONFIG variable to specify the use of GCC version 11 compilers. Additionally, the Dockerfile located in contrib/containers/ci/ is updated to install the g++-11 and g++-14 packages, thereby providing the necessary compiler versions. These changes ensure that specific compiler versions are used during the build processes across different environments.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e9105e and 7089045.

📒 Files selected for processing (3)
  • ci/test/00_setup_env_native_nowallet.sh (1 hunks)
  • ci/test/00_setup_env_native_sqlite.sh (1 hunks)
  • contrib/containers/ci/Dockerfile (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: check_merge
  • GitHub Check: linux64_fuzz-build / Build source
  • GitHub Check: linux64_sqlite-build / Build source
  • GitHub Check: x86_64-pc-linux-gnu_nowallet / Build depends
  • GitHub Check: x86_64-pc-linux-gnu_multiprocess / Build depends
🔇 Additional comments (3)
ci/test/00_setup_env_native_nowallet.sh (1)

12-14: Enforce GCC 14 via environment variables.
The updates to DEP_OPTS and BITCOIN_CONFIG now explicitly include CC=gcc-14 and CXX=g++-14, ensuring that the nowallet builds use GCC 14 as intended by the PR objectives.

ci/test/00_setup_env_native_sqlite.sh (1)

13-13: Specify GCC 11 for SQLite builds.
The modification of BITCOIN_CONFIG with CC=gcc-11 and CXX=g++-11 ensures that the SQLite source builds use the appropriate GCC version per the PR requirements.

contrib/containers/ci/Dockerfile (1)

174-175: Add g++-11 and g++-14 to Docker image.
The addition of g++-11 and g++-14 in the package installation step ensures that both required compiler versions are available in the Docker environment. This change cohesively supports the modifications made in the test setup scripts for nowallet and sqlite builds.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 7089045; will run my own CI and confirm functionality

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 7089045

@PastaPastaPasta PastaPastaPasta merged commit e500191 into dashpay:develop Feb 20, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants