Skip to content

Fix stale Soroban host rebuild invalidation. - #5187

Merged
dmkozh merged 1 commit into
stellar:masterfrom
dmkozh:make_fix
Mar 21, 2026
Merged

dmkozh merged 1 commit into
stellar:masterfrom
dmkozh:make_fix

Conversation

@dmkozh

@dmkozh dmkozh commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Description

Soroban host builds can change their embedded GIT_REVISION after a submodule commit move without changing Cargo.lock or tracked Rust sources. In some scenarios that left the top-level stellar-core Rust archive reusable even though the linked Soroban .rlibs had new contents, so the final binary could still contain the old revisions until make clean.

To fix this issue, track per-protocol Soroban git state, hash the built Soroban libraries into SOROBAN_LIBS_STAMP, and feed that state into the top-level cargo rustc metadata while depending on the actual .rlibs. This forces the final archive to rebuild when Soroban submodule revisions change.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

Copilot AI review requested due to automatic review settings March 19, 2026 00:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens the build invalidation logic for the non-unified Rust build so librust_stellar_core.a is reliably rebuilt when Soroban submodule revisions change (even if Cargo.lock and tracked Rust sources don’t), preventing stale embedded Soroban GIT_REVISION values from persisting until make clean.

Changes:

  • Add per-protocol Soroban git-state stamp files and use them to invalidate the Soroban build stamp on submodule commit moves.
  • Replace the “touch” Soroban libs stamp with a content-based SHA256 over built Soroban .rlibs.
  • Feed Soroban libs state into the top-level cargo rustc invocation and add explicit .rlib prerequisites to the final Rust archive target.

Comment thread src/Makefile.am Resolved
Comment thread src/Makefile.am Resolved
Comment thread src/Makefile.am Resolved

@graydon graydon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@dmkozh
dmkozh enabled auto-merge March 20, 2026 23:27
Soroban host builds can change their embedded GIT_REVISION after a submodule commit move without changing Cargo.lock or tracked Rust sources. In some scenarios that left the top-level stellar-core Rust archive reusable even though the linked Soroban .rlibs had new contents, so the final binary could still contain the old revisions until `make clean`.

To fix this issue, track per-protocol Soroban git state, hash the built Soroban libraries into SOROBAN_LIBS_STAMP, and feed that state into the top-level cargo rustc metadata while depending on the actual .rlibs. This forces the final archive to rebuild when Soroban submodule revisions change.
@dmkozh
dmkozh disabled auto-merge March 21, 2026 00:27
@dmkozh
dmkozh added this pull request to the merge queue Mar 21, 2026
Merged via the queue into stellar:master with commit fba81f1 Mar 21, 2026
54 checks passed
@dmkozh
dmkozh deleted the make_fix branch March 21, 2026 01:05
SirTyson pushed a commit to SirTyson/stellar-core that referenced this pull request Apr 10, 2026
# Description

Soroban host builds can change their embedded GIT_REVISION after a
submodule commit move without changing Cargo.lock or tracked Rust
sources. In some scenarios that left the top-level stellar-core Rust
archive reusable even though the linked Soroban .rlibs had new contents,
so the final binary could still contain the old revisions until `make
clean`.

To fix this issue, track per-protocol Soroban git state, hash the built
Soroban libraries into SOROBAN_LIBS_STAMP, and feed that state into the
top-level cargo rustc metadata while depending on the actual .rlibs.
This forces the final archive to rebuild when Soroban submodule
revisions change.

# Checklist
- [ ] Reviewed the
[contributing](https://github.com/stellar/stellar-core/blob/master/CONTRIBUTING.md#submitting-changes)
document
- [ ] Rebased on top of master (no merge commits)
- [ ] Ran `clang-format` v8.0.0 (via `make format` or the Visual Studio
extension)
- [ ] Compiles
- [ ] Ran all tests
- [ ] If change impacts performance, include supporting evidence per the
[performance
document](https://github.com/stellar/stellar-core/blob/master/performance-eval/performance-eval.md)
SirTyson pushed a commit to SirTyson/stellar-core that referenced this pull request Apr 13, 2026
# Description

Soroban host builds can change their embedded GIT_REVISION after a
submodule commit move without changing Cargo.lock or tracked Rust
sources. In some scenarios that left the top-level stellar-core Rust
archive reusable even though the linked Soroban .rlibs had new contents,
so the final binary could still contain the old revisions until `make
clean`.

To fix this issue, track per-protocol Soroban git state, hash the built
Soroban libraries into SOROBAN_LIBS_STAMP, and feed that state into the
top-level cargo rustc metadata while depending on the actual .rlibs.
This forces the final archive to rebuild when Soroban submodule
revisions change.

# Checklist
- [ ] Reviewed the
[contributing](https://github.com/stellar/stellar-core/blob/master/CONTRIBUTING.md#submitting-changes)
document
- [ ] Rebased on top of master (no merge commits)
- [ ] Ran `clang-format` v8.0.0 (via `make format` or the Visual Studio
extension)
- [ ] Compiles
- [ ] Ran all tests
- [ ] If change impacts performance, include supporting evidence per the
[performance
document](https://github.com/stellar/stellar-core/blob/master/performance-eval/performance-eval.md)
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