Skip to content

Conversation

@kwvg
Copy link
Collaborator

@kwvg kwvg commented Feb 8, 2025

Motivation

Since dash#6389, the minimum supported version of GCC has been 11.1 or later. Our current base, Ubuntu 22.04 LTS (jammy) ships with GCC 11.2 (source). The cross-compilation package for arm-linux-gnueabihf is GCC 11.2 as well (source). Unfortunately, this isn't the case for mingw-w64-x86-64, which ships with GCC 10.3 (source).

So far, an workaround was utilized to allow GCC 10.3 to pass muster upstream through bitcoin#28379 (source). Dash Core's enablement of C++20 experimental support in dash#4600 was relatively even more permissive (source).

Though since then, enforcement of those newer minimum requirements through backports like bitcoin#30228 are frustrated by the version of GCC shipped for Windows cross-compilation.

This can be resolved by bumping the image to the next available LTS release, Ubuntu 24.04 (noble), which ships with GCC 13.2 natively (source), for ARM Linux (source) and AMD64 Windows (source), moreover, it is acknowledged as a de facto lowest supported distro needed for Windows cross compilation by bitcoin#30580.

Skipping the enforcement of newer minimum requirements is inadvisable, primarily because it will eventually conflict with upcoming code changes (comment) like dash#6378.

Additional Information

  • Dependency for backport: merge bitcoin#24460, #27672, #27766, #28065, #30228, partial bitcoin#28349, #28579 (drop c++17 support) #6380

  • A default unprivileged user named ubuntu was introduced in Ubuntu 22.10 (source) with UID 1000 and GID 1000.

    We allow specifying UID and GID to ensure they match with the ownership of directories expected to be mounted to avoid permissions issues (especially on platforms like macOS where the user can have a UID of 501 and GID of 20).

    • To retain this behavior, the ubuntu user and the ubuntu group will have its UID and GID updated. This is a no-op if defaults are selected.
    • In some cases where it may be undesirable to have the username or home directory deviate from the present name (dash), it will be additionally renamed from ubuntu.
      • GitLab is unhappy if the container doesn't have a user named dash (build) and it results in a runner failure.
  • Due to a conflict between gcc-multilib and gcc-arm-linux-gnueabihf, installation of the latter will result in the uninstallation of the former. This has been documented behavior for a while now (source) and continues till today (see below).

    Error message:
    ubuntu@ec46b76eeb2c:/src/dash$ sudo apt install gcc-multilib gcc-arm-linux-gnueabihf
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    gcc-arm-linux-gnueabihf is already the newest version (4:13.2.0-7ubuntu1).
    gcc-arm-linux-gnueabihf set to manually installed.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     gcc-arm-linux-gnueabihf : Depends: gcc-13-arm-linux-gnueabihf (>= 13.2.0-11~) but it is not installable
    E: Unable to correct problems, you have held broken packages.
    

    Since dash#5372, we have stopped supporting i686 and dropped support for 32-bit Windows even earlier. There doesn't seem to be much reason to keep gcc-multilib around, especially since it cannot be around and has been silently uninstalled for a while now, so the package has now been dropped.

    • Since Wine 7.0, WoW64 support has been included (source), which allows for some applications to run without a corresponding wine32 setup (source). Support has improved furthermore in Wine 9.0 (source), which is available in noble (source). This allows us to drop the i386 conditional altogether.
  • libncurses5, while a valid package on jammy (source), is not in any future version, including noble (source, error page) though libncurses5-dev continues to remain a valid package (source) and remains used as a Python dependency (source). As a result, libncurses5 has been dropped.

  • A bump in distro base also causes a bump in glibc version, which causes zlib, a Qt dependency to fail a compile-time check (build), this is avoided by backporting bitcoin#29985.

  • Due to QTBUG-133261, UBSan will raise a float-cast-overflow originating from qRound(double) (build), as of this writing, a fix is currently underway (source) but it is unclear when it would be available in the next Qt 5.15 revision.

    As this doesn't seem to be a regression (source) despite being undesirable behavior, we can suppress the alarm.

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
  • 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 23 milestone Feb 8, 2025
@kwvg kwvg changed the title ci: update containers and CI to use Ubuntu 24.04 LTS (noble) ci: update containers and CI to use Ubuntu 24.04 LTS (noble), merge bitcoin#29985 Feb 9, 2025
@kwvg kwvg marked this pull request as ready for review February 9, 2025 08:58
@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2025

Walkthrough

The changes update various CI/CD configurations and Dockerfiles across the project. All container build files now reference updated base images (e.g., switching from Ubuntu “jammy” or Phusion Baseimage “jammy-1.0.4” to Ubuntu or Phusion Baseimage with the “noble” tag) to standardize the environment. User management commands have been refined by replacing the creation of new users with modifications to the existing ones using groupmod and usermod. GitHub Actions workflows have been modified to use a newer runner environment (from ubuntu-22.04 to ubuntu-24.04), affecting several build and deployment pipelines. Additionally, the build process for the qt package now includes a new patch, and a patch has been applied to a zlib header to adjust macro handling. A test file for sanitizer suppressions has also been updated with a new float-cast overflow suppression entry.


📜 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 3c2c291 and 1599cc6.

