Skip to content

Conversation

@gdams
Copy link
Member

@gdams gdams commented Feb 10, 2026

Remove the per-platform GOEXPERIMENTs (opensslcrypto, cngcrypto, darwincrypto) and use only systemcrypto with platform build constraints.

Before this change, there was lots of confusion around the platform-specific experiements:

  • Linux: GOEXPERIMENT=opensslcrypto
  • Windows: GOEXPERIMENT=cngcrypto
  • Darwin: GOEXPERIMENT=darwincrypto

Platform-specific code now uses build constraints like:
//go:build goexperiment.systemcrypto && linux
//go:build goexperiment.systemcrypto && windows
//go:build goexperiment.systemcrypto && darwin

Runtime checks use:
goexperiment.SystemCrypto && runtime.GOOS == "linux"

This simplifies the developer experience and makes cross-platform scripts and documentation easier to maintain.

Changes:

  • Throws errors for OpenSSLCrypto, CNGCrypto, DarwinCrypto in goexperiment.Flags
  • Update all build constraints to use systemcrypto + platform
  • Update runtime checks to use SystemCrypto + runtime.GOOS
  • Update test infrastructure to only check for systemcrypto

Remove the per-platform GOEXPERIMENTs (opensslcrypto, cngcrypto,
darwincrypto) and use only systemcrypto with platform build constraints.

Before this change, enabling a crypto backend required knowing which
experiment to use for each platform:
  - Linux: GOEXPERIMENT=opensslcrypto
  - Windows: GOEXPERIMENT=cngcrypto
  - Darwin: GOEXPERIMENT=darwincrypto

After this change, a single experiment works across all platforms:
  - All platforms: GOEXPERIMENT=systemcrypto

Platform-specific code now uses build constraints like:
  //go:build goexperiment.systemcrypto && linux
  //go:build goexperiment.systemcrypto && windows
  //go:build goexperiment.systemcrypto && darwin

Runtime checks use:
  goexperiment.SystemCrypto && runtime.GOOS == "linux"

This simplifies the developer experience and makes cross-platform
scripts and documentation easier to maintain.

Changes:
- Remove OpenSSLCrypto, CNGCrypto, DarwinCrypto from goexperiment.Flags
- Remove exp_*crypto_{on,off}.go files for old experiments
- Update all build constraints to use systemcrypto + platform
- Update runtime checks to use SystemCrypto + runtime.GOOS
- Update test infrastructure to only check for systemcrypto
@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as outdated.

@gdams gdams marked this pull request as ready for review February 10, 2026 17:59
@gdams gdams requested a review from a team as a code owner February 10, 2026 17:59
@github-actions

This comment has been minimized.

@github-actions

This comment was marked as outdated.

Copy link
Member

@qmuntal qmuntal left a comment

Choose a reason for hiding this comment

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

Docs need to be updated (including release notes, why not 🐱 )

@gdams gdams requested a review from qmuntal February 11, 2026 09:59
@gdams gdams enabled auto-merge (squash) February 11, 2026 10:04
@github-actions

This comment was marked as outdated.

@gdams gdams force-pushed the dev/gadams/experiement branch from f3c1d56 to 7cf51eb Compare February 11, 2026 10:13
@github-actions
Copy link

Patch Consistency Review ✅

I've completed a thorough review of the patch file changes in this PR. The changes consistently consolidate the platform-specific crypto backend GOEXPERIMENTs (opensslcrypto, cngcrypto, darwincrypto) into the unified systemcrypto experiment.

Summary of Changes

Patch 0002 (Add crypto backend GOEXPERIMENTs):

  • Removes build tag logic that made systemcrypto automatically enable platform-specific experiments
  • Removes test data for platform-specific experiments (e.g., backendtags_openssl)
  • Keeps experiment definitions but simplifies the implementation

Patch 0003 (Implement crypto internal backend):

  • Adds error checking to throw helpful errors when deprecated experiments are used
  • Updates test infrastructure to only check for systemcrypto instead of platform-specific variants
  • Simplifies iOS and test directory skip logic to use only systemcrypto

Patch 0004 (Use crypto backends):

  • Changes build constraints from goexperiment.darwincrypto to goexperiment.systemcrypto && darwin
  • Updates test skip conditions to use systemcrypto instead of platform-specific checks
  • Simplifies static linking check on Linux

Consistency Check Results

Vendor patches: No vendor-related changes detected
Patch naming: All patches follow the established naming convention
Content consistency: Changes are consistently applied across all three patches with no redundancy or missing updates

Conclusion

The patches maintain excellent cross-patch consistency. The consolidation is implemented uniformly across all affected areas, and the error handling for deprecated experiments provides a good migration path for users. No issues found.

AI generated by Patch Consistency Review Agent

@gdams gdams merged commit fb5efb0 into microsoft/main Feb 11, 2026
49 checks passed
@gdams gdams deleted the dev/gadams/experiement branch February 11, 2026 11:28
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