Skip to content

all.bash build from source failed to import new vendors #56076

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

Closed
liyimeng opened this issue Oct 6, 2022 · 1 comment
Closed

all.bash build from source failed to import new vendors #56076

liyimeng opened this issue Oct 6, 2022 · 1 comment

Comments

@liyimeng
Copy link

liyimeng commented Oct 6, 2022

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

$ go version
go version go1.18.2 linux/amd64

Does this issue reproduce with the latest release?

Not sure

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

go env Output
$ go env
go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ubuntu/.cache/go-build"
GOENV="/home/ubuntu/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ubuntu/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ubuntu/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/liyi/workspace/ubuntu/go/src/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3127805948=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I wanna custom tls package, which is not possible to be done via module, so I would like to fork this repo and build from source.
Here is what I did:

  • git checkout -b dev go1.18.2
  • add a simple file in crypto dir
package test
import (
	"golang.org/x/crypto/ripemd160"
	"golang.org/x/crypto/sha3"
)

func Hello() string {
	sha3.Write([]byte{})
	ripemd160.New()
        return "Wold"
}

  • then I do as suggestion from README.vendor
    go get -d golang.org/x/crypto@latest
    go mod tidy
    go mod vendor

it seems work as expect so far

git status
        modified:   go.mod
        modified:   go.sum
        deleted:    vendor/golang.org/x/crypto/AUTHORS
        deleted:    vendor/golang.org/x/crypto/CONTRIBUTORS
        modified:   vendor/golang.org/x/crypto/chacha20/chacha_generic.go
        modified:   vendor/golang.org/x/crypto/chacha20/chacha_s390x.go
        modified:   vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go
        modified:   vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_generic.go
        modified:   vendor/golang.org/x/crypto/cryptobyte/builder.go
        modified:   vendor/golang.org/x/crypto/cryptobyte/string.go
        modified:   vendor/golang.org/x/crypto/curve25519/curve25519.go
        modified:   vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go
        modified:   vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go
        modified:   vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go
        deleted:    vendor/golang.org/x/crypto/internal/subtle/aliasing.go
        deleted:    vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go
        modified:   vendor/modules.txt
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        crypto/test/
        vendor/golang.org/x/crypto/internal/alias/
        vendor/golang.org/x/crypto/ripemd160/
        vendor/golang.org/x/crypto/sha3/
  • then I build new golang from source ./all.bash

After a while, it ends up with error like this:

./all.bash 
Building Go cmd/dist using /usr/local/go. (go1.18.2 linux/amd64)
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.
Building packages and commands for linux/amd64.
/home/ubuntu/workspace/ubuntu/go/src/crypto/test/test.go:4:2: package golang_org/x/crypto/ripemd160 is not in GOROOT (/home/ubuntu/workspace/ubuntu/go/src/golang_org/x/crypto/ripemd160)
/home/ubuntu/workspace/ubuntu/go/src/crypto/test/test.go:5:2: package golang_org/x/crypto/sha3 is not in GOROOT (/home/ubuntu/workspace/ubuntu/go/src/golang_org/x/crypto/sha3)
go tool dist: FAILED: /home/ubuntu/workspace/ubuntu/go/pkg/tool/linux_amd64/go_bootstrap install -gcflags=all= -ldflags=all= std cmd: exit status 1

What did you expect to see?

Required packages are already vendored, they should be possible to be imported.

What did you see instead?

build failed, I don't get my golang

@liyimeng liyimeng changed the title affected/package: all.bash all.bash build from source failed Oct 6, 2022
@liyimeng liyimeng changed the title all.bash build from source failed all.bash build from source failed to import new vendors Oct 6, 2022
@liyimeng
Copy link
Author

liyimeng commented Oct 6, 2022

hmm, it works now as expect now, not sure what I have done to make it different.

@liyimeng liyimeng closed this as completed Oct 6, 2022
@golang golang locked and limited conversation to collaborators Oct 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants