Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Added simple build script #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added simple build script #141

wants to merge 1 commit into from

Conversation

kayrus
Copy link
Contributor

@kayrus kayrus commented Jul 18, 2017

I was not able to find a script or makefile which will just build the binary. Thus here is it...

@xlucas
Copy link
Contributor

xlucas commented Jul 20, 2017

I don't really get the purpose of it. Why don't you simply use go build/go install to build the binary ?

@kayrus
Copy link
Contributor Author

kayrus commented Jul 20, 2017

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.

@xlucas
Copy link
Contributor

xlucas commented Jul 20, 2017

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):

  1. 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)

@kayrus
Copy link
Contributor Author

kayrus commented Jul 21, 2017

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.

@xlucas
Copy link
Contributor

xlucas commented Jul 21, 2017

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?

@kayrus
Copy link
Contributor Author

kayrus commented Jul 21, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants