remove old zig shit and hopefully fix static compilation for linux

This commit is contained in:
KingKDot
2026-04-03 11:30:01 -05:00
parent a044d74aa3
commit afce95c9e4
2 changed files with 16 additions and 1 deletions
+3
View File
@@ -9,6 +9,9 @@ RUN apt-get update \
build-essential \ build-essential \
gcc-mingw-w64-x86-64 \ gcc-mingw-w64-x86-64 \
gcc-mingw-w64-i686 \ gcc-mingw-w64-i686 \
musl-tools \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabihf \
openssl \ openssl \
curl \ curl \
ca-certificates \ ca-certificates \
+13 -1
View File
@@ -642,7 +642,9 @@ func runBoundFiles() {
if (env.CGO_ENABLED === "1") { if (env.CGO_ENABLED === "1") {
const cCompilerByTarget: Record<string, string> = { const cCompilerByTarget: Record<string, string> = {
"linux/amd64": "gcc", "linux/amd64": "musl-gcc",
"linux/arm64": "aarch64-linux-gnu-gcc",
"linux/arm/v7": "arm-linux-gnueabihf-gcc",
"windows/amd64": "x86_64-w64-mingw32-gcc", "windows/amd64": "x86_64-w64-mingw32-gcc",
"windows/386": "i686-w64-mingw32-gcc", "windows/386": "i686-w64-mingw32-gcc",
...(ndkBin ? { ...(ndkBin ? {
@@ -653,6 +655,8 @@ func runBoundFiles() {
}; };
const cxxCompilerByTarget: Record<string, string> = { const cxxCompilerByTarget: Record<string, string> = {
"linux/amd64": "g++", "linux/amd64": "g++",
"linux/arm64": "aarch64-linux-gnu-g++",
"linux/arm/v7": "arm-linux-gnueabihf-g++",
"windows/amd64": "x86_64-w64-mingw32-g++", "windows/amd64": "x86_64-w64-mingw32-g++",
"windows/386": "i686-w64-mingw32-g++", "windows/386": "i686-w64-mingw32-g++",
...(ndkBin ? { ...(ndkBin ? {
@@ -764,6 +768,14 @@ func runBoundFiles() {
sendToStream({ type: "output", text: "Client printing disabled (noprint tag)\n", level: "info" }); sendToStream({ type: "output", text: "Client printing disabled (noprint tag)\n", level: "info" });
} }
// Linux CGO builds must be fully statically linked to avoid glibc version
// mismatches between the build server and target machines.
if (os === "linux" && env.CGO_ENABLED === "1") {
const staticFlag = "-extldflags '-static'";
ldflags = ldflags ? `${ldflags} ${staticFlag}` : staticFlag;
sendToStream({ type: "output", text: "Linux CGO: static linking enabled (avoids GLIBC version mismatch)\n", level: "info" });
}
try { try {
const buildTool = config.obfuscate ? "garble" : "go"; const buildTool = config.obfuscate ? "garble" : "go";
const buildTags: string[] = []; const buildTags: string[] = [];