From 65f8df0715be72c676875af46cae83af8e7312d4 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:03:54 +0100 Subject: [PATCH] test: skip mips go build on ubuntu 22.04 Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- src/test-go.bats | 12 ++++++++++++ src/test_helper.bash | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/src/test-go.bats b/src/test-go.bats index 8805ee7..16d2346 100755 --- a/src/test-go.bats +++ b/src/test-go.bats @@ -307,11 +307,17 @@ testHelloGO() { } @test "mipsle-hellogo" { + if ! supportMipsBuildGo; then + skip "MIPS build not supported" + fi export TARGETARCH=mipsle testHelloGO } @test "mipsle-softfloat-hellogo" { + if ! supportMipsBuildGo; then + skip "MIPS build not supported" + fi export TARGETARCH=mipsle export TARGETVARIANT=softfloat testHelloGO @@ -319,11 +325,17 @@ testHelloGO() { } @test "mips64le-hellogo" { + if ! supportMipsBuildGo; then + skip "MIPS build not supported" + fi export TARGETARCH=mips64le testHelloGO } @test "mips64le-softfloat-hellogo" { + if ! supportMipsBuildGo; then + skip "MIPS build not supported" + fi export TARGETARCH=mips64le export TARGETVARIANT=softfloat testHelloGO diff --git a/src/test_helper.bash b/src/test_helper.bash index 68c620e..7c04d84 100644 --- a/src/test_helper.bash +++ b/src/test_helper.bash @@ -95,6 +95,12 @@ supportAmd64VariantGo() { versionGTE "$(go version | awk '{print $3}' | sed 's/^go//')" "1.18" } +# Supported since Go 1.13: https://go.dev/wiki/GoMips +# But fails on Ubuntu 22.04 with Go 1.18.1: https://github.com/tonistiigi/xx/issues/177 +supportMipsBuildGo() { + ! grep -q 'ID=ubuntu' /etc/os-release && ! grep -q 'VERSION_ID="22.04"' /etc/os-release && versionGTE "$(go version | awk '{print $3}' | sed 's/^go//')" "1.13" +} + supportRC() { command -v llvm-rc >/dev/null 2>&1 }