cli
cli copied to clipboard
./scripts/build/binary: 25: ./scripts/build/.variables: go: not found
Description
Trying to cross-compile for RISC-V
Reproduce
$ sudo GOOS=linux GOARCH=riscv64 make binary
WARNING: you are not in a container.
Use "make dev" to start an interactive development container, use "make -f docker.Makefile binary" to execute this target in a container, or set DISABLE_WARN_OUTSIDE_CONTAINER=1 to disable this warning.
Press Ctrl+C now to abort, or wait for the script to continue..
./scripts/build/binary ./scripts/build/binary: 25: ./scripts/build/.variables: go: not found make: *** [Makefile:53: binary] Error 127
Expected behavior
Unsure
docker version
Client:
Version: 20.10.12
API version: 1.41
Go version: go1.17.3
Git commit: 20.10.12-0ubuntu4
Built: Mon Mar 7 17:10:06 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.12
API version: 1.41 (minimum version 1.12)
Go version: go1.17.3
Git commit: 20.10.12-0ubuntu4
Built: Mon Mar 7 15:57:50 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.5.9-0ubuntu3
GitCommit:
runc:
Version: 1.1.0-0ubuntu1
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
docker info
Client:
Context: default
Debug Mode: false
Server:
Containers: 4
Running: 0
Paused: 0
Stopped: 4
Images: 21
Server Version: 20.10.12
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runq io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version:
runc version:
init version:
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.15.0-47-generic
Operating System: Ubuntu 22.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.763GiB
Name: yangelia
ID: 4JKL:7LHJ:TBX4:L3LP:TJGH:ZDPM:UM2Z:4YCT:VPPM:J6BO:OPH7:FDUR
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional Info
$ uname -a Linux yangelia 5.15.0-47-generic #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux $ go version go version go1.19 linux/amd64 $ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/yantitarenko5/.cache/go-build" GOENV="/home/yantitarenko5/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/yantitarenko5/Desktop/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/yantitarenko5/Desktop/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/yantitarenko5/Desktop/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/yantitarenko5/Desktop/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.19" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" 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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1692123829=/tmp/go-build -gno-record-gcc-switches"
CC @lazyparser
Hi @advancedwebdeveloper , are you setting $PATH for go executable inside your .bashrc or .bash_profile?
I've been discussing this with lazyparser and it looks like go is not available in your /bin/sh (which is not the same as /bin/bash)
Hi, @advancedwebdeveloper ,
I guess it seems that you may need to modify ./scripts/build/.variables. Maybe setting $PATH in .variables could be helpful.
Your go setup seems to be installed in your home directory, so by default go command will not be available in $PATH in the environment spawned by sudo.
Is there any reason for using sudo anyway? You don't need it to build the binary.
I'm closing this one, as this is environment issue and not CLI.