Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a4bc774

Browse filesBrowse files
committed
fix: fix Bazel installation on Linux arm64
1 parent a835d4b commit a4bc774
Copy full SHA for a4bc774

File tree

6 files changed

+21
-8
lines changed
Filter options

6 files changed

+21
-8
lines changed

‎dist/legacy/setup-cpp.js

Copy file name to clipboardExpand all lines: dist/legacy/setup-cpp.js
+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/legacy/setup-cpp.js.map

Copy file name to clipboardExpand all lines: dist/legacy/setup-cpp.js.map
+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/modern/setup-cpp.mjs

Copy file name to clipboardExpand all lines: dist/modern/setup-cpp.mjs
+1-1
Large diffs are not rendered by default.

‎dist/modern/setup-cpp.mjs.map

Copy file name to clipboardExpand all lines: dist/modern/setup-cpp.mjs.map
+1-1
Large diffs are not rendered by default.

‎src/bazel/bazel.ts

Copy file name to clipboardExpand all lines: src/bazel/bazel.ts
+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { execRootSync } from "admina"
1+
import { execRoot } from "admina"
22
import { addAptKeyViaURL, installAptPack } from "setup-apt"
33
import { installBrewPack } from "setup-brew"
4+
import { getDebArch } from "../utils/env/arch.js"
45
import { hasDnf } from "../utils/env/hasDnf.js"
56
import { isArch } from "../utils/env/isArch.js"
67
import { isUbuntu } from "../utils/env/isUbuntu.js"
@@ -24,17 +25,19 @@ export async function setupBazel(version: string, _setupDir: string, _arch: stri
2425
} else if (hasDnf()) {
2526
// https://bazel.build/install/redhat
2627
await setupDnfPack([{ name: "dnf-plugins-core" }])
27-
execRootSync("dnf", ["copr", "enable", "vbatts/bazel"])
28+
await execRoot("dnf", ["copr", "enable", "vbatts/bazel"])
2829
return setupDnfPack([{ name: "bazel4" }])
2930
} else if (isUbuntu()) {
3031
// https://bazel.build/install/ubuntu
3132
const keyFileName = await addAptKeyViaURL({
3233
fileName: "bazel-archive-keyring.gpg",
3334
keyUrl: "https://bazel.build/bazel-release.pub.gpg",
3435
})
35-
execRootSync("bash", [
36+
await execRoot("bash", [
3637
"-c",
37-
`echo "deb [arch=amd64 signed-by=${keyFileName}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`,
38+
`echo "deb [arch=${
39+
getDebArch(process.arch)
40+
} signed-by=${keyFileName}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`,
3841
])
3942
return installAptPack([{ name: "bazel", version }], true)
4043
}

‎src/utils/env/arch.ts

Copy file name to clipboardExpand all lines: src/utils/env/arch.ts
+10
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,13 @@ export const armv7 = ["armv7", "armv7a"]
55
export const powerpc64le = ["powerpc64le", "ppc64le"]
66
export const sparc64 = ["sparc64"]
77
export const sparcv9 = ["sparcv9"]
8+
9+
export function getDebArch(arch: string) {
10+
if (arm64.includes(arch)) {
11+
return "arm64"
12+
} else if (x86_64.includes(arch)) {
13+
return "amd64"
14+
} else {
15+
return arch
16+
}
17+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.