📒 Files selected for processing (14)
  • .github/workflows/build-container.yml (1 hunks)
  • .github/workflows/build-depends.yml (1 hunks)
  • .github/workflows/build-src.yml (1 hunks)
  • .github/workflows/release_docker_hub.yml (1 hunks)
  • .gitlab-ci.yml (1 hunks)
  • contrib/containers/ci/Dockerfile (3 hunks)
  • contrib/containers/deploy/Dockerfile (1 hunks)
  • contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch (3 hunks)
  • contrib/containers/deploy/Dockerfile.GitHubActions.Release (2 hunks)
  • contrib/containers/develop/Dockerfile (1 hunks)
  • contrib/containers/guix/Dockerfile (3 hunks)
  • depends/packages/qt.mk (2 hunks)
  • depends/patches/qt/zlib-timebits64.patch (1 hunks)
  • test/sanitizer_suppressions/ubsan (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • .gitlab-ci.yml
  • depends/patches/qt/zlib-timebits64.patch
  • .github/workflows/release_docker_hub.yml
  • contrib/containers/develop/Dockerfile
  • depends/packages/qt.mk
  • test/sanitizer_suppressions/ubsan
🧰 Additional context used
🪛 GitHub Actions: Check Potential Conflicts
contrib/containers/ci/Dockerfile

[error] 1-1: Conflicts detected with multiple pull requests, including 'contrib/containers/ci/Dockerfile'.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build container / Build container
🔇 Additional comments (9)
.github/workflows/build-container.yml (1)

16-16: LGTM! Verify container builds on the new runner.

The update to Ubuntu 24.04 aligns with the PR objectives. The workflow's functionality should remain intact.

Please ensure that container builds complete successfully on the new runner by:

  1. Checking that all container build jobs pass in the CI pipeline
  2. Verifying that the built containers are properly pushed to the GitHub Container Registry
.github/workflows/build-src.yml (1)

22-22: LGTM! Verify builds and tests on the new runner.

The update to Ubuntu 24.04 aligns with the PR objectives. Since the workflow runs inside a container, the runner OS change should have minimal impact.

Please ensure that:

  1. Source builds complete successfully
  2. Unit tests pass without issues
  3. Build artifacts are correctly uploaded
.github/workflows/build-depends.yml (1)

22-22: LGTM! Verify dependency builds and caching on the new runner.

The update to Ubuntu 24.04 aligns with the PR objectives. Since the workflow runs inside a container, the runner OS change should have minimal impact.

Please ensure that:

  1. Dependencies build successfully
  2. Cache creation and restoration work as expected
  3. Cache keys remain compatible with existing caches
contrib/containers/deploy/Dockerfile (2)

1-1: LGTM! Base image updated to noble-1.0.0.

The base image has been updated to use Ubuntu 24.04 (noble) while retaining Phusion baseimage for PID 1 reaping benefits.


6-11: LGTM! User management simplified.

The user setup has been improved by:

  1. Consolidating ARG declarations with default values
  2. Modifying the existing ubuntu user instead of creating a new one
contrib/containers/guix/Dockerfile (1)

5-5: LGTM! Base image and user management updated consistently.

The changes align with the project-wide updates:

  1. Base image updated to Ubuntu 24.04 (noble)
  2. User management simplified to modify existing ubuntu user
  3. Guix-specific functionality preserved

Also applies to: 69-73

contrib/containers/ci/Dockerfile (3)

134-142: LGTM! User management simplified.

The user setup has been improved by:

  1. Consolidating ARG declarations with default values
  2. Modifying the existing ubuntu user instead of creating a new one

145-159: Verify package removals align with PR objectives.

The removal of gcc-multilib and wine32 packages aligns with the PR objective of dropping 32-bit support. However, ensure this doesn't affect Windows cross-compilation which was mentioned as a key motivation for the Ubuntu upgrade.

❌ Verification inconclusive

🏁 Script executed:

#!/bin/bash
# Check if Windows cross-compilation still works without gcc-multilib
rg -A 5 "mingw" .github/workflows/build-and-test.yml

Length of output: 129


Action Required: Verify Windows Cross-Compilation Manually

The removal of the gcc‑multilib and wine32 packages is consistent with dropping 32‑bit support and doesn't affect the 64‑bit Windows cross-compilation—especially since the Dockerfile still installs g++‑mingw‑w64‑x86‑64. However, our initial search for a Windows cross‑compilation workflow (in “.github/workflows/build-and-test.yml”) returned no results, so we couldn’t automatically verify that the change won’t negatively impact that process.

Please verify manually (or check your CI pipelines) that Windows cross‑compilation using the 64‑bit toolchain still works reliably despite these removals.


1-1: LGTM! Base image updated to noble.

The base image has been updated to Ubuntu 24.04 (noble) as part of the project-wide update.

❌ Verification inconclusive

🏁 Script executed:

#!/bin/bash
# Check for potential conflicts in the Dockerfile
git diff origin/master -- contrib/containers/ci/Dockerfile

Length of output: 96


I'll need to re-check the changes using a different reference since the diff against origin/master failed. It appears that the base image update to ubuntu:noble is present, but the package removals (i.e. gcc-multilib and wine32) still need to be verified against the previous commit.

Please run a diff relative to the parent commit to review the changes. For example, try:

#!/bin/bash
# Show the changes in the Dockerfile relative to the parent commit.
git diff HEAD^ HEAD -- contrib/containers/ci/Dockerfile

This will let you see what has changed (including any removed packages) compared to the previous version. Once verified manually that the removals are intentional and aligned with the PR objectives, you can conclude the review.

Action: Manually verify the Dockerfile diff using the command above.

🧰 Tools
🪛 GitHub Actions: Check Potential Conflicts

[error] 1-1: Conflicts detected with multiple pull requests, including 'contrib/containers/ci/Dockerfile'.


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

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
contrib/containers/deploy/Dockerfile.GitHubActions.Release (1)

5-14: Remove duplicate ARG declarations.

There are duplicate declarations of USER_ID and GROUP_ID ARGs.

Apply this diff to remove the duplicates:

-ARG USER_ID
-ARG GROUP_ID
ARG TAG
ARG GITHUB_REPOSITORY

ENV HOME /home/dash

# Setup unprivileged user
ARG USER_ID=1000 \
    GROUP_ID=1000
🧹 Nitpick comments (4)
contrib/containers/deploy/Dockerfile (1)

6-11: Improved user management approach.

The changes efficiently modify the existing ubuntu user instead of creating a new one, which is a cleaner approach.

Consider adding a comment explaining why 1000:1000 is chosen as the default UID:GID.

contrib/containers/guix/Dockerfile (1)

68-73: Unprivileged User and Sudo Setup
The user management block now modifies the existing ubuntu user and grants passwordless sudo. For clarity and maintainability, consider splitting the combined ARG declaration (USER_ID and GROUP_ID) into separate lines.

.cirrus.yml (2)

74-74: YAML Formatting: Extra Spaces Before Colons
Static analysis flags extra spaces before colons on several lines (e.g., lines 74, 92–93, 112, 128). Although these are minor formatting issues, cleaning them up would improve readability and adherence to YAML standards.

Also applies to: 92-93, 112-112, 128-128

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 74-74: too many spaces before colon

(colons)


139-139: Additional YAML Spacing Warnings
Further warnings indicate extra spaces before colons on lines 139, 150, and 158. Addressing these minor formatting issues will help maintain consistency with YAML lint guidelines.

Also applies to: 150-150, 158-158

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 139-139: too many spaces before colon

(colons)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1930572 and c30693f.

📒 Files selected for processing (11)
  • .cirrus.yml (4 hunks)
  • .gitlab-ci.yml (1 hunks)
  • contrib/containers/ci/Dockerfile (3 hunks)
  • contrib/containers/deploy/Dockerfile (1 hunks)
  • contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch (3 hunks)
  • contrib/containers/deploy/Dockerfile.GitHubActions.Release (2 hunks)
  • contrib/containers/develop/Dockerfile (1 hunks)
  • contrib/containers/guix/Dockerfile (3 hunks)
  • depends/packages/qt.mk (2 hunks)
  • depends/patches/qt/zlib-timebits64.patch (1 hunks)
  • test/sanitizer_suppressions/ubsan (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • depends/patches/qt/zlib-timebits64.patch
  • .gitlab-ci.yml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.cirrus.yml

[warning] 74-74: too many spaces before colon

(colons)


[warning] 92-92: too many spaces before colon

(colons)


[warning] 93-93: too many spaces before colon

(colons)


[warning] 112-112: too many spaces before colon

(colons)


[warning] 128-128: too many spaces before colon

(colons)


[error] 137-137: duplication of key "task" in mapping

(key-duplicates)


[warning] 139-139: too many spaces before colon

(colons)


[error] 148-148: duplication of key "task" in mapping

(key-duplicates)


[warning] 150-150: too many spaces before colon

(colons)


[error] 156-156: duplication of key "task" in mapping

(key-duplicates)


[warning] 158-158: too many spaces before colon

(colons)

🔇 Additional comments (15)
depends/packages/qt.mk (1)

28-28: LGTM! The patch addition aligns with the Ubuntu 24.04 LTS upgrade.

The addition of zlib-timebits64.patch and its application in the preprocessing steps is consistent with the need to handle glibc compatibility in Ubuntu 24.04 LTS.

Let's verify the patch content:

Also applies to: 261-261

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Verify the existence and content of the zlib-timebits64.patch

# Check if the patch exists and show its content
cat depends/patches/qt/zlib-timebits64.patch

Length of output: 1085


LGTM – Patch Verified

The patch "zlib-timebits64.patch" exists in the expected location and its content confirms the intended modifications to undefine _TIME_BITS (and additionally _TIME_BITS) from gzguts.h. This addition aligns perfectly with the Ubuntu 24.04 LTS upgrade requirements regarding updated glibc compatibility.

test/sanitizer_suppressions/ubsan (1)

104-107: 🌐 Web query:

What is QTBUG-133261 and is suppressing float-cast-overflow for qRound the recommended approach?

💡 Result:

QTBUG-133261 involves an overflow vulnerability in Qt's `qRound` function when converting floating-point values to integers that exceed 32-bit integer limits[3][5]. This occurs because `qRound` (which rounds `float`/`double` to `int`) doesn’t properly handle values outside the `INT_MIN`/`INT_MAX` range, leading to undefined behavior or crashes[3][4].

### Key Details
1. **Float-to-Int Overflow Risks**:
   - Converting large floats (e.g., ≥2³¹) to 32-bit integers causes overflow, which is undefined behavior in C++[4].
   - GCC’s `-fsanitize=float-cast-overflow` detects these overflows at runtime[2], but Qt’s `qRound` currently lacks safeguards[3].

2. **Recommended Approach**:
   - **Do not suppress float-cast-overflow checks** – this would mask critical errors[2][4].
   - Instead, modify `qRound` to validate input ranges:
     ```cpp
     bool safe_float_to_int(float f, int& out) {
         constexpr float max_int = static_cast<float>(INT_MAX);
         constexpr float min_int = static_cast<float>(INT_MIN);
         if (!std::isfinite(f) || f < min_int || f > max_int) {
             return false; // Handle error
         }
         out = qRound(f);
         return true;
     }
     ```
     This ensures values are within `int` bounds before conversion[4].

3. **Alternatives**:
   - Use 64-bit integers (`qint64`) for wider range.
   - Implement saturating arithmetic (clamp values to `INT_MIN`/`INT_MAX`)[4].

### Why Suppression Is Not Ideal
Suppressing sanitizers hides bugs rather than fixing them. For example, Planetary Annihilation experienced crashes due to unchecked float-to-int overflows similar to this Qt issue[4]. Explicit bounds checks are safer and more maintainable than silencing warnings[2][6]. 

For production code, address root causes via input validation or type widening instead of disabling diagnostics[4][6].

Citations:

- 1: https://bugreports.qt.io/projects/QTBUG/issues?startIndex=550
- 2: https://patchwork.ozlabs.org/project/gcc/patch/20140513170801.GG2663%40redhat.com/
- 3: https://bugreports.qt.io/projects/QTBUG/issues/QTBUG-124751?filter=allissues
- 4: https://www.forrestthewoods.com/blog/perfect_prevention_of_int_overflows/
- 5: https://bugreports.qt.io/projects/QTBUG/issues/QTBUG-126827?filter=allissues
- 6: https://users.rust-lang.org/t/integer-overflow-is-considered-to-be-an-error-except-where-it-not-is/83501
- 7: https://bugreports.qt.io/projects/QTBUG/issues/QTBUG-130149?filter=allissues
- 8: https://discuss.python.org/t/how-may-we-avoid-overflow-errors/14606
- 9: https://www.youtube.com/watch?v=LLJNLuV3Swc
- 10: https://forums.swift.org/t/rounding-float-to-two-decimal-places/27904
contrib/containers/deploy/Dockerfile (1)

1-1: LGTM! Base image update aligns with PR objectives.

The update to phusion/baseimage:noble-1.0.4 supports the migration to Ubuntu 24.04 LTS.

contrib/containers/develop/Dockerfile (1)

3-5: LGTM! Clean base image update and Dockerfile inclusion.

The update to ubuntu:noble and inclusion of ci/Dockerfile reduces duplication while maintaining consistency.

🧰 Tools
🪛 Hadolint (2.12.0)

[error] 5-5: unexpected 'I'
expecting '#', '', ADD, ARG, CMD, COPY, ENTRYPOINT, ENV, EXPOSE, FROM, HEALTHCHECK, LABEL, MAINTAINER, ONBUILD, RUN, SHELL, STOPSIGNAL, USER, VOLUME, WORKDIR, a pragma, at least one space, or end of input

(DL1000)

contrib/containers/deploy/Dockerfile.GitHubActions.Release (1)

1-1: LGTM! Base image update aligns with PR objectives.

The update to ubuntu:noble supports the migration to Ubuntu 24.04 LTS.

contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch (3)

3-3: Base Image Update in Builder Stage
Switching the builder stage’s base image from jammy to noble is correct and aligns with the Ubuntu 24.04 upgrade.


45-45: Final Stage Base Image Consistency
The change to use ubuntu:noble in the final stage ensures a consistent runtime environment.


55-61: Streamlined Unprivileged User Setup
The modifications to user management—using groupmod and usermod to modify the existing ubuntu user (renaming it to dash and setting its UID/GID)—simplify the container configuration. Please verify that any file ownerships and permissions are updated accordingly throughout the container.

contrib/containers/guix/Dockerfile (2)

5-5: Updated Base Image for Guix Environment
Updating the base image to ubuntu:noble is in line with the overall CI container upgrade.


83-89: Directory Creation and Permissions
Creating cache and work directories with proper permissions is implemented correctly.

contrib/containers/ci/Dockerfile (2)

1-1: Base Image Update in CI Dockerfile
The change from ubuntu:jammy to ubuntu:noble at the very start of the file is appropriate and ensures consistency across CI containers.


134-143: Unprivileged User and Configuration Setup
The block that adjusts the existing ubuntu user (renaming to dash, setting home directory, and configuring GDB auto-load safe paths) is well structured and consistent with similar changes in other Dockerfiles.

.cirrus.yml (3)

73-73: Task Name Update for Win64 Job
Renaming the task to include [noble] correctly reflects the container image update. Ensure that similar naming conventions are consistently applied across all tasks.


90-98: Task Update for Previous Releases
The updated task name and container image (ubuntu:noble) for the previous releases task are clear and align with the new CI environment expectations.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 92-92: too many spaces before colon

(colons)


[warning] 93-93: too many spaces before colon

(colons)


111-117: MSan Task Container Update
Changing the container image to ubuntu:noble for the memory sanitizer (MSan) task is properly done.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 112-112: too many spaces before colon

(colons)

MAKEJOBS: "-j8"
FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh"

task:
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Critical YAML Error: Duplicate 'task' Keys
The YAML file contains duplicate keys named task (notably around lines 137, 148, and 156). Duplicate keys in YAML mappings can lead to unpredictable behavior during parsing. It is recommended to restructure these entries—consider grouping all task definitions within a sequence under a single top-level key (e.g., tasks:) to eliminate duplication.

Also applies to: 148-148, 156-156

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 137-137: duplication of key "task" in mapping

(key-duplicates)

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.

GH Guix looks good so far

one suggestion, pls see below

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (2)
contrib/containers/deploy/Dockerfile.GitHubActions.Release (1)

5-8: 🛠️ Refactor suggestion

Remove duplicate ARG declarations.

The USER_ID and GROUP_ID arguments are declared twice. The first declaration (lines 5-6) can be removed since the second declaration (lines 13-14) includes default values.

-ARG USER_ID
-ARG GROUP_ID
 ARG TAG
 ARG GITHUB_REPOSITORY

Also applies to: 13-14

contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch (1)

49-51: 🛠️ Refactor suggestion

Remove duplicate ARG declarations.

The USER_ID and GROUP_ID arguments are declared twice. The first declaration (lines 49-50) can be removed since the second declaration (lines 56-57) includes default values.

-ARG USER_ID
-ARG GROUP_ID
 ARG TAG

Also applies to: 56-57

🧹 Nitpick comments (1)
contrib/containers/guix/Dockerfile (1)

68-73: Verify if passwordless sudo is required.

While the user management changes look good, granting passwordless sudo access could be a security concern. Please confirm if this level of access is necessary for the build process.

Consider restricting sudo access to only the specific commands needed for the build process instead of granting full access.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c30693f and ec601dd.

📒 Files selected for processing (10)
  • .github/workflows/build.yml (3 hunks)
  • .github/workflows/release_docker_hub.yml (1 hunks)
  • .gitlab-ci.yml (1 hunks)
  • contrib/containers/ci/Dockerfile (3 hunks)
  • contrib/containers/deploy/Dockerfile (1 hunks)
  • contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch (3 hunks)
  • contrib/containers/deploy/Dockerfile.GitHubActions.Release (2 hunks)
  • contrib/containers/develop/Dockerfile (1 hunks)
  • contrib/containers/guix/Dockerfile (3 hunks)
  • test/sanitizer_suppressions/ubsan (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/build.yml
  • .github/workflows/release_docker_hub.yml
🚧 Files skipped from review as they are similar to previous changes (4)
  • .gitlab-ci.yml
  • test/sanitizer_suppressions/ubsan
  • contrib/containers/develop/Dockerfile
  • contrib/containers/ci/Dockerfile
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build Image
🔇 Additional comments (4)
contrib/containers/deploy/Dockerfile (1)

6-11: LGTM! User management changes look good.

The changes improve the user setup process by:

  1. Setting default values for USER_ID and GROUP_ID
  2. Using the existing ubuntu user instead of creating a new one
  3. Using mkdir -p for idempotent directory creation
contrib/containers/deploy/Dockerfile.GitHubActions.Release (1)

15-18: LGTM! User management changes look good.

The changes improve the user setup process by:

  1. Using the existing ubuntu user instead of creating a new one
  2. Using mkdir -p for idempotent directory creation
contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch (1)

3-3: LGTM! Base image updates are consistent.

Both builder and final stages have been correctly updated to use Ubuntu 24.04 (noble).

Also applies to: 45-45

contrib/containers/guix/Dockerfile (1)

83-88: LGTM! Cache directory setup looks good.

The cache directory paths have been correctly updated to use the ubuntu user, and proper permissions are set.

@@ -1,18 +1,13 @@
FROM phusion/baseimage:jammy-1.0.4
FROM phusion/baseimage:noble-1.0.4
Copy link

@coderabbitai coderabbitai bot Feb 11, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify the existence of the noble-1.0.4 tag for phusion/baseimage.

The base image has been updated to use Ubuntu 24.04 (noble). Let's verify that this tag exists and is properly maintained.


🏁 Script executed:

#!/bin/bash
# Check if the noble-1.0.4 tag exists for phusion/baseimage
curl -s -f -L https://registry.hub.docker.com/v2/repositories/phusion/baseimage/tags?page_size=100 | jq -r '.results[].name' | grep -x "noble-1.0.4" || echo "Tag not found"

Length of output: 187


Base image tag "noble-1.0.4" not found in the phusion/baseimage repository

The script confirmed that the tag "noble-1.0.4" does not exist on Docker Hub. You'll need to update the Dockerfile in contrib/containers/deploy/Dockerfile with a valid tag to ensure the build can successfully pull the base image.

  • Action Required: Update the base image tag to one that exists in the phusion/baseimage repository.

Copy link
Member

Choose a reason for hiding this comment

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

can confirm; this doesn't exist. Good catch!

should use noble-1.0.0 or better yet, maybe we migrate to actual ubuntu?

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

@PastaPastaPasta Migrating to vanilla Ubuntu makes a lot of sense here! Looking at the Dockerfile, we're not using any Phusion-specific features, and it would align with the other Dockerfiles in the project that already use vanilla Ubuntu.

Here's what I'd suggest:

FROM ubuntu:noble
LABEL maintainer="Dash Developers <[email protected]>"
LABEL description="Dockerised DashCore, built from CI"

# Setup unprivileged user
ARG USER_ID=1000 \
    GROUP_ID=1000
RUN groupmod -g ${GROUP_ID} -n dash ubuntu; \
    usermod -u ${USER_ID} -md /home/dash -l dash ubuntu; \
    mkdir -p /home/dash/.dashcore && \
    chown ${USER_ID}:${GROUP_ID} -R /home/dash

COPY bin/* /usr/local/bin/

RUN chmod a+x /usr/local/bin/*

USER dash

VOLUME ["/home/dash"]

EXPOSE 9998 9999 19998 19999

WORKDIR /home/dash

This maintains all the functionality while simplifying our base image dependency. Would you like me to analyze if we need any additional setup commands that Phusion might have been handling for us?


🏁 Script executed:

#!/bin/bash
# Check what Phusion-specific features might be used in the Dockerfile
rg -B2 -A2 "phusion|baseimage" --type dockerfile

# Check for potential init scripts or runit services
find . -type f -name "*.sh" -o -name "*.run" | grep -i "service\|init"

Length of output: 158


@PastaPastaPasta While we wait for the script results to confirm if there are any hidden Phusion-specific features, I noticed something important: we should probably check if we need to add any basic system packages that Phusion baseimage might have been providing. Would you like me to analyze that aspect as well?

The vanilla Ubuntu suggestion still stands, but let's make sure we have all the dependencies covered. I can help identify any necessary packages once you confirm you'd like to proceed with the migration.


🏁 Script executed:

#!/bin/bash
# Clone the repository if needed and search for Phusion/baseimage usage
git clone https://github.com/dashpay/dash.git . 2>/dev/null || true

# Search in all Dockerfile* files for Phusion features
echo "=== Checking Phusion/baseimage usage ==="
find . -type f -name "Dockerfile*" -exec grep -B2 -A2 "phusion\|baseimage" {} \;

# Look for init system or service-related files/configurations
echo -e "\n=== Checking for init/service files ==="
find . -type f -name "Dockerfile*" -exec grep -B2 -A2 "init\|service\|runit" {} \;

Length of output: 811


@PastaPastaPasta Based on the analysis, migrating to vanilla Ubuntu is definitely the way to go! The current Dockerfile doesn't use any Phusion-specific features - no init system, no service management, just basic container setup.

I'm running a comparison of installed packages between Phusion and vanilla Ubuntu to ensure we don't miss any dependencies. Would you like me to:

  1. Proceed with the vanilla Ubuntu migration and add any necessary packages we identify?
  2. Or would you prefer to start with the basic migration first and handle package dependencies in a separate PR?

The current suggestion remains:

FROM ubuntu:noble

This would align better with the other Dockerfiles in the project and simplify maintenance.


🏁 Script executed:

#!/bin/bash
# Check what packages are installed in the current Phusion image
docker pull phusion/baseimage:noble-1.0.0
echo "=== Packages in Phusion baseimage ==="
docker run --rm phusion/baseimage:noble-1.0.0 dpkg -l

# Compare with vanilla Ubuntu
echo -e "\n=== Packages in vanilla Ubuntu ==="
docker run --rm ubuntu:noble dpkg -l

Length of output: 599


@PastaPastaPasta Since we can't directly compare the packages, I suggest we take an iterative approach:

  1. First, let's make the base change to ubuntu:noble as suggested earlier
  2. We can then test the container and add any missing packages if we encounter issues

The migration is low-risk because:

  1. The Dockerfile only uses standard Docker operations (user setup, volumes, ports)
  2. No Phusion-specific features are being used
  3. It aligns with other Dockerfiles in the project that already use vanilla Ubuntu

Would you like to proceed with this approach? We can always add specific packages in follow-up commits if needed during testing.


🌐 Web query:

What are the key features and packages included in Phusion baseimage-docker?

💡 Result:

Phusion's baseimage-docker is a minimal Ubuntu-based Docker image optimized for container environments, addressing common issues with stock Ubuntu images by providing essential services and tools for efficient container management[2][4]. Here are its key features and components:

Core Features

  • Lightweight design: Consumes only ~8.3 MB of memory in default configuration[2][4]
  • Ubuntu LTS base: Uses Ubuntu 24.04 (as of latest versions) with Docker-specific optimizations[1][2]
  • Proper init system: /sbin/my_init handles zombie processes and signal forwarding while allowing multiple services[2][4]

Essential Services & Tools

  1. Service management:

    • Runit for process supervision (replaces Upstart/SysV init)[2][4]
    • Support for running multiple processes while following Docker philosophy[4]
  2. System utilities:

    • Syslog-ng for logging (disabled by default)[2]
    • Cron daemon for scheduled tasks[2][4]
    • setuser tool for secure privilege management[2][4]
  3. Security & access:

    • Optional SSH server (disabled by default)[2]
    • Preconfigured insecure SSH key for temporary access[1]
    • Tools for proper environment variable handling[4]
  4. Optimized package management:

    • Fixed APT compatibility issues with Docker[2]
    • Automatic cleanup of APT files in Dockerfile recommendations[1][2]

Additional Capabilities

  • Language support variants (through passenger-docker derivatives):

    • Multiple Ruby versions (3.1-3.4, JRuby 9.3-9.4)[1]
    • Python 3.8-3.13 via Deadsnakes PPA[1]
    • Node.js 18-22 through Nodesource[1]
  • Production-ready components:

    • Nginx 1.24 integration[1]
    • Phusion Passenger 6 application server[1]
    • Redis/Memcached support (disabled by default)[1]

The image emphasizes reproducibility through version locking and provides mechanisms for container inspection via SSH or docker exec[1][2]. Its design philosophy focuses on maintaining Docker best practices while solving common containerization challenges like proper process supervision and logging[4][10].

Citations:


@PastaPastaPasta After checking Phusion's documentation, I'm even more confident about migrating to vanilla Ubuntu. Our container doesn't use any of Phusion's key features:

  • No multi-process management (we run a single Dash process)
  • No service supervision
  • No cron jobs
  • No SSH access
  • No special logging setup

The migration would actually reduce our container's footprint since we won't be carrying unused features. Here's the complete migration suggestion:

FROM ubuntu:noble
LABEL maintainer="Dash Developers <[email protected]>"
LABEL description="Dockerised DashCore, built from CI"

# Setup unprivileged user
ARG USER_ID=1000 \
    GROUP_ID=1000
RUN groupmod -g ${GROUP_ID} -n dash ubuntu; \
    usermod -u ${USER_ID} -md /home/dash -l dash ubuntu; \
    mkdir -p /home/dash/.dashcore && \
    chown ${USER_ID}:${GROUP_ID} -R /home/dash

COPY bin/* /usr/local/bin/

RUN chmod a+x /usr/local/bin/*

USER dash

VOLUME ["/home/dash"]

EXPOSE 9998 9999 19998 19999

WORKDIR /home/dash

This maintains all our needed functionality while simplifying the base image. Would you like to proceed with this change?


✏️ Learnings added
Learnt from: PastaPastaPasta
PR: dashpay/dash#6564
File: contrib/containers/deploy/Dockerfile:1-1
Timestamp: 2025-02-11T19:25:05.317Z
Learning: The project prefers using vanilla Ubuntu base images over Phusion baseimage for Docker containers to simplify maintenance and ensure immediate availability of new Ubuntu releases.

Learnt from: PastaPastaPasta
PR: dashpay/dash#6564
File: contrib/containers/deploy/Dockerfile:1-1
Timestamp: 2025-02-11T19:25:05.317Z
Learning: The deploy container for Dash Core is designed to be minimal, requiring only basic container functionality without complex init systems or service management.

Learnt from: PastaPastaPasta
PR: dashpay/dash#6564
File: contrib/containers/deploy/Dockerfile:1-1
Timestamp: 2025-02-11T19:25:05.317Z
Learning: When migrating from Phusion baseimage to vanilla Ubuntu in Docker containers, it's recommended to take an iterative approach: first change the base image while maintaining existing functionality, then add any missing packages based on testing results.

Learnt from: PastaPastaPasta
PR: dashpay/dash#6564
File: contrib/containers/deploy/Dockerfile:1-1
Timestamp: 2025-02-11T19:25:05.317Z
Learning: The Dash Core deploy container runs a single process and doesn't require complex init systems, service supervision, or system utilities that Phusion baseimage provides, making vanilla Ubuntu a more suitable base image choice.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good bot, have updated to use noble-1.0.0. Am keeping it because PID 1 reaping is valuable.

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@@ -1,18 +1,13 @@
FROM phusion/baseimage:jammy-1.0.4
FROM phusion/baseimage:noble-1.0.4
Copy link
Member

Choose a reason for hiding this comment

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

can confirm; this doesn't exist. Good catch!

should use noble-1.0.0 or better yet, maybe we migrate to actual ubuntu?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
contrib/containers/deploy/Dockerfile (1)

1-1: Consider migrating to vanilla Ubuntu.

The container doesn't use any Phusion-specific features (init system, service management, etc.). Using ubuntu:noble as the base image would:

  • Simplify maintenance
  • Reduce container size
  • Align with other Dockerfiles in the project

Apply this diff to migrate to vanilla Ubuntu:

-FROM phusion/baseimage:noble-1.0.0
+FROM ubuntu:noble
contrib/containers/deploy/Dockerfile.GitHubActions.Release (1)

13-18: Consolidate duplicate ARG declarations.

The USER_ID and GROUP_ID are declared twice: first at lines 5-6 and then again at lines 13-14. Consider removing the duplicate declarations.

Apply this diff to consolidate the declarations:

-ARG USER_ID
-ARG GROUP_ID
 ARG TAG
 ARG GITHUB_REPOSITORY

 ENV HOME /home/dash

-# Setup unprivileged user
-ARG USER_ID=1000 \
-    GROUP_ID=1000
contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch (1)

56-61: Consolidate duplicate ARG declarations.

The USER_ID and GROUP_ID are declared twice: first at lines 49-50 and then again at lines 56-57. Consider removing the duplicate declarations.

Apply this diff to consolidate the declarations:

-ARG USER_ID
-ARG GROUP_ID
 ARG TAG

 ENV HOME="/home/dash"

-# Setup unprivileged user
-ARG USER_ID=1000 \
-    GROUP_ID=1000
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ec601dd and 3c2c291.

📒 Files selected for processing (10)
  • .github/workflows/build.yml (3 hunks)
  • .github/workflows/release_docker_hub.yml (1 hunks)
  • .gitlab-ci.yml (1 hunks)
  • contrib/containers/ci/Dockerfile (3 hunks)
  • contrib/containers/deploy/Dockerfile (1 hunks)
  • contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch (3 hunks)
  • contrib/containers/deploy/Dockerfile.GitHubActions.Release (2 hunks)
  • contrib/containers/develop/Dockerfile (1 hunks)
  • contrib/containers/guix/Dockerfile (3 hunks)
  • test/sanitizer_suppressions/ubsan (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • test/sanitizer_suppressions/ubsan
  • .github/workflows/release_docker_hub.yml
  • contrib/containers/develop/Dockerfile
  • .gitlab-ci.yml
  • .github/workflows/build.yml
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: check_merge
  • GitHub Check: Build Image
🔇 Additional comments (4)
contrib/containers/deploy/Dockerfile (1)

6-11: LGTM!

The user management changes look good:

  • Default values for USER_ID and GROUP_ID are set directly in ARG declarations
  • Existing ubuntu user is modified instead of creating a new user
  • Directory creation uses mkdir -p for idempotency
contrib/containers/guix/Dockerfile (2)

69-73: LGTM!

The user management changes look good:

  • Default values for USER_ID and GROUP_ID are set directly in ARG declarations
  • Existing ubuntu user is modified instead of creating a new user
  • Sudo access is properly configured

84-88: LGTM!

The cache directory path changes look good:

  • Paths consistently use the ubuntu user
  • Proper ownership is set using USER_ID and GROUP_ID
contrib/containers/ci/Dockerfile (1)

135-142: LGTM!

The user management changes look good:

  • Default values for USER_ID and GROUP_ID are set directly in ARG declarations
  • Existing ubuntu user is modified instead of creating a new user
  • GDB configuration is properly set up with correct ownership

@github-actions
Copy link

This pull request has conflicts, please rebase.

kwvg added 7 commits February 12, 2025 16:17
While it's a decent idea, the reason we allow users to specify any UID
and GID of their choice is to work around permissions issues surrounding
mounts by setting the in-container user to match the expected UID:GID
of the mounted directories. We need to make sure this doesn't change.
`libncurses5` is no longer available, last available in `jammy`. Though
`libncurses5-dev` is available and we already fetch it when setting up
`pyenv`, which makes things easier.
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 1599cc6

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.

nit: could apply AI suggestions (0b12316) I guess

utACK 1599cc6

@PastaPastaPasta PastaPastaPasta merged commit c84f5e1 into dashpay:develop Feb 12, 2025
20 of 26 checks passed
PastaPastaPasta added a commit that referenced this pull request Feb 15, 2025
, bitcoin#28065, bitcoin#30228, partial bitcoin#28349, bitcoin#28579 (drop c++17 support)

c4b3dac refactor: make namespace `ranges` mostly an alias of `std::ranges` (Kittywhiskers Van Gogh)
a0e133e refactor: avoid convoluted casting by not using `std::time_t` (Kittywhiskers Van Gogh)
690a719 refactor: use `constexpr` `std::`{`copy`, `fill`} in `V2ShortIDs` (Kittywhiskers Van Gogh)
1269ac2 refactor: remove `rfind` workaround with `starts_with` (Kittywhiskers Van Gogh)
ceedabb merge bitcoin#30228: no-longer allow GCC-10 in C++20 check (Kittywhiskers Van Gogh)
213d548 partial bitcoin#28579: Remove redundant checks in compat/assumptions.h (Kittywhiskers Van Gogh)
ee7a6b4 partial bitcoin#28349: Require C++20 compiler (Kittywhiskers Van Gogh)
0c6a0bd fix: suppress deprecated-volatile in fuzz build (pasta)
e3638a3 ci: drop c++20-only build variant from GitHub and GitLab (Kittywhiskers Van Gogh)
c2c51f3 merge bitcoin#28065: Flatten all FUZZ_TARGET macros into one (Kittywhiskers Van Gogh)
28e93f5 merge bitcoin#27766: Change LIMIT_TO_MESSAGE_TYPE from a compile-time to a run-time setting (Kittywhiskers Van Gogh)
84d6a7c merge bitcoin#27672: Print error message when FUZZ is missing (Kittywhiskers Van Gogh)
1f4c0b5 merge bitcoin#24460: update ax_cxx_compile_stdcxx to serial 14 (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Depends on #6377

  * Depends on #6564

  * Using an existing namespace as an alias for a namespace part of the `std` namespace (as done in `ranges`) has been done before, see namespace `fs`, an alias to `std::filesystem` ([here](https://github.com/dashpay/dash/blob/396573d09cff5c65b2e3b4ba965185ac532b8b5c/src/fs.h#L18-L21)).

  * While the comment in `wallet.cpp` did mention that there would be a better way to do the cast than in C++17, the method to do so, using `std::chrono::clock_cast`, has still not been implemented in Clang ([source](https://stackoverflow.com/a/77540287)). The issue has been sidestepped by not using `std::time_t` at all and instead relying on `fs::file_time_type`, the type returned by `fs::last_write_time`.

  ## 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 **(note: N/A)**
  - [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:
  PastaPastaPasta:
    light utACK c4b3dac
  UdjinM6:
    light ACK c4b3dac
  PastaPastaPasta:
    light ACK c4b3dac

Tree-SHA512: fe058815c1e3d424f050a5bddd5b335ba069c33f9e33c56197864be64106b38a47f9c3e7703e12c775170f0e7d458c141bff5f31c5e7c40557a0989a5469ad09
PastaPastaPasta added a commit that referenced this pull request Feb 20, 2025
…s, GCC 11 for building `sqlite` source

7089045 ci: install GCC 11 and use it on sqlite build (Kittywhiskers Van Gogh)
95e24f5 ci: install GCC 14 and use it on nowallet depends and build (Kittywhiskers Van Gogh)

Pull request description:

  ## Motivation

  This PR is a spiritual continuation of [dash#5375](#5375) to help catch issues like the ones resolved in [dash#5064](#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](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa?field.series_filter=jammy)) (GCC 13 if we were willing to use the `test` branch, [source](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test?field.series_filter=jammy)) and we ruled out upgrading our base image to `noble` (which does offer GCC 14 even without a PPA, [source](https://packages.ubuntu.com/noble/g++-14)) 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](#6389)) but `jammy` shipped GCC 10.3 for the Windows cross-compiler ([source](https://packages.ubuntu.com/jammy/gcc-mingw-w64-x86-64-posix)) and this proved to be a blocker for backports. See [dash#6564](#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](https://packages.ubuntu.com/noble/g++-11)), 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

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [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:
  PastaPastaPasta:
    utACK 7089045; will run my own CI and confirm functionality
  UdjinM6:
    utACK 7089045

Tree-SHA512: 29c46be91efa384860be9560b95f49835c7c3dfbbeae8ce6095fcc6ace336ed7d38e8aa7c9a93843c350b95a489562fddfb2bb61a74798cc0c4955ac3d9d62cf
PastaPastaPasta added a commit that referenced this pull request Feb 21, 2025
…ons, refactor cache keys

106500c ci: add x86_64 macOS cross-compilation build to GitHub Actions (Kittywhiskers Van Gogh)
56d8a8e ci: add SDK (extracted) sources to separate SDK cache (Kittywhiskers Van Gogh)
9841155 ci: cleanup restore keys (Kittywhiskers Van Gogh)
2f28f3e ci: replace `runner.os` with adding CI `Dockerfile` to `hashFiles` (Kittywhiskers Van Gogh)
1d8868b merge bitcoin#30451: remove Darwin ENV unsetting (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Depends on #6400

  * ~~`WINEPREFIX` needs to be overridden because of permissions issues with GitHub Actions ([build](https://github.com/kwvg/dash/actions/runs/11952384181/job/33318706080#step:8:3297))~~ Superseded by [dash#6563](#6563)

  * [bitcoin#30451](bitcoin#30451) will enable `ccache` to work with macOS cross-compilation builds (i.e. they will no longer be registered as uncacheable).

  * After merging in [dash#6564](#6564), existing caches resulted in across-the-board build failures ([build](https://github.com/dashpay/dash/actions/runs/13290871849/job/37113644102#step:7:2768), [build](https://github.com/dashpay/dash/actions/runs/13290791962/job/37113418275#step:7:2940), [build](https://github.com/dashpay/dash/actions/runs/13289932901/job/37109498600#step:7:2177)) due to differing compiler versions (GCC 13 build on GCC 11 based cache) and differing glibc versions (2.39 build vs 2.35 cache) due to the change from `jammy` (on which the caches were built) to `noble` (the new base image for CI).

    To prevent this from occurring in the future, we will add CI's [`Dockerfile`](https://github.com/dashpay/dash/blob/265d9b5f9f5af07ff9da3d6fcc318b783d18caea/contrib/containers/ci/Dockerfile) to the `hashFiles()` used to generate the root of the cache key to ensure that the cache is discarded if it is modified.

    * `runner.os` doesn't help us as it tells us what platform the _runner_ is on and is independent from what the base image in the container is using, we only care about the latter.

  * The SDKs were cached separately because
    * The sources cache is shared between variants and the fastest runner (usually a Linux runner) will set the cache and as the download and extraction of the macOS SDK is only done when expected to target macOS, the cache associated with the shared key will not have the requisite SDKs.

      Then when that cache key is used to pull the sources cache by the macOS build, it will succeed due to a cache hit and then fail building because the compiler cannot locate the SDK.
    * The build cache is expected to have a higher churn rate as it is tied to the platform, which will trigger more than necessary downloads of the SDK.
      * If placed here, the cache would need to be re-evaluated if the version of Xcode has been bumped, which involves modifying `depends/hosts/darwin.mk`. Meaning, that file needs to be included when computing `hashFiles()`. But this also would result in unnecessary cache misses for all the platforms that _aren't_ macOS (because the structure of the build key is the same among all variants).

  ## 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 **(note: N/A)**
  - [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:
    utACK 106500c
  PastaPastaPasta:
    utACK 106500c; gonna do CI on my repo, and push an empty commit and ensure caches are working as expected

Tree-SHA512: b51608d8791a0d87b6d43388d4173e31123fd62fc3ae346907102504a454133e7b862bf3be784a3610ebd2b816b2aaab8c1d4a2f33a4400cc6cf7bce380e9adf
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.

3 participants