From 54372c3a0c9d6317d23fc9231a13dc9a8d0cc19f Mon Sep 17 00:00:00 2001 From: Fabian Castillo Date: Tue, 11 Sep 2018 19:56:37 -0700 Subject: [PATCH] Disable CGO for binary building. --- src/server/modules/engine/commander/build.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/server/modules/engine/commander/build.js b/src/server/modules/engine/commander/build.js index 07a604c44..8736f8922 100644 --- a/src/server/modules/engine/commander/build.js +++ b/src/server/modules/engine/commander/build.js @@ -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. * @@ -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; }