You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On FreeBSD the option -a is not usable with the install command since it attempts to overwrite libraries in ${GOROOT}(/usr/local/go).
What did you do?
% cat main.go
package main
import "fmt"
func main() {
fmt.Printf("abc\n")
}
% go install -a -v .
runtime/internal/sys
go install runtime/internal/sys: open /usr/local/go/pkg/freebsd_amd64/runtime/internal/sys.a: permission denied
What did you expect to see?
all required modules from ${GOPATH} listed as in go build -a, but excluding any ${GOROOT} modules; and the program compiled and installed in ~/${GOPATH}/bin
What did you see instead?
attempt to rewrite file in ${GOROOT} which failed as all files there are owned by root.
Does this issue reproduce with the latest release (go1.9.2)?
I used pkg to install the go14 bootstrap and the FreeBSD port (lang/go) to compile and upgrade:
% go version
go version go1.9.2 freebsd/amd64
% go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH="/usr/home/hsw/gocode"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build714242629=/tmp/go-build -gno-record-gcc-switches"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
% go install -a -v .
runtime/internal/sys
go install runtime/internal/sys: open /usr/local/go/pkg/freebsd_amd64/runtime/internal/sys.a: permission denied
Result is the same; tries to overwrite ${GOROOT} file
System details
go version go1.8.1 freebsd/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH="/usr/home/hsw/gocode"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build135192314=/tmp/go-build -gno-record-gcc-switches"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
GOROOT/bin/go version: go version go1.8.1 freebsd/amd64
GOROOT/bin/go tool compile -V: compile version go1.8.1 X:framepointer
uname -v: FreeBSD 12.0-CURRENT #66 ac2f0aa3b(trueos-stable)-dirty: Wed Jun 21 01:09:23 UTC 2017 root@gauntlet:/usr/obj/usr/src/sys/GENERIC
lldb --version: lldb version 4.0.0
clang revision 297347
The text was updated successfully, but these errors were encountered:
Thanks for the report. This is fixed on tip by https://golang.org/cl/75850, and the fix will be in the future Go 1.10 release. Closing this issue because at this point we aren't going to change anything in earlier releases. The workaround is to not use -a; it rarely does what you want anyhow.
On FreeBSD the option
-a
is not usable with the install command since it attempts to overwrite libraries in ${GOROOT}(/usr/local/go).What did you do?
What did you expect to see?
all required modules from ${GOPATH} listed as in
go build -a
, but excluding any ${GOROOT} modules; and the program compiled and installed in ~/${GOPATH}/binWhat did you see instead?
attempt to rewrite file in ${GOROOT} which failed as all files there are owned by root.
Does this issue reproduce with the latest release (go1.9.2)?
I used pkg to install the go14 bootstrap and the FreeBSD port (lang/go) to compile and upgrade:
Result is the same; tries to overwrite ${GOROOT} file
System details
The text was updated successfully, but these errors were encountered: