Skip to content

Move fips140only.BackendApprovedHash to patch 0003#2205

Merged
gdams merged 1 commit intomicrosoft/mainfrom
dev/gadams/docs
Mar 23, 2026
Merged

Move fips140only.BackendApprovedHash to patch 0003#2205
gdams merged 1 commit intomicrosoft/mainfrom
dev/gadams/docs

Conversation

@gdams
Copy link
Member

@gdams gdams commented Mar 23, 2026

fixes: #2204

Patch 0003 references fips140only.BackendApprovedHash in backend_linux.go, backend_windows.go, and backend_darwin.go, but the BackendApprovedHash variable and the updated ApprovedHash function were only added to fips140only.go in patch 0004. This caused a build failure when building at the 0003 commit:

# crypto/internal/backend
crypto/internal/backend/backend_linux.go:44:14: undefined: fips140only.BackendApprovedHash

Move the fips140only.go hunk from patch 0004 into patch 0003 so the symbol exists when it is first used.

Patch 0003 references fips140only.BackendApprovedHash in
backend_linux.go, backend_windows.go, and backend_darwin.go, but the
BackendApprovedHash variable and the updated ApprovedHash function were
only added to fips140only.go in patch 0004. This caused a build failure
when building at the 0003 commit:

    # crypto/internal/backend
    crypto/internal/backend/backend_linux.go:44:14: undefined: fips140only.BackendApprovedHash

Move the fips140only.go hunk from patch 0004 into patch 0003 so the
symbol exists when it is first used.
@gdams gdams requested a review from a team as a code owner March 23, 2026 10:37
Copilot AI review requested due to automatic review settings March 23, 2026 10:37
Copy link
Contributor

Copilot AI left a comment

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 fixes a patch-ordering build break by moving the introduction of fips140only.BackendApprovedHash (and the updated ApprovedHash behavior) into patch 0003, so the symbol exists at the first patch that references it. This resolves the undefined: fips140only.BackendApprovedHash failure reported in #2204 and allows the Patch Build workflow to build with the race detector again.

Changes:

  • Move the src/crypto/internal/fips140only/fips140only.go hunk that defines BackendApprovedHash + updates ApprovedHash from patch 0004 into patch 0003.
  • Update patch stats accordingly so 0004 no longer lists/modifies fips140only.go.
  • Re-enable the race build in .github/workflows/patch-build.yml by removing -skipbuildrace.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
patches/0003-Implement-crypto-internal-backend.patch Adds the fips140only.go change so BackendApprovedHash exists when backends set it during init.
patches/0004-Use-crypto-backends.patch Removes the now-duplicated fips140only.go hunk and updates patch stats accordingly.
.github/workflows/patch-build.yml Restores default eng/run.ps1 build (including race build), now that patch 0003 builds cleanly.

Patches are happy!

@gdams gdams enabled auto-merge (squash) March 23, 2026 10:42
@gdams gdams merged commit 57281cd into microsoft/main Mar 23, 2026
61 checks passed
@gdams gdams deleted the dev/gadams/docs branch March 23, 2026 11:34
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.

0003-Implement-crypto-internal-backend.patch fails to build with race detector: "undefined: fips140only.BackendApprovedHash"

3 participants