Skip to content

devcontainer: Go version mismatch between $GOROOT and binary in PATH causes build errors #37373

@peyremorgan

Description

@peyremorgan

Description

The project's devcontainer image pulls go 1.25 and the upgrades the toolchain through the env setting GOTOOLCHAIN=auto, leaving some older artifacts (stdlib in $GOROOT).

Running make build in the freshly built devcontainer produces the following error on multiple compile targets:

compile: version "go1.25.9" does not match go tool version "go1.26.2"

Full build log is attached.

Upgrading the base image to mcr.microsoft.com/devcontainers/go:1.26-trixie solves the issue.

A workaround is to unset GOROOT to avoid the version conflict.

Gitea Version

32fdfb0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://github.com/user-attachments/files/26983229/build.log

Screenshots

No response

Git Version

2.53.0

Operating System

Devcontainer mcr.microsoft.com/devcontainers/go:1.25-trixie

How are you running Gitea?

Built in devcontainer mcr.microsoft.com/devcontainers/go:1.25-trixie on Docker 29.4.0

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/buildPR changes how Gitea is built, i.e. regarding Docker or the Makefile

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions