Skip to content

Discussion: go 1.21+ toolchain version #529

@robdimsdale

Description

@robdimsdale

Starting with go 1.21, there is an optional entry in go.mod for toolchain, and an associated environment variable GOTOOLCHAIN. This is part of a larger change in go 1.21 around toolchains and minimum go versions. See documentation and the blog post.

This issue is to capture thoughts around what we might want to do with this new information. If we identify actionable features we can link them here.

Based on my understanding, I don't think there's too much the buildpack can or should do with this information, as the go toolchain itself processes this information and acts accordingly.

One thing we could choose to do could be fail-fast during Detect if the requested go toolchain is greater than the available versions of go the buildpack provides. That could be contentious, however, as starting with go 1.21, the go toolchain will download the required version of golang automatically, and as a result Paketo Buildpacks could be viewed as unnecessarily restrictive. Of course, this automatic download wouldn't work in an offline environment, so the build will fail regardless of whether the failure is by the buildpack in Detect or by the toolchain in Build.

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