Problem building Go compiler from source code

I followed the instruction at https://golang.org/doc/install/source to build Go compiler from the source code on my Windows 10’s WSL, and I got the following error:

./all.bash

> Building Go toolchain1 using /usr/local/go.
> Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
> Building Go toolchain2 using go_bootstrap and Go toolchain1.
> Building Go toolchain3 using go_bootstrap and Go toolchain2.
> go install go/token: copying /tmp/go-build3158513450/b083/_pkg_.a: open /mnt/d/software_dev/go/Go_compiler/goroot/pkg/linux_amd64/go/token.a: no such file or directory
> go install cmd/internal/obj/s390x: copying /tmp/go-build3158513450/b063/_pkg_.a: open /mnt/d/software_dev/go/Go_compiler/goroot/pkg/linux_amd64/cmd/internal/obj/s390x.a: no such file or directory
> go tool dist: FAILED: /mnt/d/software_dev/go/Go_compiler/goroot/pkg/tool/linux_amd64/go_bootstrap install -gcflags=all= -ldflags=all= -a -i cmd/asm cmd/cgo cmd/compile cmd/link: exit status 1

go version go1.16 linux/amd64

I have not encountered your issus. It works for me. I am unable to reproduce your issue because you only showed a small fragment of what you did.

From the link that you shared (Installing Go from source - The Go Programming Language):

(To build under Windows use all.bat .)

WSL is more linux than windows. AFAIK WSL can’t run bat files

WSL 1 or 2?

The question is about

Therefore, I replied for Windows 10 WSL.

Microsoft Windows [Version 10.0.19042.804]
C:\Users\petrus>wsl
petrus:~$ uname -a
Linux petrus 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
petrus:~$ 

However, you replied for Windows. Why?

Oops!
My bad. did not pay attention to WSL

You are right.
I saw the question, clicked on the link and saw all.bat for Windows (overlooked WSL). Sorry!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.