Skip to content
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

build.sh issues on OSX with -b #116

Closed
sjmudd opened this issue Mar 25, 2017 · 2 comments
Closed

build.sh issues on OSX with -b #116

sjmudd opened this issue Mar 25, 2017 · 2 comments

Comments

@sjmudd
Copy link
Collaborator

sjmudd commented Mar 25, 2017

I see the following using master branch of github against latest commit of Date: Thu Mar 23 21:06:23 2017 +0200, RELEASE_VERSION 2.1.0

[myuser@myhost ~/src/orchestrator/src/github.com/github/orchestrator]$ export GOPATH=~/src/orchestrator
[myuser@myhost ~/src/orchestrator/src/github.com/github/orchestrator]$ ./build.sh -b
Build only; no packaging
Please install fpm and ensure it is in PATH (typically: 'gem install fpm')
rpmbuild not in PATH, rpm will not be built (OS/X: 'brew install rpm')
[myuser@myhost ~/src/orchestrator/src/github.com/github/orchestrator]$
  • I'm requesting no packaging yet it looks like build.sh is trying to package. That's wrong.
  • This works in RELEASE_VERSION 2.0.2

So looks like some of the option handling has broken. I've not had time to look at this further but will shortly need to update to 2.1 so it would be good to resolve these issues.

I see there are other issues reported in #101 so guess that perhaps some of the breakage is related.

@samveen
Copy link
Contributor

samveen commented Mar 29, 2017

I dont see anything between v2.0.2..v2.1.0 that would break building:

[samveen@development orchestrator]$ git diff v2.0.2..v2.1.0 build.sh 
diff --git a/build.sh b/build.sh
index a4703dc..b8141d7 100755
--- a/build.sh
+++ b/build.sh
@@ -33,6 +33,7 @@ usage() {
 function precheck() {
   local target
   local ok=0 # return err. so shell exit code
+  target="$1"
 
   if [[ "$target" == "linux" ]]; then
     if [[ ! -x "$( which fpm )" ]]; then
@@ -135,7 +136,7 @@ function build() {
   prefix="$4"
   ldflags="-X main.AppVersion=${RELEASE_VERSION} -X main.GitCommit=${GIT_COMMIT}"
   echo "Building via $(go version)"
-  gobuild="go build ${opt_race} -ldflags \"$ldflags\" -o $builddir/orchestrator${prefix}/orchestrator/orchestrator go/cmd/orchestrator/main.go"
+  gobuild="go build -i ${opt_race} -ldflags \"$ldflags\" -o $builddir/orchestrator${prefix}/orchestrator/orchestrator go/cmd/orchestrator/main.go"
 
   case $os in
     'linux')

That said, the Please install fpm ... and rpmbuild... messages are actully precheck messages. Looks like the prechecks ignore the buildonly option. Good catch 👍 . I'll submit a MR for this.

samveen added a commit to samveen/orchestrator that referenced this issue Apr 3, 2017
shlomi-noach pushed a commit that referenced this issue Apr 3, 2017
Fix issue #116: `precheck()` honours `-b`
@shlomi-noach
Copy link
Collaborator

fixed by #123

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

No branches or pull requests

3 participants