Skip to content

Commit 54372c3

Browse files
committed
Disable CGO for binary building.
1 parent c1815cd commit 54372c3

File tree

1 file changed

+8
-2
lines changed
  • src/server/modules/engine/commander

1 file changed

+8
-2
lines changed

src/server/modules/engine/commander/build.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import path from 'path';
22
import { runShellCMD } from '../../../common/utils/process';
33
import { logger } from "../../../common/logging";
44

5+
const DEFAULT_ENV = {
6+
// necessary for cross compiling and static linking
7+
CGO_ENABLED: '0'
8+
};
9+
510
/**
611
* Build the engine.
712
*
@@ -76,11 +81,12 @@ function _translateOptsToCommandArgs(opts) {
7681
}
7782

7883
function _getEnv(opts) {
84+
const env = {...DEFAULT_ENV};
85+
7986
if (!opts.compile) {
80-
return {};
87+
return env;
8188
}
8289

83-
const env = {};
8490
if (opts.compile.os) {
8591
env.GOOS = opts.compile.os;
8692
}

0 commit comments

Comments
 (0)