Skip to content

Commit

Permalink
Merge pull request #879 from TIBCOSoftware/cgo
Browse files Browse the repository at this point in the history
Disable CGO for binary building.
  • Loading branch information
fcastill authored Sep 17, 2018
2 parents ea2a47b + 54372c3 commit 23cebe2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/server/modules/engine/commander/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import path from 'path';
import { runShellCMD } from '../../../common/utils/process';
import { logger } from "../../../common/logging";

const DEFAULT_ENV = {
// necessary for cross compiling and static linking
CGO_ENABLED: '0'
};

/**
* Build the engine.
*
Expand Down Expand Up @@ -76,11 +81,12 @@ function _translateOptsToCommandArgs(opts) {
}

function _getEnv(opts) {
const env = {...DEFAULT_ENV};

if (!opts.compile) {
return {};
return env;
}

const env = {};
if (opts.compile.os) {
env.GOOS = opts.compile.os;
}
Expand Down

0 comments on commit 23cebe2

Please sign in to comment.