Skip to content

cmd/compile: TestScript doesn't work with GOARCH=386 #72800

@randall77

Description

@randall77

Run (on linux):

cd src
GOARCH=386 ./all.bash

This fails on two packages with script tests:

--- FAIL: TestScript (0.02s)
    --- FAIL: TestScript/README (0.00s)
        readme.go:43: /usr/local/google/home/khr/sandbox/tmp/bin/go doc cmd/internal/script : exit status 2
    --- FAIL: TestScript/issue70173 (0.04s)
        run.go:223: 2025-03-11T20:41:11Z
        run.go:225: $WORK=/tmp/TestScriptissue701733149297723/001
        run.go:232: 
            > go run main.go
            [stderr]
            go: no such tool "compile"
        run.go:232: FAIL: testdata/script/issue70173.txt:1: go run main.go: exit status 2
    --- FAIL: TestScript/script_test_basics (0.04s)
        run.go:223: 2025-03-11T20:41:11Z
        run.go:225: $WORK=/tmp/TestScriptscript_test_basics12210642/001
        run.go:232: 
            # Test of the linker's script test harness. (0.038s)
            > go build
            [stderr]
            go: no such tool "compile"
        run.go:232: FAIL: testdata/script/script_test_basics.txt:4: go build: exit status 2
    --- FAIL: TestScript/embedbad (0.05s)
        run.go:223: 2025-03-11T20:41:11Z
        run.go:225: $WORK=/tmp/TestScriptembedbad4008521766/001
        run.go:232: 
            # Check that compiler does not silently crash at bad embed error. (0.045s)
            > ! go build
            [stderr]
            go: no such tool "compile"
            [exit status 2]
            > stderr 'multiple files for type string'
        run.go:232: FAIL: testdata/script/embedbad.txt:4: stderr 'multiple files for type string': no match for `(?m)multiple files for type string` in stderr
FAIL
FAIL	cmd/compile	0.080s
--- FAIL: TestScript (0.06s)
    --- FAIL: TestScript/README (0.01s)
        readme.go:43: /usr/local/google/home/khr/sandbox/tmp/bin/go doc cmd/internal/script : exit status 2
    --- FAIL: TestScript/script_test_basics (0.08s)
        run.go:223: 2025-03-11T20:41:25Z
        run.go:225: $WORK=/tmp/TestScriptscript_test_basics1513812270/001
        run.go:232: 
            # Test of the linker's script test harness. (0.075s)
            > go build
            [stderr]
            go: no such tool "compile"
        run.go:232: FAIL: testdata/script/script_test_basics.txt:4: go build: exit status 2
FAIL
FAIL	cmd/link	1.155s

I think the operative error is "no such tool "compile"", which leads be to believe the test is trying to find the wrong (the 64-bit?) compile and failing.

I'm not sure why the trybots aren't failing on this. Maybe I am holding it wrong? Is GOARCH=386 ./all.bash not the right way to test?

Also setting GOHOSTARCH=386 seems to fix the problem. Maybe that's what I should be doing? Maybe that's what the trybots are doing?

@thanm

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions