containerd/script
Sebastiaan van Stijn 349d2b5c15
script/setup/install-runc: fix runc using incorrect version
runc v1.1.13 introduced an option to customize the version (as printed by the
`--version` flag) through a `VERSION` Make variable / environment variable
(see [1]).

This variable collided with the `VERSION` environment variable used by
containerd for the same purpose, which lead to `runc` binaries built
using the version of containerd;

    runc --version
    runc version 1.7.20
    commit: v1.1.13-0-g58aa9203
    ...

This patch unsets the `VERSION` variable to bring prevent it from being
inherited and to bring back the previous behavior.

Before this patch:

    docker build -t containerd-test -f contrib/Dockerfile.test .
    docker run -it --rm --env VERSION=1.7.20 containerd-test sh -c 'script/setup/install-runc && /usr/local/sbin/runc --version'
    # ....
    HEAD is now at 58aa9203 VERSION: release 1.1.13
    go build -trimpath "-buildmode=pie"  -tags "seccomp" -ldflags "-X main.gitCommit=v1.1.13-0-g58aa9203 -X main.version=1.7.20 " -o runc .
    install -D -m0755 runc /usr/local/sbin/runc
    /go/src/github.com/containerd/containerd
    runc version 1.7.20
    commit: v1.1.13-0-g58aa9203
    spec: 1.0.2-dev
    go: go1.22.5
    libseccomp: 2.5.4

With this patch:

    docker build -t containerd-test -f contrib/Dockerfile.test .
    docker run -it --rm --env VERSION=1.7.20 containerd-test sh -c 'script/setup/install-runc && /usr/local/sbin/runc --version'
    # ....
    HEAD is now at 58aa9203 VERSION: release 1.1.13
    go build -trimpath "-buildmode=pie"  -tags "seccomp" -ldflags "-X main.gitCommit=v1.1.13-0-g58aa9203 -X main.version=v1.1.13 " -o runc .
    install -D -m0755 runc /usr/local/sbin/runc
    /go/src/github.com/containerd/containerd
    runc version v1.1.13
    commit: v1.1.13-0-g58aa9203
    spec: 1.0.2-dev
    go: go1.22.5
    libseccomp: 2.5.4

[1]: 6f4d975c40

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-06 16:52:15 +02:00
..
setup script/setup/install-runc: fix runc using incorrect version 2024-08-06 16:52:15 +02:00
test script/test/utils.sh: readiness_check: print daemon log 2024-02-17 23:56:38 +09:00
critest.sh scripts/critest.sh: Prepare for userns tests in runc 2024-07-10 17:26:31 +02:00
go-test-fuzz.sh Fix typos 2023-10-16 22:14:09 +08:00
resize-vagrant-root.sh CI: update Rocky Linux to 8.8 2023-08-08 18:58:24 +09:00
verify-go-modules.sh fix verify-vendor if go.mod does not contain replace rules 2022-05-27 12:57:12 +02:00