Skip to content

Commit

Permalink
Disable cgo in uroot building tests
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Koch <chrisko@google.com>
  • Loading branch information
hugelgupf committed Dec 27, 2023
1 parent 398256a commit 7f1affc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/uroot/builder/binary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package builder
import (
"testing"

gbbgolang "github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/u-root/pkg/ulog/ulogtest"
"github.com/u-root/u-root/pkg/uroot/initramfs"
)
Expand All @@ -16,7 +16,7 @@ func TestBinaryBuild(t *testing.T) {
dir := t.TempDir()

opts := Opts{
Env: gbbgolang.Default(),
Env: golang.Default(golang.DisableCGO()),
Packages: []string{
"../test/foo",
"../../../cmds/core/elvish",
Expand All @@ -25,7 +25,7 @@ func TestBinaryBuild(t *testing.T) {
},
TempDir: dir,
BinaryDir: "bbin",
BuildOpts: &gbbgolang.BuildOpts{},
BuildOpts: &golang.BuildOpts{},
}
af := initramfs.NewFiles()
var b BinaryBuilder
Expand Down
6 changes: 3 additions & 3 deletions pkg/uroot/builder/gbb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package builder
import (
"testing"

gbbgolang "github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/u-root/pkg/ulog/ulogtest"
"github.com/u-root/u-root/pkg/uroot/initramfs"
)
Expand All @@ -16,14 +16,14 @@ func TestGBBBuild(t *testing.T) {
dir := t.TempDir()

opts := Opts{
Env: gbbgolang.Default(),
Env: golang.Default(golang.DisableCGO()),
Packages: []string{
"../test/foo",
"../../../cmds/core/elvish",
},
TempDir: dir,
BinaryDir: "bbin",
BuildOpts: &gbbgolang.BuildOpts{},
BuildOpts: &golang.BuildOpts{},
}
af := initramfs.NewFiles()
var gbb GBBBuilder
Expand Down
4 changes: 4 additions & 0 deletions pkg/uroot/uroot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"syscall"
"testing"

"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/u-root/pkg/cpio"
"github.com/u-root/u-root/pkg/ulog/ulogtest"
"github.com/u-root/u-root/pkg/uroot/builder"
Expand Down Expand Up @@ -49,6 +50,7 @@ func TestCreateInitramfs(t *testing.T) {
{
name: "BB archive with ls and init",
opts: Opts{
Env: golang.Default(golang.DisableCGO()),
TempDir: dir,
ExtraFiles: nil,
UseExistingInit: false,
Expand Down Expand Up @@ -98,6 +100,7 @@ func TestCreateInitramfs(t *testing.T) {
{
name: "init specified, but not in commands",
opts: Opts{
Env: golang.Default(golang.DisableCGO()),
TempDir: dir,
DefaultShell: "zoocar",
InitCmd: "foobar",
Expand Down Expand Up @@ -130,6 +133,7 @@ func TestCreateInitramfs(t *testing.T) {
{
name: "multi-mode archive",
opts: Opts{
Env: golang.Default(golang.DisableCGO()),
TempDir: dir,
ExtraFiles: nil,
UseExistingInit: false,
Expand Down

0 comments on commit 7f1affc

Please sign in to comment.