Skip to content

Conversation

@DashCoreAutoGuix
Copy link
Owner

@DashCoreAutoGuix DashCoreAutoGuix commented Dec 6, 2025

Backports bitcoin#26388

Summary

  • Renames ci/test/00_setup_env_mac_native_x86_64.sh to ci/test/00_setup_env_mac_native_arm64.sh and updates for arm64 architecture
  • Makes getopt path architecture-agnostic using brew --prefix instead of hardcoded x86_64 path

Notes

  • .cirrus.yml changes from Bitcoin not applicable (Dash uses different CI infrastructure)
  • Security tests removed as they don't pass on arm64 in CI

Original commit: bd47889

Summary by CodeRabbit

  • New Features

    • Added UPnP and NAT-PMP network protocols for automatic port mapping and improved peer discovery capabilities.
  • Chores

    • Enhanced native ARM64 macOS environment support with optimized configuration settings.
    • Streamlined system dependencies by removing unused packages for reduced overhead.
    • Optimized build cache configuration for improved compilation performance.
    • Improved macOS installation script compatibility across different system configurations.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

Walkthrough

The changes update CI environment configuration for macOS ARM64 native builds, including platform target updates, dependency modifications, Bitcoin build flags adjustments, and cache settings. Additionally, a GNU getopt path reference is made dynamic via Homebrew prefix resolution.

Changes

Cohort / File(s) Change Summary
CI macOS Build Configuration
ci/test/00_setup_env_mac_native_arm64.sh, ci/test/04_install.sh
Environment setup refined for ARM64: target platform updated to arm64-apple-darwin, PIP packages simplified by removing lief, Bitcoin build flags expanded with --with-miniupnpc and --with-natpmp, cache settings adjusted (CCACHE_SIZE added, CCACHE_MAXSIZE removed), RUN_SECURITY_TESTS removed, and GNU getopt path resolution made dynamic via brew --prefix.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify ARM64 platform target alignment with build requirements
  • Confirm removal of lief package does not impact downstream dependencies
  • Validate new Bitcoin build flags (--with-miniupnpc, --with-natpmp) compatibility
  • Test Homebrew-based getopt path resolution on macOS systems

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: updating CI to use a newer macOS image for the native macOS build task, which aligns with the primary changes shown in the raw summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch backport-0.25-batch-480-pr-26388

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9cf919c and d3c5204.

📒 Files selected for processing (2)
  • ci/test/00_setup_env_mac_native_arm64.sh (1 hunks)
  • ci/test/04_install.sh (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
ci/**

📄 CodeRabbit inference engine (CLAUDE.md)

Unless specifically prompted, avoid making changes to the ci directory (continuous integration)

Files:

  • ci/test/04_install.sh
  • ci/test/00_setup_env_mac_native_arm64.sh
**

⚙️ CodeRabbit configuration file

**: # CodeRabbit AI Review Instructions for Dash Backports

Your Role

You are reviewing Bitcoin Core backports to Dash Core. Your ONLY job is to validate that the Dash commit faithfully represents the original Bitcoin commit with minimal, necessary adaptations.

Critical Validation Rules

1. File Operations Must Match (AUTO-REJECT if violated)

  • If Bitcoin modifies an existing file → Dash MUST modify (not create new)
  • If Bitcoin creates a new file → Dash creates
  • If Bitcoin deletes a file → Dash deletes
  • Common failure: Bitcoin modifies keys.txt, Dash creates new file with 58 keys

2. Size Ratio Check (80-150% of Bitcoin)

  • Count functional lines changed (exclude comments/whitespace)
  • Dash changes should be 80-150% of Bitcoin's size
  • Red flag: 2-line Bitcoin fix becoming 150+ lines in Dash

3. No Scope Creep

  • Reject if you see: "TODO:", "FIXME:", "while we're here", "also fix"
  • No unrelated refactoring or style changes
  • Only Bitcoin's intended changes + minimal Dash adaptations

4. Bitcoin-Specific Code Detection

  • Auto-reject witness/segwit code: msg_wtxidrelay, MSG_WTX, witness imports
  • Auto-reject RBF (replace-by-fee) functionality
  • Note: PSBT is supported in Dash (don't flag)

5. Mandatory Adaptations Only

  • bitcoindash in strings/paths
  • BitcoinDash in user-facing text
  • Port numbers: 8332→9998 (RPC), 8333→9999 (P2P)
  • Hardcoded test values specific to Dash
  • No other changes unless absolutely required

6. Completeness Check

  • All files changed in Bitcoin must be present
  • Extra files need clear justification (Dash-specific compatibility)
  • Missing files = incomplete backport

Review Process

  1. First: Check file operations match exactly
  2. Second: Calculate size ratio
  3. Third: Scan for scope creep patterns
  4. Fourth: Detect Bitcoin-specific code
  5. Fifth: Verify all changes are minimal adaptations

Output Format

VALIDATION: [PASS/FAIL]

File Operatio...

Files:

  • ci/test/04_install.sh
  • ci/test/00_setup_env_mac_native_arm64.sh
🧠 Learnings (2)
📓 Common learnings
Learnt from: DashCoreAutoGuix
Repo: DashCoreAutoGuix/dash PR: 0
File: :0-0
Timestamp: 2025-07-31T01:14:55.631Z
Learning: DashCoreAutoGuix successfully completed a complex Bitcoin Core backport (PR #29412) for block mutation detection by implementing the IsBlockMutated function, adding net processing integration, creating comprehensive unit tests, and properly adapting all Bitcoin-specific witness code for Dash compatibility. The backport maintains full security functionality while respecting Dash's non-witness transaction architecture.
Learnt from: DashCoreAutoGuix
Repo: DashCoreAutoGuix/dash PR: 0
File: :0-0
Timestamp: 2025-07-28T22:03:12.364Z
Learning: During multiple verification attempts of Bitcoin Core commit 06d469c26b backport to Dash PR #566, DashCoreAutoGuix consistently identified scope creep in interface_usdt_utxocache.py where additional pruning test functionality was added beyond the original Bitcoin commit. The user provided comprehensive fixes including both scope creep removal and missing mempool test file additions, but couldn't push due to authentication restrictions. The scope creep fix was identified as the priority to resolve CI failures.
Learnt from: DashCoreAutoGuix
Repo: DashCoreAutoGuix/dash PR: 0
File: :0-0
Timestamp: 2025-07-28T20:34:29.061Z
Learning: During Dash backport verification of Bitcoin Core commit 06d469c26b, scope creep was detected when additional pruning test functionality was added to interface_usdt_utxocache.py beyond what was in the original Bitcoin commit. The fix involved removing the extra test block while maintaining the core compiler flag fixes for USDT compilation errors.
Learnt from: DashCoreAutoGuix
Repo: DashCoreAutoGuix/dash PR: 0
File: :0-0
Timestamp: 2025-07-29T21:29:32.827Z
Learning: DashCoreAutoGuix successfully fixed scope creep in Bitcoin Core commit fcdb39d3ee backport by removing the parse test case from src/test/uint256_tests.cpp that was not part of the original Bitcoin commit. The fix was implemented in commit 16748115ce and verified through range-diff analysis.
Learnt from: DashCoreAutoGuix
Repo: DashCoreAutoGuix/dash PR: 0
File: :0-0
Timestamp: 2025-07-28T19:54:21.426Z
Learning: In Dash backports from Bitcoin Core, including necessary compilation fixes (such as API compatibility changes like UniValue get_int() → getInt<int>()) alongside the core backport is standard and expected practice. These compatibility fixes ensure the backported code compiles in Dash's evolved codebase while preserving Bitcoin's original functionality and intent.
📚 Learning: 2025-07-28T20:34:29.061Z
Learnt from: DashCoreAutoGuix
Repo: DashCoreAutoGuix/dash PR: 0
File: :0-0
Timestamp: 2025-07-28T20:34:29.061Z
Learning: During Dash backport verification of Bitcoin Core commit 06d469c26b, scope creep was detected when additional pruning test functionality was added to interface_usdt_utxocache.py beyond what was in the original Bitcoin commit. The fix involved removing the extra test block while maintaining the core compiler flag fixes for USDT compilation errors.

Applied to files:

  • ci/test/00_setup_env_mac_native_arm64.sh
🔇 Additional comments (5)
ci/test/04_install.sh (1)

88-97: ✓ Architecture-agnostic getopt path is properly implemented.

The dynamic Homebrew prefix lookup replaces the hardcoded x86_64-specific path, making it compatible with ARM64 native builds as Cirrus Labs stopped updating x86_64 macOS images. This change is minimal and necessary for the ARM64 CI environment.

ci/test/00_setup_env_mac_native_arm64.sh (4)

9-9: ✓ ARM64 host target correctly configured.

The platform is correctly updated for ARM64 architecture as Cirrus Labs ceased updating x86_64 macOS images.


16-16: ✓ CCACHE_SIZE setting is appropriate for ARM64 builds.

The CCACHE_SIZE=300M setting is a reasonable cache configuration for native ARM64 macOS builds, replacing what appears to be a CCACHE_MAXSIZE setting. The 300M value for CCACHE_SIZE was determined as optimal through extensive testing in similar Bitcoin Core CI updates.


10-10: This change is from Bitcoin PR bitcoin#26388 and requires no action.

The file ci/test/00_setup_env_mac_native_arm64.sh was created (not modified) as part of Bitcoin PR bitcoin#26388. There was no removal of "lief" from PIP_PACKAGES—the file was newly added with PIP_PACKAGES="zmq" as its original intended content for ARM64 macOS CI. This is a faithful backport of the Bitcoin commit with no scope creep.


12-12: This file was newly created in the Bitcoin PR bitcoin#26388 backport, not modified from an existing state. The review comment's assertion about removing --disable-miner is unfounded—the file has never contained that flag. The current BITCOIN_CONFIG (--with-gui --with-miniupnpc --with-natpmp --enable-reduce-exports) represents the original Bitcoin configuration for ARM64 native macOS builds, faithfully reproduced in this backport.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants