Skip to content

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Sep 25, 2025

This PR bumps up the Golang version to 1.25.1. It also:

  • removes the ms_tls13kdf Golang build tag when building in FIPS mode because this tag was only needed with Golang versions 1.24.x.
  • sets ths GODEBUG=tlsmlkem=0 environment variable when running FIPS140-only unit tests. This prevents errors like so: Failed to connect: crypto/ecdh: use of X25519 is not allowed in FIPS 140-only mode.

@ycombinator ycombinator requested review from a team as code owners September 25, 2025 17:46
@ycombinator ycombinator added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-active-all Automated backport with mergify to all the active branches labels Sep 25, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@ycombinator
Copy link
Contributor Author

ycombinator commented Sep 25, 2025

The fips140=only unit tests are failing like so:

crypto/ecdh: use of X25519 is not allowed in FIPS 140-only mode

These appear to be golang/go#75148, which should be fixable when golang/go#74630 is implemented. However, in order to upgrade to Go 1.25.1 now, we'll need to find a workaround.

@ycombinator
Copy link
Contributor Author

ycombinator commented Sep 25, 2025

The fips140=only unit tests are failing like so:

crypto/ecdh: use of X25519 is not allowed in FIPS 140-only mode

These appear to be golang/go#75148, which should be fixable when golang/go#74630 is implemented. However, in order to upgrade to Go 1.25.1 now, we'll need to find a workaround.

These errors are coming from Go downloading dependencies before executing the tests. The errors can be simulated like so:

GODEBUG=fips140=only go mod download -x
# get https://proxy.golang.org/github.com/opencontainers/image-spec/@v/v1.1.1.info
# get https://proxy.golang.org/github.com/opencontainers/image-spec/@v/v1.1.1.info: Get "https://proxy.golang.org/github.com/opencontainers/image-spec/@v/v1.1.1.info": crypto/ecdh: use of X25519 is not allowed in FIPS 140-only mode
...

So we probably just need to download the dependencies explicitly, ensuring that GODEBUG=fips140=only is not set for this step.

@ycombinator
Copy link
Contributor Author

So we probably just need to download the dependencies explicitly, ensuring that GODEBUG=fips140=only is not set for this step.

I've implemented this approach in this PR and it has helped. However, now CI is failing with this odd error which seems unrelated to FIPS in any way.

https://buildkite.com/elastic/elastic-agent/builds/27575#0199842f-d9dd-4481-9d46-37baa5c789b1/155-822

=== FAIL: dev-tools/mage TestGoTest_CaptureOutput/capture_panic (1.61s)
--
  | >> go test: asserts Testing
  | >> ARGS: asserts Command: gotestsum --no-color --junitfile-hide-skipped-tests -f standard-quiet -- -test.run TestGoTest_Helper_WithPanic .
  | 2025/09/26 04:35:17 exec: gotestsum --no-color --junitfile-hide-skipped-tests -f standard-quiet -- -test.run TestGoTest_Helper_WithPanic .
  | exec: gotestsum --no-color --junitfile-hide-skipped-tests -f standard-quiet -- -test.run TestGoTest_Helper_WithPanic .
  | gotest_test.go:120: GoTest output mismatch:
  | want:
  | (?sm:
  | === FAIL: dev-tools/mage TestGoTest_Helper_WithPanic.*
  | panic: Kaputt. \[recovered\].*
  | panic: Kaputt.*
  | )
  |  
  | got:
  | FAIL	github.com/elastic/elastic-agent/dev-tools/mage	0.021s
  |  
  | === Failed
  | === FAIL: dev-tools/mage TestGoTest_Helper_WithPanic (0.00s)
  | panic: Kaputt. [recovered, repanicked]
  |  
  | goroutine 21 [running]:
  | testing.tRunner.func1.2({0xcd39e0, 0xf923f0})
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/testing/testing.go:1872 +0x237
  | testing.tRunner.func1()
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/testing/testing.go:1875 +0x35b
  | panic({0xcd39e0?, 0xf923f0?})
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/runtime/panic.go:783 +0x132
  | github.com/elastic/elastic-agent/dev-tools/mage.TestGoTest_Helper_WithPanic(0xc000103880?)
  | /opt/buildkite-agent/builds/bk-agent-prod-gcp-1758859361500881345/elastic/elastic-agent/dev-tools/mage/gotest_test.go:329 +0x30
  | testing.tRunner(0xc000103880, 0xea4750)
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/testing/testing.go:1934 +0xea
  | created by testing.(*T).Run in goroutine 1
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/testing/testing.go:1997 +0x465
  |  
  | DONE 1 tests, 1 failure in 0.022s
  |  
  | === FAIL: dev-tools/mage TestGoTest_CaptureOutput (26.02s)

@ycombinator
Copy link
Contributor Author

So we probably just need to download the dependencies explicitly, ensuring that GODEBUG=fips140=only is not set for this step.

I've implemented this approach in this PR and it has helped. However, now CI is failing with this odd error which seems unrelated to FIPS in any way.

https://buildkite.com/elastic/elastic-agent/builds/27575#0199842f-d9dd-4481-9d46-37baa5c789b1/155-822

=== FAIL: dev-tools/mage TestGoTest_CaptureOutput/capture_panic (1.61s)
--
  | >> go test: asserts Testing
  | >> ARGS: asserts Command: gotestsum --no-color --junitfile-hide-skipped-tests -f standard-quiet -- -test.run TestGoTest_Helper_WithPanic .
  | 2025/09/26 04:35:17 exec: gotestsum --no-color --junitfile-hide-skipped-tests -f standard-quiet -- -test.run TestGoTest_Helper_WithPanic .
  | exec: gotestsum --no-color --junitfile-hide-skipped-tests -f standard-quiet -- -test.run TestGoTest_Helper_WithPanic .
  | gotest_test.go:120: GoTest output mismatch:
  | want:
  | (?sm:
  | === FAIL: dev-tools/mage TestGoTest_Helper_WithPanic.*
  | panic: Kaputt. \[recovered\].*
  | panic: Kaputt.*
  | )
  |  
  | got:
  | FAIL	github.com/elastic/elastic-agent/dev-tools/mage	0.021s
  |  
  | === Failed
  | === FAIL: dev-tools/mage TestGoTest_Helper_WithPanic (0.00s)
  | panic: Kaputt. [recovered, repanicked]
  |  
  | goroutine 21 [running]:
  | testing.tRunner.func1.2({0xcd39e0, 0xf923f0})
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/testing/testing.go:1872 +0x237
  | testing.tRunner.func1()
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/testing/testing.go:1875 +0x35b
  | panic({0xcd39e0?, 0xf923f0?})
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/runtime/panic.go:783 +0x132
  | github.com/elastic/elastic-agent/dev-tools/mage.TestGoTest_Helper_WithPanic(0xc000103880?)
  | /opt/buildkite-agent/builds/bk-agent-prod-gcp-1758859361500881345/elastic/elastic-agent/dev-tools/mage/gotest_test.go:329 +0x30
  | testing.tRunner(0xc000103880, 0xea4750)
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/testing/testing.go:1934 +0xea
  | created by testing.(*T).Run in goroutine 1
  | /opt/buildkite-agent/.asdf/installs/golang/1.25.1/go/src/testing/testing.go:1997 +0x465
  |  
  | DONE 1 tests, 1 failure in 0.022s
  |  
  | === FAIL: dev-tools/mage TestGoTest_CaptureOutput (26.02s)

Turns out this is a change in behavior in Go 1.25: https://tip.golang.org/doc/go1.25#change-to-unhandled-panic-output. Addressed in 46cc036.

@pchila
Copy link
Member

pchila commented Sep 29, 2025

Looking at the latest build I see a couple of strange things (maybe some of those were already there and didn't notice until now)

@ycombinator
Copy link
Contributor Author

Windows build steps are failing in CI on this PR. See a lot of Access is denied errors. 🤔

Copy link

Copy link
Contributor

mergify bot commented Oct 3, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b bump-golang-1.25.1 upstream/bump-golang-1.25.1
git merge upstream/main
git push upstream bump-golang-1.25.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-active-all Automated backport with mergify to all the active branches Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants