Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: TestScript/cgo_stale_precompiled fails with Clang 14.0.6 #64423

Closed
qiulaidongfeng opened this issue Nov 28, 2023 · 20 comments
Closed

cmd/go: TestScript/cgo_stale_precompiled fails with Clang 14.0.6 #64423

qiulaidongfeng opened this issue Nov 28, 2023 · 20 comments
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. OS-Windows release-blocker
Milestone

Comments

@qiulaidongfeng
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version devel go1.22-0c7e5d3 Thu Nov 23 17:33:57 2023 +0000 windows/amd64

Does this issue reproduce with the latest release?

yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\26454\AppData\Local\go-build
set GOENV=C:\Users\26454\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\file\gofile\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\file\gofile
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=D:\file\gofile\gogit\go1
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=local
set GOTOOLDIR=D:\file\gofile\gogit\go1\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=devel go1.22-0c7e5d3 Thu Nov 23 17:33:57 2023 +0000
set GCCGO=gccgo
set GOAMD64=v3
set AR=ar
set CC=clang
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\file\gofile\gogit\go1\src\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=D:\tmp\go-build2358295175=/tmp/go-build -gno-record-gcc-switches
GOROOT/bin/go version: go version devel go1.22-0c7e5d3b8db Thu Nov 23 17:33:57 2023 +0000 windows/amd64
GOROOT/bin/go tool compile -V: compile version devel go1.22-0c7e5d3b8db Thu Nov 23 17:33:57 2023 +0000
lldb --version: lldb version 14.0.6

What did you do?

clang get from https://winlibs.com/
GCC 12.1.0 + LLVM/Clang/LLD/LLDB 14.0.6 + MinGW-w64 10.0.0 (MSVCRT) - release 3

In cmd
cd $GOROOT/src

go test -v cmd/go -run=TestScript/cgo_stale_precompiled

What did you expect to see?

test pass.

What did you see instead?

