Skip to content

fix: make nvattest builds reproducible#813

Merged
kvinwang merged 1 commit into
masterfrom
codex/nvattest-reproducible
Jul 22, 2026
Merged

fix: make nvattest builds reproducible#813
kvinwang merged 1 commit into
masterfrom
codex/nvattest-reproducible

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Summary

  • pin the generated regorus FFI Cargo dependency graph used by NVIDIA's attestation SDK
  • install the reviewed lockfile after CMake FetchContent populates regorus
  • fail the build if Cargo attempts to rewrite the lockfile

Root cause

Two independent clean dstack OS builds produced different /usr/bin/nvattest and /usr/lib/libnvat.so.1.2.2. Their executable code, read-only data, relocations and writable data were identical; only dynamic-string ordering, debug links and GNU build IDs differed.

regorus/bindings/ffi does not commit a Cargo.lock, so clean builds performed time-dependent dependency resolution. The observed builds selected syn 3.0.2 and 3.0.3 respectively. That changed proc-macro build inputs and ultimately ELF string-table ordering/build IDs.

Verification

Two independent mc:prod:nvattest cleansstate rebuilds after this fix produced byte-identical files:

  • nvattest: 32c954ab703d37b3ab6594f54997083ac5f2db4b3f82b372c01eef1abb3d98a1
  • libnvat.so.1.2.2: 2c8c1104fa0ab4f68dd96319d2040d6a303f00055cd9026c9637948ac3982ffd

Rebuilding both production rootfs images then produced byte-identical outputs:

  • CPIO: 55e0121dfa0f44a3a5dfba69dd7d49fa0c101dcff8156eb2826d1a1d237fc991
  • squashfs: 53616e21428f956f1782597ced25bdbe3233e37a0575ad41f566b69f90f8608f
  • squashfs.verity: 8ea8229ec9fd8fb105ebb4e327a5d71c83c1571ea28ecf1346a4d31bdbb51921

Copilot AI review requested due to automatic review settings July 22, 2026 04:18

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kvinwang
kvinwang merged commit 1227894 into master Jul 22, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants