Skip to content

Conversation

@DashCoreAutoGuix
Copy link
Owner

@DashCoreAutoGuix DashCoreAutoGuix commented Aug 8, 2025

Backports bitcoin#29249

Original commit: 0375244

Backported from Bitcoin Core v0.27


Note

Include NM in depends build-id hashing by adding NM output to depends/gen_id and passing NM from depends/Makefile.

  • Depends tooling:
    • depends/gen_id: Add NM to the hashed preimage (prints ${NM} --version and NM_ env), update usage docs.
    • depends/Makefile: Pass NM for both build and host toolsets into gen_id when computing build_id and $(host_arch)_$(host_os)_id.

Written by Cursor Bugbot for commit e912491. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Chores
    • Enhanced build and host identifiers to include the symbol tool (NM) for improved traceability.
    • Expanded tooling introspection to report the symbol tool version and related NM environment variables during ID generation.
    • Ensured environment propagation for ID generation consistently includes NM metadata in both build and host contexts.

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

6ec2813 depends: add NM output to gen_id (fanquake)

Pull request description:

  `NM` is part of the current toolset, and can be set by the user. Include it in `gen_id`.

ACKs for top commit:
  TheCharlatan:
    Re-ACK 6ec2813

Tree-SHA512: 2ada61e03783f9eb441f285ef5da50557ad729cb52ce2d2c4b2c38103dab29920a26262d4545fd2ac7fbf1cedc4902cd2359833544fbc0debf829c12a63e9769
@coderabbitai
Copy link

coderabbitai bot commented Aug 8, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Makefile now passes NM into gen_id for both build and host id generation; gen_id was extended to report NM (version, NM_ env vars, BEGIN/END NM) alongside existing tool introspection.

Changes

Cohort / File(s) Summary of changes
Build/host id env updates
depends/Makefile
Adds NM into gen_id environment invocations: sets NM='$(build_NM)' for build_id and NM='$(host_NM)' for host id; AR usage unchanged.
gen_id NM support
depends/gen_id
Adds NM to the usage/header and runtime introspection: prints NM --version, lists NM_ environment variables, and emits BEGIN/END NM markers analogous to AR/RANLIB blocks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review depends/Makefile lines where gen_id is invoked to ensure quoting/spacing of the added NM='...' matches existing environment tokens.
  • Verify depends/gen_id additions follow the same output format as AR/RANLIB and do not alter preimage computation ordering.

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 clearly and specifically describes the main change: adding NM output to gen_id in the depends build system, which matches the changeset modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch backport-0.27-batch-724-pr-29249

📜 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 e912491 and 1c397b8.

📒 Files selected for processing (1)
  • depends/Makefile (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
depends/**

📄 CodeRabbit inference engine (CLAUDE.md)

Unless specifically prompted, avoid making changes to the depends directory (dependency build system)

Files:

  • depends/Makefile
**

⚙️ 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:

  • depends/Makefile
🧠 Learnings (2)
📓 Common learnings
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-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-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.
Learnt from: DashCoreAutoGuix
Repo: DashCoreAutoGuix/dash PR: 0
File: :0-0
Timestamp: 2025-07-29T17:13:35.087Z
Learning: When backporting Bitcoin Core commits that use Python's textwrap.dedent() function in test files, the textwrap import statement needs to be explicitly added if it's missing in the Dash test file.
Learnt from: DashCoreAutoGuix
Repo: DashCoreAutoGuix/dash PR: 0
File: :0-0
Timestamp: 2025-07-27T22:35:10.176Z
Learning: In Dash backports, src/dashbls files are vendored dependencies that should not be modified during Bitcoin Core backports unless there is specific justification. Unauthorized modifications to vendored dependencies should be removed to maintain code integrity.
📚 Learning: 2025-07-28T23:09:09.522Z
Learnt from: CR
Repo: DashCoreAutoGuix/dash PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T23:09:09.522Z
Learning: Applies to guix-build* : Do not make changes under any circumstances to build system files in guix-build*

Applied to files:

  • depends/Makefile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: x86_64-apple-darwin / Build depends
  • GitHub Check: x86_64-w64-mingw32 / Build depends
  • GitHub Check: x86_64-pc-linux-gnu_nowallet / Build depends
  • GitHub Check: x86_64-pc-linux-gnu / Build depends
  • GitHub Check: arm-linux-gnueabihf / Build depends
🔇 Additional comments (1)
depends/Makefile (1)

150-151: NM environment variable implementation correctly added to build system.

Both depends/Makefile and depends/gen_id were properly modified. The Makefile changes (lines 150-151) correctly pass NM='$(build_NM)' and NM='$(host_NM)' to the gen_id invocations with proper quoting. The gen_id script includes dedicated "BEGIN NM" / "END NM" sections to capture the NM toolchain version and environment variables, matching the pattern used for AR, RANLIB, and STRIP. This is a faithful, minimal backport with no scope creep or unrelated changes.


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.

@DashCoreAutoGuix
Copy link
Owner Author

✅ Backport Verification Successful

No issues found! This backport is complete and faithful to the original Bitcoin change.

Original Bitcoin commit: 03752444cd5
Backport PR: #1068
Reviewed commit hash: e4981fd345a-verify-1754631765

Verification Details:

  • File operations match Bitcoin's intent
  • No missing changes detected
  • No scope creep or dependency explosions
  • CI checks passing (0 failures out of 29 checks)
  • PR comments reviewed and addressed

Reviewer Feedback Analysis:

PastaPastaPasta comments reviewed: 0
Other human comments reviewed: 0

No human reviewer feedback requiring action.

Technical Analysis:

Bitcoin commit 0375244 (bitcoin#29249): depends: add NM output to gen_id

  • Files changed: 2 files (depends/Makefile, depends/gen_id)
  • Changes: 8 additions, 3 deletions (11 total changes)
  • Intent: Include NM (part of toolset) in gen_id dependency tracking

Dash PR changes:

  • Files changed: 2 files (depends/Makefile, depends/gen_id)
  • Changes: 8 additions, 3 deletions (11 total changes)
  • Size ratio: 100.0% (perfect match)
  • File operations: Exact match - both modify existing files

Validation Results:

Size validation: 100% of Bitcoin change size (within 80-150% range)
File validation: All Bitcoin files present, no extra files
Content validation: All Bitcoin changes faithfully implemented
CI validation: All 29 checks passing
Witness validation: No Bitcoin-specific witness patterns detected

This PR is ready for merge. ✅

@DashCoreAutoGuix DashCoreAutoGuix added the verified Backport verification passed - ready for merge label Aug 8, 2025
@PastaPastaPasta PastaPastaPasta changed the base branch from backport-0.27-batch-724 to backport-auto-20250821 August 21, 2025 22:00
Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
@PastaPastaPasta PastaPastaPasta changed the base branch from backport-auto-20250821 to backport-sept-30-2025 September 30, 2025 14:35
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

depends/Makefile Outdated
#
build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
$(host_arch)_$(host_os)_id:=$(shell env CC='$(host_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(host_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(host_AR)' RANLIB='$(host_RANLIB)' STRIP='$(host_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(HOST_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR) 'NM='$(build_NM)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
Copy link

Choose a reason for hiding this comment

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

Bug: Shell Quoting Error in Environment Variable Assignment

The build_id assignment for AR and NM has a shell quoting error. The AR variable's value includes an unintended trailing space and is missing its closing quote, causing the NM assignment to be incorrectly concatenated into AR's value instead of being set as a separate environment variable. This differs from the correct syntax used for host_id.

Fix in Cursor Fix in Web

@PastaPastaPasta PastaPastaPasta force-pushed the backport-sept-30-2025 branch 2 times, most recently from 20ce09a to d96d2ab Compare October 1, 2025 23:59
@PastaPastaPasta PastaPastaPasta removed the verified Backport verification passed - ready for merge label Dec 3, 2025
- Fix spacing issue where AR variable was missing closing quote
- This caused build_AR value to be concatenated with "NM=" string
- Applied fix from Bitcoin PR bitcoin#31627 (commit 8a46286)
- Resolves reviewer feedback from knst and cursor[bot]

Addresses issue identified in review of PR #1068
@DashCoreAutoGuix
Copy link
Owner Author

Verification Agent: Fixes Applied

I've applied a fix to address the shell quoting error identified by reviewers.

Issue Fixed

Shell quoting error in depends/Makefile:150

  • The build_id assignment had a typo: AR='$(build_AR) 'NM='$(build_NM)'
  • This caused the AR variable's closing quote to be missing, concatenating the value with "NM="
  • Fixed to: AR='$(build_AR)' NM='$(build_NM)'

Context

The original Bitcoin commit (bitcoin/bitcoin@03752444cd) introduced this typo, which was later fixed in Bitcoin PR bitcoin#31627 (commit 8a46286). Rather than requiring a separate backport of bitcoin#31627, I've applied the fix directly based on reviewer feedback from @knst and cursor[bot].

Analysis Summary

The fix has been committed and pushed. CI will re-run to validate the change.

@DashCoreAutoGuix DashCoreAutoGuix added the fixes-applied Issues found and fixes automatically applied label Dec 9, 2025
@DashCoreAutoGuix
Copy link
Owner Author

✅ Verification Complete - APPROVED

Summary

This backport of Bitcoin Core PR bitcoin#29249 has been verified and approved.

Verification Results

Bitcoin Commit: 03752444cd

Changes:

  • ✅ Size ratio: 100% (2 files changed in both Bitcoin and Dash)
  • ✅ File count matches: 2 files
  • ✅ All changes faithfully backported

Files Modified:

  • depends/Makefile - Added NM to build_id variables
  • depends/gen_id - Added NM version output to build ID generation

CI Status: ✅ All 52 checks passing

Fix Applied

The initial backport contained a shell quoting error in depends/Makefile line 150:

  • Before: AR='$(build_AR) 'NM='$(build_NM)' (typo from Bitcoin's original commit)
  • After: AR='$(build_AR)' NM='$(build_NM)' (corrected)

This fix was correctly applied in commit 1c397b8 and addresses the feedback from @knst and @cursor[bot].

Conclusion

The backport is complete, faithful to Bitcoin's intent, and all CI checks pass. The shell quoting issue has been resolved.

@DashCoreAutoGuix DashCoreAutoGuix added the verified Backport verification passed - ready for merge label Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes-applied Issues found and fixes automatically applied verified Backport verification passed - ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants