Skip to content

api/golang@1.18.1 fails to build for external consumers: undefined path_compression.ComputeContentHash #3073

Description

@parithosh

Summary

The latest release 1.18.1 of github.com/kurtosis-tech/kurtosis/api/golang cannot be built by external Go consumers. Compilation fails with:

github.com/kurtosis-tech/kurtosis/api/golang@v1.18.1/core/lib/enclaves/enclave_context.go:762:39:
  undefined: path_compression.ComputeContentHash

Reproduction

mkdir kurtosis-test && cd kurtosis-test
go mod init kurtosis-test
cat > main.go <<'GOEOF'
package main

import (
    "context"
    "fmt"
    "os"

    "github.com/kurtosis-tech/kurtosis/api/golang/engine/lib/kurtosis_context"
)

func main() {
    ctx := context.Background()
    kCtx, err := kurtosis_context.NewKurtosisContextFromLocalEngine()
    if err != nil { fmt.Fprintln(os.Stderr, err); os.Exit(1) }
    info, err := kCtx.GetEngineInfo(ctx)
    if err != nil { fmt.Fprintln(os.Stderr, err); os.Exit(1) }
    fmt.Println(info.GetEngineVersion())
}
GOEOF
go get github.com/kurtosis-tech/kurtosis/api/golang@1.18.1
go build ./...

Tested with go 1.26.2 on darwin/arm64.

Root cause

api/golang/go.mod has:

replace (
    github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang => ../../grpc-file-transfer/golang
    github.com/kurtosis-tech/kurtosis/path-compression          => ../../path-compression
)

These local replace directives only apply inside the monorepo — they are ignored when api/golang is consumed as a module. External builds therefore resolve github.com/kurtosis-tech/kurtosis/path-compression to the latest tagged pseudo-version v0.0.0-20240307154559-64d2929cd265, which does not export ComputeContentHash. The function is referenced from core/lib/enclaves/enclave_context.go:762, so the build fails.

Suggested fix

Cut a tagged release of path-compression (and grpc-file-transfer/golang) that includes ComputeContentHash, then bump the require lines in api/golang/go.mod to that version and drop the local replace directives (or keep them but ensure the require versions can also build standalone).

Environment

  • go version go1.26.2 darwin/arm64
  • github.com/kurtosis-tech/kurtosis/api/golang v1.18.1
  • Resolved path-compression v0.0.0-20240307154559-64d2929cd265

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions