hofstadter-io / hof

Framework that joins data models, schemas, code generation, and a task engine. Language and technology agnostic.
https://docs.hofstadter.io
Apache License 2.0
522 stars 37 forks source link

Build fails with Go 1.23 because of changed testing.testDeps #391

Closed stefanb closed 4 months ago

stefanb commented 4 months ago

When trying to build with Go 1.23 rc1 in

It failed at https://github.com/hofstadter-io/hof/blob/bebc58f867e4341e3060f2421910acef6b743ea5/script/runtime/exe_next.go#L52

with error:

  # github.com/hofstadter-io/hof/script/runtime
  script/runtime/exe_next.go:52:26: cannot use nopTestDeps{} (value of type nopTestDeps) as testing.testDeps value in argument to testing.MainStart: nopTestDeps does not implement testing.testDeps (missing method InitRuntimeCoverage)

InitRuntimeCoverage was added by @rsc in: https://github.com/golang/go/commit/180ea45566d19e60aa2d660f6139b7f6e18ff56b#diff-36f401ff1ffadb7d7a39cf41c2329615b159fa95cf2e14c1f58d8c46331af429R208

See

Given the NOP nature of nopTestDeps a possible workaround could be to just implement a dummy/nop function InitRuntimeCoverage() in the nopTestDeps:

func (nopTestDeps) InitRuntimeCoverage() (mode string, tearDown func(string, string) (string, error), snapcov func() float64) {
    return
}
verdverm commented 4 months ago

Living on the edge eh?! Thanks for the heads up and initial investigation

We've seen this before, it's one area where Go is not API stable :[

I can probably roll over the old/new exe files and the build directives therein

verdverm commented 4 months ago

@stefanb please let me know if _dev branch (our main branch) works for you now

I'm going to look at updating CUE to 0.9.1+ or maybe a 0.10.0-beta/rc and then cut a new version

stefanb commented 4 months ago

@verdverm the most i could (quickly) test is if it builds or run some unit tests, not all the functionality in practice. Would that really be enough?

verdverm commented 4 months ago

yeah, just whatever is failing for you. I find it unlikely this changed any behavior you rely on, unless you are using the hidden hof run command (which is based on the testscript package both Go & CUE use, but exposed as a scripting language)

stefanb commented 3 months ago

Still needs a release > v0.6.9 that includes fix from https://github.com/hofstadter-io/hof/pull/392, see: https://github.com/hofstadter-io/hof/releases

verdverm commented 3 months ago

@stefanb just cut a new release candidate