Output
=== RUN   TestScript
vcs-test.golang.org rerouted to http://127.0.0.1:58678
https://vcs-test.golang.org rerouted to https://127.0.0.1:58679
go test proxy running at GOPROXY=http://127.0.0.1:58680/mod
=== RUN   TestScript/cgo_stale_precompiled
=== PAUSE TestScript/cgo_stale_precompiled
=== CONT  TestScript/cgo_stale_precompiled
    script_test.go:132: 2023-11-28T12:54:30Z
    script_test.go:134: $WORK=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692
    script_test.go:156:
        PATH=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\testbin;D:\file\gofile\gogit\go1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\26454\.go\current\bin;D:\file\gofile\bin;D:\goup;D:\cloc;D:\mingw64\bin;D:\Git\usr\bin;D:\pandoc;D:\Git\bin;D:\Git\mingw64\bin;D:\Graphviz\bin;D:\Microsoft VS Code\bin;C:\Users\26454\.pyenv\pyenv-win\bin;C:\Users\26454\.pyenv\pyenv-win\shims;C:\Users\26454\AppData\Local\Microsoft\WindowsApps
        USERPROFILE=/no-home
        CCACHE_DISABLE=1
        GOARCH=amd64
        TESTGO_GOHOSTARCH=amd64
        GOCACHE=C:\Users\26454\AppData\Local\go-build
        GOCOVERDIR=
        GODEBUG=
        GOEXE=.exe
        GOEXPERIMENT=
        GOOS=windows
        TESTGO_GOHOSTOS=windows
        GOPROXY=http://127.0.0.1:58680/mod
        GOPRIVATE=
        GOROOT=D:\file\gofile\gogit\go1
        GOROOT_FINAL=
        GOTRACEBACK=system
        TESTGO_GOROOT=D:\file\gofile\gogit\go1
        TESTGO_EXE=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\testbin\go.exe
        TESTGO_VCSTEST_HOST=127.0.0.1:58678
        TESTGO_VCSTEST_TLS_HOST=127.0.0.1:58679
        TESTGO_VCSTEST_CERT=D:\tmp\cmd-go-test-4091284344\vcstest3209162134\cert.pem
        TESTGONETWORK=panic
        GOSUMDB=localhost.localdev/sumdb+00000c67+AcTrnkbUA+TU4heY3hkjiSES/DSQniBqIeQ/YppAUtK6
        GONOPROXY=
        GONOSUMDB=
        GOVCS=*:all
        devnull=NUL
        goversion=1.22
        CMDGO_TEST_RUN_MAIN=true
        HGRCPATH=
        GOTOOLCHAIN=auto
        newline=
    SYSTEMROOT=C:\Windows
    WINDIR=C:\Windows
    CC=clang
    WORK=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692
    TMP=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp
    GOPATH=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath
    PWD=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath\src

    # Regression test for https://go.dev/issue/47215 and https://go.dev/issue/50183:
    # A mismatched $GOROOT_FINAL or missing $CC caused the C dependencies of the net
    # package to appear stale, and it could not be rebuilt due to a missing $CC. (0.000s)
    > [!cgo] skip
    [condition not met]
    # This test may start with the runtime/cgo package already stale.
    # Explicitly rebuild it to ensure that it is cached.
    # (See https://go.dev/issue/50892.)
    #
    # If running in non-short mode, explicitly vary CGO_CFLAGS
    # as a control case (to ensure that our regexps do catch rebuilds). (7.969s)
    > [!short] env GOCACHE=$WORK/cache
    > [!short] env CGO_CFLAGS=-DTestScript_cgo_stale_precompiled=true
    > go build -x runtime/cgo
    [stderr]
    WORK=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116
    mkdir -p $WORK\b006\
    echo '# import config' > $WORK\b006\importcfg # internal
    cd D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath\src
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b006\\_pkg_.a" -trimpath "$WORK\\b006=>" -p internal/race -std -complete -buildid wA_Ip2f74o08MJlWytIy/wA_Ip2f74o08MJlWytIy -c=4 -nolocalimports -importcfg "$WORK\\b006\\importcfg" -pack "D:\\file\\gofile\\gogit\\go1\\src\\internal\\race\\doc.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\race\\norace.go"
    mkdir -p $WORK\b004\
    echo '# import config' > $WORK\b004\importcfg # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b004\\_pkg_.a" -trimpath "$WORK\\b004=>" -p internal/goos -std -complete -buildid mWdc8cM2JQlYjg5a-2sD/mWdc8cM2JQlYjg5a-2sD -c=4 -nolocalimports -importcfg "$WORK\\b004\\importcfg" -pack "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goos\\goos.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goos\\nonunix.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goos\\zgoos_windows.go"
    mkdir -p $WORK\b013\
    mkdir -p $WORK\b003\
    echo '# import config' > $WORK\b013\importcfg # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b013\\_pkg_.a" -trimpath "$WORK\\b013=>" -p internal/godebugs -std -complete -buildid C1BlilVeS5imwj6pggFo/C1BlilVeS5imwj6pggFo -c=4 -nolocalimports -importcfg "$WORK\\b013\\importcfg" -pack "D:\\file\\gofile\\gogit\\go1\\src\\internal\\godebugs\\table.go"
    echo '# import config' > $WORK\b003\importcfg # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b003\\_pkg_.a" -trimpath "$WORK\\b003=>" -p internal/goarch -std -complete -buildid mYawrMWHfidTKBUIFGBV/mYawrMWHfidTKBUIFGBV -c=4 -nolocalimports -importcfg "$WORK\\b003\\importcfg" -pack "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goarch\\goarch.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goarch\\goarch_amd64.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goarch\\zgoarch_amd64.go"
    mkdir -p $WORK\b012\
    mkdir -p $WORK\b014\
    echo '# import config' > $WORK\b012\importcfg # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b012\\_pkg_.a" -trimpath "$WORK\\b012=>" -p internal/coverage/rtcov -std -complete -buildid uF-m-fiYC5iJd8dCUC6F/uF-m-fiYC5iJd8dCUC6F -c=4 -nolocalimports -importcfg "$WORK\\b012\\importcfg" -pack "D:\\file\\gofile\\gogit\\go1\\src\\internal\\coverage\\rtcov\\rtcov.go"
    echo '# import config' > $WORK\b014\importcfg # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b014\\_pkg_.a" -trimpath "$WORK\\b014=>" -p internal/goexperiment -std -complete -buildid gfoauPRmlumY8hoUIncJ/gfoauPRmlumY8hoUIncJ -c=4 -nolocalimports -importcfg "$WORK\\b014\\importcfg" -pack "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_allocheaders_on.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_arenas_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_boringcrypto_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_cacheprog_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_cgocheck2_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_coverageredesign_on.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_exectracer2_on.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_fieldtrack_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_heapminimum512kib_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_loopvar_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_newinliner_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_pagetrace_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_preemptibleloops_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_rangefunc_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_regabiargs_on.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_regabiwrappers_on.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\exp_staticlockranking_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\goexperiment\\flags.go"
    mkdir -p $WORK\b017\
    mkdir -p $WORK\b011\
    echo -n > $WORK\b017\go_asm.h # internal
    cd D:\file\gofile\gogit\go1\src\sync\atomic
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p sync/atomic -trimpath "$WORK\\b017=>" -I "$WORK\\b017\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -gensymabis -o "$WORK\\b017\\symabis" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\atomic\\asm.s"
    echo -n > $WORK\b011\go_asm.h # internal
    cd D:\file\gofile\gogit\go1\src\internal\cpu
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/cpu -trimpath "$WORK\\b011=>" -I "$WORK\\b011\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -gensymabis -o "$WORK\\b011\\symabis" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\cpu\\cpu.s" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\cpu\\cpu_x86.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b006\\_pkg_.a" # internal
    mkdir -p $WORK\b015\
    echo -n > $WORK\b015\go_asm.h # internal
    cd D:\file\gofile\gogit\go1\src\runtime\internal\atomic
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime/internal/atomic -trimpath "$WORK\\b015=>" -I "$WORK\\b015\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -gensymabis -o "$WORK\\b015\\symabis" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\atomic\\atomic_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b004\\_pkg_.a" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b012\\_pkg_.a" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b013\\_pkg_.a" # internal
    cp "$WORK\\b006\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\51\\514f7cd4d1f96515e4f80f46fe191ad3167f4773f733f792313463151e9ae972-d" # internal
    echo '# import config' > $WORK\b011\importcfg # internal
    cd D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath\src
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b011\\_pkg_.a" -trimpath "$WORK\\b011=>" -p internal/cpu -std -buildid tNUnh7LGg9Bn_PHS4LMg/tNUnh7LGg9Bn_PHS4LMg -symabis "$WORK\\b011\\symabis" -c=4 -nolocalimports -importcfg "$WORK\\b011\\importcfg" -pack -asmhdr "$WORK\\b011\\go_asm.h" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\cpu\\cpu.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\cpu\\cpu_x86.go"
    cp "$WORK\\b004\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\da\\da5656d87c0f831ad38d740470eaaff2e78b62d3732f2981094c79f01bc00e21-d" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b003\\_pkg_.a" # internal
    echo '# import config' > $WORK\b015\importcfg # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b015\\_pkg_.a" -trimpath "$WORK\\b015=>" -p runtime/internal/atomic -std -buildid Dt31cXYFLqGP276KIyn6/Dt31cXYFLqGP276KIyn6 -symabis "$WORK\\b015\\symabis" -c=4 -nolocalimports -importcfg "$WORK\\b015\\importcfg" -pack -asmhdr "$WORK\\b015\\go_asm.h" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\atomic\\atomic_amd64.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\atomic\\doc.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\atomic\\stubs.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\atomic\\types.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\atomic\\types_64bit.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\atomic\\unaligned.go"
    echo '# import config' > $WORK\b017\importcfg # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b017\\_pkg_.a" -trimpath "$WORK\\b017=>" -p sync/atomic -std -buildid mhtUAQk8n0T69-SIwS3n/mhtUAQk8n0T69-SIwS3n -symabis "$WORK\\b017\\symabis" -c=4 -nolocalimports -importcfg "$WORK\\b017\\importcfg" -pack -asmhdr "$WORK\\b017\\go_asm.h" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\atomic\\doc.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\atomic\\type.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\atomic\\value.go"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b014\\_pkg_.a" # internal
    cp "$WORK\\b013\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\12\\1298c463e264ea5f15add371ad8dbed0d3853eaa051ad506f75a39c0b4e9224e-d" # internal
    cp "$WORK\\b003\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\9d\\9dc4170292ccaedea1824e89850e1bda26ac4d6bb1a1fe7f4f02d3ba6f38213c-d" # internal
    mkdir -p $WORK\b016\
    mkdir -p $WORK\b002\
    cat >D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b002\importcfg << 'EOF' # internal
    # import config
    packagefile internal/goarch=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b003\_pkg_.a
    packagefile internal/goos=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b004\_pkg_.a
    EOF
    cat >D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b016\importcfg << 'EOF' # internal
    # import config
    packagefile internal/goarch=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b003\_pkg_.a
    EOF
    mkdir -p $WORK\b009\
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b002\\_pkg_.a" -trimpath "$WORK\\b002=>" -p runtime/internal/sys -std -complete -buildid 8fKN52ynhOPT3NTxQ5at/8fKN52ynhOPT3NTxQ5at -c=4 -nolocalimports -importcfg "$WORK\\b002\\importcfg" -pack "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\sys\\consts.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\sys\\consts_norace.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\sys\\intrinsics.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\sys\\nih.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\sys\\sys.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\sys\\zversion.go"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b016\\_pkg_.a" -trimpath "$WORK\\b016=>" -p runtime/internal/math -std -complete -buildid 16JusnPRLrtaRfUoNiAp/16JusnPRLrtaRfUoNiAp -c=4 -nolocalimports -importcfg "$WORK\\b016\\importcfg" -pack "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\math\\math.go"
    echo -n > $WORK\b009\go_asm.h # internal
    cd D:\file\gofile\gogit\go1\src\internal\abi
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/abi -trimpath "$WORK\\b009=>" -I "$WORK\\b009\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -gensymabis -o "$WORK\\b009\\symabis" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\abi_test.s" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\stub.s"
    cp "$WORK\\b012\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\1e\\1e51106ded792493cf7f10a22d9ed931074e155829efab98eaa508bb00aae83b-d" # internal
    cp "$WORK\\b014\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\cb\\cb9578d97f872b248b90b870ae48f354ccea4e8efb3d271deab28c47d68b8e0c-d" # internal
    cd D:\file\gofile\gogit\go1\src\internal\cpu
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/cpu -trimpath "$WORK\\b011=>" -I "$WORK\\b011\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b011\\cpu.o" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\cpu\\cpu.s"
    cd D:\file\gofile\gogit\go1\src\runtime\internal\atomic
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime/internal/atomic -trimpath "$WORK\\b015=>" -I "$WORK\\b015\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b015\\atomic_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\internal\\atomic\\atomic_amd64.s"
    cat >D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b009\importcfg << 'EOF' # internal
    # import config
    packagefile internal/goarch=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b003\_pkg_.a
    EOF
    cd D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath\src
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b009\\_pkg_.a" -trimpath "$WORK\\b009=>" -p internal/abi -std -buildid ISSuY1BgxQuFIPZOlTJI/ISSuY1BgxQuFIPZOlTJI -symabis "$WORK\\b009\\symabis" -c=4 -nolocalimports -importcfg "$WORK\\b009\\importcfg" -pack -asmhdr "$WORK\\b009\\go_asm.h" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\abi.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\abi_amd64.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\compiletype.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\funcpc.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\map.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\stack.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\switch.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\symtab.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\type.go"
    cd D:\file\gofile\gogit\go1\src\sync\atomic
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p sync/atomic -trimpath "$WORK\\b017=>" -I "$WORK\\b017\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b017\\asm.o" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\atomic\\asm.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b002\\_pkg_.a" # internal
    cd D:\file\gofile\gogit\go1\src\internal\cpu
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/cpu -trimpath "$WORK\\b011=>" -I "$WORK\\b011\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b011\\cpu_x86.o" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\cpu\\cpu_x86.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b016\\_pkg_.a" # internal
    cp "$WORK\\b002\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\9e\\9ef6fbe6b1437aeaddd788d3827bb3310eae28cdfad16a1095f940614b53b137-d" # internal
    cd D:\file\gofile\gogit\go1\src\sync\atomic
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\pack.exe" r "$WORK\\b017\\_pkg_.a" "$WORK\\b017\\asm.o" # internal
    cd D:\file\gofile\gogit\go1\src\internal\cpu
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\pack.exe" r "$WORK\\b011\\_pkg_.a" "$WORK\\b011\\cpu.o" "$WORK\\b011\\cpu_x86.o" # internal
    cd D:\file\gofile\gogit\go1\src\runtime\internal\atomic
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\pack.exe" r "$WORK\\b015\\_pkg_.a" "$WORK\\b015\\atomic_amd64.o" # internal
    cp "$WORK\\b016\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\3b\\3b604cd44780dd584c76fd3de7bdcec8f2da7bcaba98c5666bfd7f49793fb716-d" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b011\\_pkg_.a" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b015\\_pkg_.a" # internal
    cp "$WORK\\b011\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\eb\\eb9ffe5c80082359a6461ec963b870061757aeab75e0250534b1837f9620e043-d" # internal
    mkdir -p $WORK\b010\
    cp "$WORK\\b015\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\bf\\bf9ec6a99e62d9e00269f3cf5f23747c97acc8f6cc88439d164ebbe256a3e731-d" # internal
    echo -n > $WORK\b010\go_asm.h # internal
    cd D:\file\gofile\gogit\go1\src\internal\bytealg
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/bytealg -trimpath "$WORK\\b010=>" -I "$WORK\\b010\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -gensymabis -o "$WORK\\b010\\symabis" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\compare_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\count_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\equal_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\index_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\indexbyte_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b017\\_pkg_.a" # internal
    cat >D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b010\importcfg << 'EOF' # internal
    # import config
    packagefile internal/cpu=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b011\_pkg_.a
    EOF
    cd D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath\src
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b010\\_pkg_.a" -trimpath "$WORK\\b010=>" -p internal/bytealg -std -buildid FqXwIiv3lmAcuwcvCOUh/FqXwIiv3lmAcuwcvCOUh -symabis "$WORK\\b010\\symabis" -c=4 -nolocalimports -importcfg "$WORK\\b010\\importcfg" -pack -asmhdr "$WORK\\b010\\go_asm.h" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\bytealg.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\compare_native.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\count_native.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\equal_generic.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\equal_native.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\index_amd64.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\index_native.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\indexbyte_native.go" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\lastindexbyte_generic.go"
    cp "$WORK\\b017\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\21\\21eacb38fd0aacc29ddb5a8666c207fc4b90c5ef0f30e92c962efc9ba99a9513-d" # internal
    cd D:\file\gofile\gogit\go1\src\internal\abi
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/abi -trimpath "$WORK\\b009=>" -I "$WORK\\b009\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b009\\abi_test.o" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\abi_test.s"
    cd D:\file\gofile\gogit\go1\src\internal\bytealg
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/bytealg -trimpath "$WORK\\b010=>" -I "$WORK\\b010\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b010\\compare_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\compare_amd64.s"
    cd D:\file\gofile\gogit\go1\src\internal\abi
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/abi -trimpath "$WORK\\b009=>" -I "$WORK\\b009\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b009\\stub.o" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\abi\\stub.s"
    cd D:\file\gofile\gogit\go1\src\internal\bytealg
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/bytealg -trimpath "$WORK\\b010=>" -I "$WORK\\b010\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b010\\count_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\count_amd64.s"
    cd D:\file\gofile\gogit\go1\src\internal\abi
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\pack.exe" r "$WORK\\b009\\_pkg_.a" "$WORK\\b009\\abi_test.o" "$WORK\\b009\\stub.o" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b009\\_pkg_.a" # internal
    cd D:\file\gofile\gogit\go1\src\internal\bytealg
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/bytealg -trimpath "$WORK\\b010=>" -I "$WORK\\b010\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b010\\equal_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\equal_amd64.s"
    cp "$WORK\\b009\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\82\\82caf4bb65176c83dc2153887b902783c7dadf61ff8f327c8d2b96cb3f0010ed-d" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/bytealg -trimpath "$WORK\\b010=>" -I "$WORK\\b010\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b010\\index_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\index_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p internal/bytealg -trimpath "$WORK\\b010=>" -I "$WORK\\b010\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b010\\indexbyte_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\internal\\bytealg\\indexbyte_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\pack.exe" r "$WORK\\b010\\_pkg_.a" "$WORK\\b010\\compare_amd64.o" "$WORK\\b010\\count_amd64.o" "$WORK\\b010\\equal_amd64.o" "$WORK\\b010\\index_amd64.o" "$WORK\\b010\\indexbyte_amd64.o" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b010\\_pkg_.a" # internal
    cp "$WORK\\b010\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\92\\92c6c0b04fbb3297ca5fa32dee5f4d75522faa79f65f91a2be3962c4ef3c7deb-d" # internal
    mkdir -p $WORK\b008\
    echo -n > $WORK\b008\go_asm.h # internal
    cd D:\file\gofile\gogit\go1\src\runtime
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -gensymabis -o "$WORK\\b008\\symabis" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\asm.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\asm_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\duff_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\memclr_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\memmove_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\preempt_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\rt0_windows_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\sys_windows_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\test_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\time_windows_amd64.s" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\zcallback_windows.s"
    cat >D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b008\importcfg << 'EOF' # internal
    # import config
    packagefile internal/abi=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b009\_pkg_.a
    packagefile internal/bytealg=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b010\_pkg_.a
    packagefile internal/coverage/rtcov=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b012\_pkg_.a
    packagefile internal/cpu=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b011\_pkg_.a
    packagefile internal/goarch=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b003\_pkg_.a
    packagefile internal/godebugs=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b013\_pkg_.a
    packagefile internal/goexperiment=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b014\_pkg_.a
    packagefile internal/goos=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b004\_pkg_.a
    packagefile runtime/internal/atomic=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b015\_pkg_.a
    packagefile runtime/internal/math=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b016\_pkg_.a
    packagefile runtime/internal/sys=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b002\_pkg_.a
    EOF
    cd D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath\src
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b008\\_pkg_.a" -trimpath "$WORK\\b008=>" -p runtime -std -buildid -0YPNQSiYijbUD5K4SK6/-0YPNQSiYijbUD5K4SK6 -symabis "$WORK\\b008\\symabis" -c=4 -nolocalimports -importcfg "$WORK\\b008\\importcfg" -pack -asmhdr "$WORK\\b008\\go_asm.h" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\alg.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\arena.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\asan0.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\atomic_pointer.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\auxv_none.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgocall.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgocallback.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgocheck.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\chan.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\checkptr.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\compiler.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\complex.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\covercounter.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\covermeta.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cpuflags.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cpuflags_amd64.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cpuprof.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cputicks.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\create_file_nounix.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\debug.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\debugcall.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\debuglog.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\debuglog_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\defs_windows.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\defs_windows_amd64.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\env_posix.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\error.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\exithook.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\extern.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\fastlog2.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\fastlog2table.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\fds_nonunix.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\float.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\hash64.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\heapdump.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\histogram.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\iface.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\lfstack.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\lock_sema.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\lockrank.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\lockrank_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\malloc.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\map.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\map_fast32.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\map_fast64.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\map_faststr.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mbarrier.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mbitmap.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mbitmap_allocheaders.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mcache.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mcentral.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mcheckmark.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mem.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mem_windows.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\metrics.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mfinal.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mfixalloc.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mgc.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mgclimit.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mgcmark.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mgcpacer.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mgcscavenge.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mgcstack.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mgcsweep.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mgcwork.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mheap.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\minmax.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mpagealloc.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mpagealloc_64bit.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mpagecache.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mpallocbits.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mprof.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mranges.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\msan0.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\msize_allocheaders.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mspanset.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mstats.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\mwbbuf.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\netpoll.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\netpoll_windows.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\os_nonopenbsd.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\os_windows.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\pagetrace_off.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\panic.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\pinner.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\plugin.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\preempt.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\print.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\proc.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\profbuf.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\proflabel.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\race0.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\rdebug.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\runtime.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\runtime1.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\runtime2.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\runtime_boring.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\rwmutex.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\security_nonunix.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\select.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\sema.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\signal_windows.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\sigqueue.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\sigqueue_note.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\sizeclasses.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\slice.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\softfloat64.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\stack.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\stkframe.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\string.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\stubs.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\stubs3.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\stubs_amd64.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\stubs_nonlinux.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\symtab.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\symtabinl.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\sys_nonppc64x.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\sys_x86.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\syscall_windows.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\tagptr.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\tagptr_64bit.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\test_amd64.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\time.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\time_nofake.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\timeasm.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\tls_windows_amd64.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2buf.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2cpu.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2event.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2map.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2region.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2runtime.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2stack.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2status.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2string.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\trace2time.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\traceback.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\type.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\typekind.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\unsafe.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\utf8.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\vdso_in_none.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\write_err.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\zcallback_windows.go"
    cp D:\file\gofile\gogit\go1\src\runtime\asm_amd64.h $WORK\b008\asm_GOARCH.h
    cp D:\file\gofile\gogit\go1\src\runtime\time_windows.h $WORK\b008\time_GOOS.h
    cd D:\file\gofile\gogit\go1\src\runtime
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\asm.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\asm.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\asm_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\asm_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\duff_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\duff_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\memclr_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\memclr_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\memmove_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\memmove_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\preempt_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\preempt_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\rt0_windows_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\rt0_windows_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\sys_windows_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\sys_windows_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\test_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\test_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\time_windows_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\time_windows_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime -trimpath "$WORK\\b008=>" -I "$WORK\\b008\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b008\\zcallback_windows.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\zcallback_windows.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\pack.exe" r "$WORK\\b008\\_pkg_.a" "$WORK\\b008\\asm.o" "$WORK\\b008\\asm_amd64.o" "$WORK\\b008\\duff_amd64.o" "$WORK\\b008\\memclr_amd64.o" "$WORK\\b008\\memmove_amd64.o" "$WORK\\b008\\preempt_amd64.o" "$WORK\\b008\\rt0_windows_amd64.o" "$WORK\\b008\\sys_windows_amd64.o" "$WORK\\b008\\test_amd64.o" "$WORK\\b008\\time_windows_amd64.o" "$WORK\\b008\\zcallback_windows.o" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b008\\_pkg_.a" # internal
    cp "$WORK\\b008\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\3a\\3af2bd05102c69576cf680bcd0732b7a3616fd452c0779a8f593a6e460946bc8-d" # internal
    mkdir -p $WORK\b005\
    cat >D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b005\importcfg << 'EOF' # internal
    # import config
    packagefile internal/race=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b006\_pkg_.a
    packagefile runtime=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b008\_pkg_.a
    packagefile sync/atomic=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b017\_pkg_.a
    EOF
    cd D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath\src
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b005\\_pkg_.a" -trimpath "$WORK\\b005=>" -p sync -std -buildid WspzEb2xN84xx4Nc1oC2/WspzEb2xN84xx4Nc1oC2 -c=4 -nolocalimports -importcfg "$WORK\\b005\\importcfg" -pack "D:\\file\\gofile\\gogit\\go1\\src\\sync\\cond.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\map.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\mutex.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\once.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\oncefunc.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\pool.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\poolqueue.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\runtime.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\runtime2.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\rwmutex.go" "D:\\file\\gofile\\gogit\\go1\\src\\sync\\waitgroup.go"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b005\\_pkg_.a" # internal
    cp "$WORK\\b005\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\0e\\0ed0d9b48f621a411141c178c78f6289d54c353c7a281f9c701dd392559c1b92-d" # internal
    mkdir -p $WORK\b001\
    cd D:\file\gofile\gogit\go1\src\runtime\cgo
    TERM='dumb' CGO_LDFLAGS='"-O2" "-g"' "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\cgo.exe" -objdir "$WORK\\b001\\" -importpath runtime/cgo -import_runtime_cgo=false -import_syscall=false -- -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo\\cgo.go"
    cd $WORK
    clang -fno-caret-diagnostics -DTestScript_cgo_stale_precompiled=true -c -x c - -o "$WORK\\459014769" || true
    clang -Qunused-arguments -DTestScript_cgo_stale_precompiled=true -c -x c - -o "$WORK\\361511513" || true
    clang -Wl,--no-gc-sections -O2 -g -x c - -o "$WORK\\71218907" || true
    clang -fdebug-prefix-map=a=b -DTestScript_cgo_stale_precompiled=true -c -x c - -o "$WORK\\394332771" || true
    clang -ffile-prefix-map=a=b -DTestScript_cgo_stale_precompiled=true -c -x c - -o "$WORK\\4125642766" || true
    clang -gno-record-gcc-switches -DTestScript_cgo_stale_precompiled=true -c -x c - -o "$WORK\\797597432" || true
    clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -frandom-seed=1 -DTestScript_cgo_stale_precompiled=true -c -x c - -o "$WORK\\93929970" || true
    cd $WORK\b001
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "-ffile-prefix-map=D:\\file\\gofile\\gogit\\go1=\\\\_\\_\\GOROOT" -frandom-seed=bb16-FlvYU5UZusBjKWr -o "$WORK\\b001\\_x001.o" -c _cgo_export.c
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "-ffile-prefix-map=D:\\file\\gofile\\gogit\\go1=\\\\_\\_\\GOROOT" -frandom-seed=bb16-FlvYU5UZusBjKWr -o "$WORK\\b001\\_x002.o" -c cgo.cgo2.c
    cd D:\file\gofile\gogit\go1\src\runtime\cgo
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "-ffile-prefix-map=D:\\file\\gofile\\gogit\\go1=\\\\_\\_\\GOROOT" -frandom-seed=bb16-FlvYU5UZusBjKWr -o "$WORK\\b001\\_x003.o" -c gcc_context.c
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "-ffile-prefix-map=D:\\file\\gofile\\gogit\\go1=\\\\_\\_\\GOROOT" -frandom-seed=bb16-FlvYU5UZusBjKWr -o "$WORK\\b001\\_x004.o" -c gcc_libinit_windows.c
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "-ffile-prefix-map=D:\\file\\gofile\\gogit\\go1=\\\\_\\_\\GOROOT" -frandom-seed=bb16-FlvYU5UZusBjKWr -o "$WORK\\b001\\_x005.o" -c gcc_stack_windows.c
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "-ffile-prefix-map=D:\\file\\gofile\\gogit\\go1=\\\\_\\_\\GOROOT" -frandom-seed=bb16-FlvYU5UZusBjKWr -o "$WORK\\b001\\_x006.o" -c gcc_util.c
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "-ffile-prefix-map=D:\\file\\gofile\\gogit\\go1=\\\\_\\_\\GOROOT" -frandom-seed=bb16-FlvYU5UZusBjKWr -o "$WORK\\b001\\_x007.o" -c gcc_windows_amd64.c
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "-ffile-prefix-map=D:\\file\\gofile\\gogit\\go1=\\\\_\\_\\GOROOT" -frandom-seed=bb16-FlvYU5UZusBjKWr -o "$WORK\\b001\\_x008.o" -c gcc_amd64.S
    cd $WORK\b001
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "-ffile-prefix-map=D:\\file\\gofile\\gogit\\go1=\\\\_\\_\\GOROOT" -frandom-seed=bb16-FlvYU5UZusBjKWr -o "$WORK\\b001\\_cgo_main.o" -c _cgo_main.c
    cd D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath\src
    TERM='dumb' clang -I "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo" -m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 "-ffile-prefix-map=$WORK\\b001=/tmp/go-build" -gno-record-gcc-switches -o "$WORK\\b001\\_cgo_.o" "$WORK\\b001\\_cgo_main.o" "$WORK\\b001\\_x001.o" "$WORK\\b001\\_x002.o" "$WORK\\b001\\_x003.o" "$WORK\\b001\\_x004.o" "$WORK\\b001\\_x005.o" "$WORK\\b001\\_x006.o" "$WORK\\b001\\_x007.o" "$WORK\\b001\\_x008.o" -O2 -g
    TERM='dumb' "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\cgo.exe" -dynpackage cgo -dynimport "$WORK\\b001\\_cgo_.o" -dynout "$WORK\\b001\\_cgo_import.go" -dynlinker
    echo -n > $WORK\b001\go_asm.h # internal
    cd D:\file\gofile\gogit\go1\src\runtime\cgo
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime/cgo -trimpath "$WORK\\b001=>" -I "$WORK\\b001\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -gensymabis -o "$WORK\\b001\\symabis" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo\\asm_amd64.s"
    cat >D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b001\importcfg << 'EOF' # internal
    # import config
    packagefile runtime/internal/sys=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b002\_pkg_.a
    packagefile sync=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b005\_pkg_.a
    packagefile sync/atomic=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build87412116\b017\_pkg_.a
    EOF
    cd D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\gopath\src
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b001\\_pkg_.a" -trimpath "$WORK\\b001=>" -p runtime/cgo -std -buildid bb16-FlvYU5UZusBjKWr/bb16-FlvYU5UZusBjKWr -symabis "$WORK\\b001\\symabis" -c=4 -nolocalimports -importcfg "$WORK\\b001\\importcfg" -pack -asmhdr "$WORK\\b001\\go_asm.h" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo\\callbacks.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo\\handle.go" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo\\iscgo.go" "$WORK\\b001\\_cgo_gotypes.go" "$WORK\\b001\\cgo.cgo1.go" "$WORK\\b001\\_cgo_import.go"
    cp D:\file\gofile\gogit\go1\src\runtime\cgo\abi_amd64.h $WORK\b001\abi_GOARCH.h
    cp D:\file\gofile\gogit\go1\src\runtime\cgo\libcgo_windows.h $WORK\b001\libcgo_GOOS.h
    cd D:\file\gofile\gogit\go1\src\runtime\cgo
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\asm.exe" -p runtime/cgo -trimpath "$WORK\\b001=>" -I "$WORK\\b001\\" -I "D:\\file\\gofile\\gogit\\go1\\pkg\\include" -D GOOS_windows -D GOARCH_amd64 -D GOAMD64_v3 -o "$WORK\\b001\\asm_amd64.o" "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo\\asm_amd64.s"
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\pack.exe" r "$WORK\\b001\\_pkg_.a" "$WORK\\b001\\asm_amd64.o" "$WORK\\b001\\_x001.o" "$WORK\\b001\\_x002.o" "$WORK\\b001\\_x003.o" "$WORK\\b001\\_x004.o" "$WORK\\b001\\_x005.o" "$WORK\\b001\\_x006.o" "$WORK\\b001\\_x007.o" "$WORK\\b001\\_x008.o" # internal
    "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b001\\_pkg_.a" # internal
    cp "$WORK\\b001\\_pkg_.a" "D:\\tmp\\cmd-go-test-4091284344\\tmpdir3678228600\\cgo_stale_precompiled1831572692\\cache\\e5\\e511a06a586a9e5440d20fddd3914d35e578f6e0f04dddaf397f03fd5f48eaf3-d" # internal
    > [!short] stderr '[/\\]cgo'$GOEXE'["]? .* -importpath runtime/cgo'
    matched: TERM='dumb' CGO_LDFLAGS='"-O2" "-g"' "D:\\file\\gofile\\gogit\\go1\\pkg\\tool\\windows_amd64\\cgo.exe" -objdir "$WORK\\b001\\" -importpath runtime/cgo -import_runtime_cgo=false -import_syscall=false -- -I "$WORK\\b001\\" -DTestScript_cgo_stale_precompiled=true -Wall -Werror -fno-stack-protector "D:\\file\\gofile\\gogit\\go1\\src\\runtime\\cgo\\cgo.go"
    # https://go.dev/issue/50183: a mismatched GOROOT_FINAL caused net to be stale. (0.314s)
    > env oldGOROOT_FINAL=$GOROOT_FINAL
    > env GOROOT_FINAL=$WORK${/}goroot
    > go build -x runtime/cgo
    [stderr]
    WORK=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build2053230933
    > ! stderr '[/\\]cgo'$GOEXE'["]? .* -importpath runtime/cgo'
    > env GOROOT_FINAL=$oldGOROOT_FINAL
    # https://go.dev/issue/47215: a missing $(go env CC) caused the precompiled net
    # to be stale. But as of https://go.dev/cl/452457 the precompiled libraries are
    # no longer installed anyway! Since we're requiring a C compiler in order to
    # build and use cgo libraries in the standard library, we should make sure it
    # matches what's in the cache. (0.264s)
    > [!abscc] env CGO_ENABLED=1
    > [!abscc] [!GOOS:plan9] env PATH=''  # Guaranteed not to include $(go env CC)!
    > [!abscc] [GOOS:plan9] env path=''
    [condition not met]
    > [!abscc] ! go build -x runtime/cgo
    [stderr]
    WORK=D:\tmp\cmd-go-test-4091284344\tmpdir3678228600\cgo_stale_precompiled1831572692\tmp\go-build4014792384
script_test.go:156: FAIL: testdata\script\cgo_stale_precompiled.txt:35: go build -x runtime/cgo: unexpected success

--- FAIL: TestScript (8.69s)
--- FAIL: TestScript/cgo_stale_precompiled (8.64s)
FAIL
FAIL cmd/go 10.987s
FAIL

@dmitshur dmitshur added OS-Windows NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Nov 28, 2023
@dmitshur dmitshur added this to the Backlog milestone Nov 28, 2023
@dmitshur
Copy link
Contributor

CC @golang/windows, @bcmills.

@bcmills
Copy link
Contributor

bcmills commented Nov 28, 2023

I suspect that this is a bug in work.Builder.gccToolID.

We invoke it to compute the cache ID, but if it fails we currently omit that ID from the cache inputs instead of erroring out or caching the error text:
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/work/exec.go;l=292-296;drc=4956c3437bd2f4448bcec51321f123d03731ddfc

That seems like a bug.

@dagood
Copy link
Contributor

dagood commented Nov 28, 2023

I'm not able to reproduce. gotip test -v cmd/go -run=TestScript/cgo_stale_precompiled -count 1 passes for me with go version devel go1.22-7ccddf040a Tue Nov 28 16:40:32 2023 +0000 windows/amd64 using winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3.

Maybe the output of gcc -### -x c -c - with LC_ALL=C on the machine is unexpected due to some other configuration/env that isn't accounted for?

My gcc output
Using built-in specs.
COLLECT_GCC=C:\tools\mingw\winlibs\winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3\mingw64\bin\gcc.exe
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/r/winlibs64_stage/18080.gcc/inst_gcc-12.1.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-msvcrt-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,jit --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --enable-libstdcxx-time --disable-libstdcxx-pch --with-mpc=/d/Prog/winlibs64_stage/custombuilt --with-mpfr=/d/Prog/winlibs64_stage/custombuilt --with-gmp=/d/Prog/winlibs64_stage/custombuilt --with-isl=/d/Prog/winlibs64_stage/custombuilt --enable-libstdcxx-backtrace --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/r/winlibs64_stage/18080.gcc/gcc-12.1.0/build_mingw/mingw-w64 CFLAGS=-I/d/Prog/winlibs64_stage/custombuilt/include/libdl-win32 LDFLAGS='-Wl,--disable-nxcompat -Wl,--disable-high-entropy-va -Wl,--disable-dynamicbase'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.1.0 (MinGW-W64 x86_64-msvcrt-posix-seh, built by Brecht Sanders)
COLLECT_GCC_OPTIONS='-c' '-mtune=generic' '-march=x86-64'
 "c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.1.0/cc1.exe" -quiet -iprefix "c:\\tools\\mingw\\winlibs\\winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3\\mingw64\\bin\\../lib/gcc/x86_64-w64-mingw32/12.1.0/" -D_REENTRANT - -quiet -dumpbase - "-mtune=generic" "-march=x86-64" -o "C:\\Users\\dagood\\AppData\\Local\\Temp\\ccpWkUxe.s"
COLLECT_GCC_OPTIONS='-c' '-mtune=generic' '-march=x86-64'
 "c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/as.exe" -o -.o "C:\\Users\\dagood\\AppData\\Local\\Temp\\ccpWkUxe.s"
COMPILER_PATH=c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.1.0/;c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../libexec/gcc/;c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/;c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../lib/gcc/;c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/lib/../lib/;c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../lib/;c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/lib/;c:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../
COLLECT_GCC_OPTIONS='-c' '-mtune=generic' '-march=x86-64'

@dagood
Copy link
Contributor

dagood commented Nov 28, 2023

Just after posting that, I realized I forgot to configure CC=clang. Now it repros! It looks like it can't find version hidden far in the first line.

$ clang -### -x c -c -
(built by Brecht Sanders) clang version 14.0.6
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin
 (in-process)
 "C:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/bin/clang.exe" "-cc1" "-triple" "x86_64-w64-windows-gnu" "-emit-obj" "-mrelax-all" "--mrelax-relocations" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "-" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=none" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-mms-bitfields" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=C:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3" "-resource-dir" "C:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/lib/clang/14.0.6" "-internal-isystem" "C:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/lib/clang/14.0.6/include" "-internal-isystem" "C:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/x86_64-w64-mingw32/sys-root/mingw/include" "-internal-isystem" "C:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/x86_64-w64-mingw32/include" "-internal-isystem" "C:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3/mingw64/include" "-fdebug-compilation-dir=C:/tools/mingw/winlibs/winlibs-x86_64-posix-seh-gcc-12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3" "-ferror-limit" "19" "-fmessage-length=210" "-fno-use-cxa-atexit" "-fgnuc-version=4.2.1" "-exception-model=seh" "-fcolor-diagnostics" "-faddrsig" "-o" "-.o" "-x" "c" "-"

