Open kayrus opened 7 years ago
I don't really get the purpose of it. Why don't you simply use go build
/go install
to build the binary ?
go build doesn't work from the scratch. You always have to configure lots of parameters, prepare environment. This script will work even when you will try to build this project in pure empty docker container with go:
$ docker run -ti --rm -v ${PWD}:/mnt -u $(id -u) golang /mnt/scripts/build -os=linux -arch=amd64
Can you do this without this script? If yes and I really did miss something, please provide the solution in README.md file.
Actually, go build
/go install
do work from scratch. Assuming you have installed go which is pretty much expected when working on golang projects (thus you have GOROOT
and GOPATH
properly set in your environment already, which is common ground for any golang work):
go get github.com/ovh/svfs
2a. go install github.com/ovh/svfs
(when compiling for the current plateform)
2b. GOARCH=amd64 GOOS=linux go build -o svfs github.com/ovh/svfs
(when cross compiling)I don't want to argue with you, but I prefer to have possibility to easy compile modified sources, within current directory. In addition I have a lot of go sources and I don't want to install dependencies system-wide. This script allows to keep everything in each separate directory.
Here is the list of projects with similar scripts:
It's perfectly fine arguing :)
I'm just trying to figure out why it seems complicated to build the binary, what need it addresses. I really understand it's a good thing to provide a build script for projects where the build process is not trivial, or that were already popular pre-go1.6 (due to the compiler toolchain still being written in C instead of Go or dependency vendoring not yet landed).
But it doesn't seem to be the case there... Except if I've missed something. What system-wide dependency are you refering to?
When you run go get
or go install
, it installs everything into default go environment. I'd like it to be installed within current git directory and don't touch system/user-wide part.
I was not able to find a script or makefile which will just build the binary. Thus here is it...