@bcmills
Copy link
Contributor

bcmills commented Nov 28, 2023

Yep, it's not expecting the (built by Brecht Sanders) prefix there. 🤔

@dagood
Copy link
Contributor

dagood commented Nov 28, 2023

I think https://github.com/llvm/llvm-project/blob/3a6f02a6581b49b269710eea944dc114166403ed/clang/lib/Basic/Version.cpp#L95-L97 means that any build of clang that sets VENDOR will have a bespoke prefix, not great for this type of detection. 😕

An official clang is just clang version 17.0.1. Since LLVM provides builds for Windows, it may be rare to see VENDOR being used here.

On Mac, https://stackoverflow.com/a/70697937 says its clang (Xcode's build of clang?) may give you Apple LLVM version 9.1.0 (clang-902.0.39.1), and another answer mentions Apple clang version 11.0.0 (clang-1100.0.33.16). I'm curious if this test failure would also repro on a Mac, but I don't have one. I'm surprised this wouldn't have already been reported, so maybe this is all wrong.

I haven't traced the code down to know for certain that this is the code path being used, it just seems reasonable.

I assume the buildid.go loop only checks fields 1 and 2 to avoid false positives. I'm not sure what a good fix would be without risk. Keep track of a loose match in the loop so if no perfect match is found, it falls back to the first line with a version field anywhere?

@bcmills
Copy link
Contributor

bcmills commented Nov 28, 2023

I'm curious if this test failure would also repro on a Mac, but I don't have one. I'm surprised this wouldn't have already been reported, so maybe this is all wrong.

It appears to be passing on the Go project's macOS builders — I see a passing run in https://results.usercontent.cr.dev/invocations/build-8763160122012974529/tests/cmd%2Fgo.TestScript%2Fcgo_stale_precompiled/results/bc3b68df-24354/artifacts/output?token=AXsiX2kiOiIxNzAxMjA3OTY1NjgwIiwiX3giOiIzNjAwMDAwIn2mPsMH_r8cNPO3GylSLoU3W2t2sCM_9iRp8sl88xW4jQ, for example.

I suspect that's because strings.Fields treats Apple as only a single token. Probably we should be counting tokens from the end of the line instead of the beginning?

@dagood
Copy link
Contributor

dagood commented Nov 28, 2023

Ah, yep, I got mixed up, it makes sense that it works in those cases. Also didn't realize those builders used clang!

Probably we should be counting tokens from the end of the line instead of the beginning?

Maybe, but I've also seen a varying number of spaces from getClangFullRepositoryVersion:

  • https://stackoverflow.com/q/33193667 mentions clang version 3.8.0 (http://llvm.org/git/clang.git e2c22771566f2f28db1f4a9b2b0191ff9f2ae90c) (http://llvm.org/git/llvm.git 7a2d52ce5de3372b030c296bbfe70dedb29b46d3), and using multiple repos seems to still be supported in that code.
  • https://stackoverflow.com/q/26421690 mentions Apple LLVM version 6.0 (clang-600.0.34.4) (based on LLVM 3.5svn). That's old, but it seems possible someone's still putting extra spaces into LLVM_REVISION somewhere to try to make it human readable.

However, could chain these together: look for version as field 1 or 2, or len-2, len-3, len-4, then pick any line that has version as a field.


I noticed that you can already force a false positive with the current logic by putting the compiler in a directory with <space>version<space> in its name, like this:

$ clang.exe -### -x c -c -
(built by Brecht Sanders) clang version 14.0.6
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/tools/mingw/winlibs/my version selection/[...]
 (in-process)
[...]

The test passes, but the logic seems like it must be picking up the InstalledDir line. The full compiler path is a decent amount of information, so maybe it's ok for this purpose anyway.


I'm wondering now if there's something different that can be done here, like run the clang preprocessor to unambiguously grab __clang_version__. (Although that specifically misses the vendor, which might be important to trigger rebuilds when using multiple C compilers on the same machine.)

@dagood
Copy link
Contributor

dagood commented Dec 1, 2023

I'm wondering now if there's something different that can be done here, like run the clang preprocessor to unambiguously grab __clang_version__. (Although that specifically misses the vendor[...]

Ah, of course we could get the full string if we get __clang_version__ by preprocessing and run clang.exe -### -x c -c -, then look for the first line that includes version <__clang_version__>, if it's worth accounting for that.

@bcmills
Copy link
Contributor

bcmills commented Dec 5, 2023

Huh. I can also reproduce this failure with Clang on Linux:

~/go-review/src$ go env
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/usr/local/google/home/bcmills/.cache/go-build'
GOENV='/usr/local/google/home/bcmills/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/usr/local/google/home/bcmills/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/usr/local/google/home/bcmills'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/google/home/bcmills/go-review'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/google/home/bcmills/go-review/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.22-818de275c0 Mon Dec 4 19:27:31 2023 +0000'
GCCGO='/usr/bin/gccgo'
GOAMD64='v1'
AR='ar'
CC='/usr/bin/clang'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/usr/local/google/home/bcmills/go-review/src/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build593432539=/tmp/go-build -gno-record-gcc-switches'

~/go-review/src$ $(go env CC) --version
Debian clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

~/go-review/src$ go test cmd/go -run=TestScript/cgo_stale_precompiled -count=1
vcs-test.golang.org rerouted to http://127.0.0.1:41485
https://vcs-test.golang.org rerouted to https://127.0.0.1:43539
go test proxy running at GOPROXY=http://127.0.0.1:42183/mod
--- FAIL: TestScript (0.03s)
    --- FAIL: TestScript/cgo_stale_precompiled (4.60s)
        script_test.go:132: 2023-12-05T17:50:42Z
        script_test.go:134: $WORK=/tmp/cmd-go-test-3204175725/tmpdir82752789/cgo_stale_precompiled3093312852
        script_test.go:156:
            # Regression test for https://go.dev/issue/47215 and https://go.dev/issue/50183:
            # A mismatched $GOROOT_FINAL or missing $CC caused the C dependencies of the net
            # package to appear stale, and it could not be rebuilt due to a missing $CC. (0.000s)
            # This test may start with the runtime/cgo package already stale.
            # Explicitly rebuild it to ensure that it is cached.
            # (See https://go.dev/issue/50892.)
            #
            # If running in non-short mode, explicitly vary CGO_CFLAGS
            # as a control case (to ensure that our regexps do catch rebuilds). (4.363s)
            # https://go.dev/issue/50183: a mismatched GOROOT_FINAL caused net to be stale. (0.103s)
            # https://go.dev/issue/47215: a missing $(go env CC) caused the precompiled net
            # to be stale. But as of https://go.dev/cl/452457 the precompiled libraries are
            # no longer installed anyway! Since we're requiring a C compiler in order to
            # build and use cgo libraries in the standard library, we should make sure it
            # matches what's in the cache. (0.102s)
            > [!abscc] env CGO_ENABLED=1
            > [!abscc] [!GOOS:plan9] env PATH=''  # Guaranteed not to include $(go env CC)!
            > [!abscc] [GOOS:plan9] env path=''
            [condition not met]
            > [!abscc] ! go build -x runtime/cgo
            [stderr]
            WORK=/tmp/cmd-go-test-3204175725/tmpdir82752789/cgo_stale_precompiled3093312852/tmp/go-build4109618470
        script_test.go:156: FAIL: testdata/script/cgo_stale_precompiled.txt:35: go build -x runtime/cgo: unexpected success
FAIL
FAIL    cmd/go  4.742s
FAIL

@bcmills
Copy link
Contributor

bcmills commented Dec 5, 2023

Now I'm wondering why it's not failing on the linux-amd64-clang builder. 😅

@bcmills
Copy link
Contributor

bcmills commented Dec 5, 2023

That's why: its clang is very old.

root@buildlet-linux-amd64-clang-rn5d265e6:~# clang --version
clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@bcmills bcmills changed the title cmd/go: TestScript/cgo_stale_precompiled fail in windows with clang 14.0.6 cmd/go: TestScript/cgo_stale_precompiled fails with Clang 14.0.6 Dec 5, 2023
@dagood
Copy link
Contributor

dagood commented Dec 5, 2023

Debian clang version 14.0.6

Shouldn't this have worked because version is fields[2]? Or is this a different root cause?

Either way, I guess it indicates a better general solution is needed.

@bcmills
Copy link
Contributor

bcmills commented Dec 5, 2023

Marking as release-blocker because this test failure indicates a substantial compatibility problem with modern versions of a widely-used C toolchain.

@bcmills bcmills modified the milestones: Backlog, Go1.22 Dec 5, 2023
@dagood
Copy link
Contributor

dagood commented Dec 5, 2023

I think the full path in CC might be the cause in that case--here's what I get on Linux:

$ bin/go version
go version devel go1.22-af5d544b6d Tue Dec 5 18:18:13 2023 +0000 linux/amd64
$ clang --version
clang version 15.0.7 (Fedora 15.0.7-2.fc37)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ CC=gcc bin/go test cmd/go -run=TestScript/cgo_stale_precompiled -count=1
ok      cmd/go  2.403s                                                                                                                                           
$ CC=clang bin/go test cmd/go -run=TestScript/cgo_stale_precompiled -count=1
ok      cmd/go  2.702s
$ CC=/usr/bin/clang bin/go test cmd/go -run=TestScript/cgo_stale_precompiled -count=1
        script_test.go:156: FAIL: testdata/script/cgo_stale_precompiled.txt:35: go build -x runtime/cgo: unexpected success
...

@bcmills
Copy link
Contributor

bcmills commented Dec 6, 2023

Ah, that one is a test bug: we were forgetting to remove an explicit $CC from the environment. That seems to be separate from the cache-key bug, which I can reproduce by injecting a prefix to the version string using a -toolexec wrapper.

@bcmills
Copy link
Contributor

bcmills commented Dec 6, 2023

I have a fix, but it's hard to write a regression test because of other bugs (#64580). 😞

@gopherbot
Copy link

Change https://go.dev/cl/547998 mentions this issue: cmd/go: accept clang versions with vendor prefixes

@gopherbot
Copy link

Change https://go.dev/cl/547997 mentions this issue: cmd/go: unset CC when we remove it from PATH in TestScript/cgo_stale_precompiled

@bcmills bcmills added FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. labels Dec 6, 2023
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 6, 2023
gopherbot pushed a commit that referenced this issue Dec 7, 2023
…precompiled

Otherwise, if make.bash produced a relative default CC path but the
user has an absolute path to CC set in their environment, the test
will fail spuriously.

For #64423.

Change-Id: I0f3e1d04851585e1b39266badcda9f17489332d9
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/547997
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
@gopherbot
Copy link

Change https://go.dev/cl/548120 mentions this issue: cmd/go: relax version regexp from CL 547998

gopherbot pushed a commit that referenced this issue Dec 8, 2023
In CL 547998 I relaxed cmd/go's parsing of version lines to allow it
to recognize clang versions with vendor prefixes. To prevent false-positives,
I added a check for a version 3-tuple following the word "version".
However, it appears that some releases of GCC use only a 2-tuple instead.

Updates #64423.
Fixes #64619.

Change-Id: I5f1d0881b6295544a46ab958c6ad4c2155cf51fe
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/548120
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
ezz-no pushed a commit to ezz-no/go-ezzno that referenced this issue Feb 18, 2024
…precompiled

Otherwise, if make.bash produced a relative default CC path but the
user has an absolute path to CC set in their environment, the test
will fail spuriously.

For golang#64423.

Change-Id: I0f3e1d04851585e1b39266badcda9f17489332d9
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/547997
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
ezz-no pushed a commit to ezz-no/go-ezzno that referenced this issue Feb 18, 2024
To better diagnose bugs like this one in the future, I think
we should also refuse to use a C compiler if we can't identify
a sensible version for it. I did not do that in this CL because
I want it to be small and low-risk for possible backporting.

Fixes golang#64423.

Change-Id: I21e44fc55f6fcf76633e4fecf6400c226a742351
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/547998
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
ezz-no pushed a commit to ezz-no/go-ezzno that referenced this issue Feb 18, 2024
In CL 547998 I relaxed cmd/go's parsing of version lines to allow it
to recognize clang versions with vendor prefixes. To prevent false-positives,
I added a check for a version 3-tuple following the word "version".
However, it appears that some releases of GCC use only a 2-tuple instead.

Updates golang#64423.
Fixes golang#64619.

Change-Id: I5f1d0881b6295544a46ab958c6ad4c2155cf51fe
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/548120
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. OS-Windows release-blocker
Projects
Development

No branches or pull requests

5 participants