Skip to content

Commit b59e0ce

Browse files
committed
fix: fix the libtinfo5 download link on Linux arm
1 parent 374c0cd commit b59e0ce

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

dist/legacy/setup-cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/llvm/llvm_bin.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { info } from "ci-log"
55
import memoize from "memoizee"
66
import { DownloaderHelper } from "node-downloader-helper"
77
import { installAptPack } from "setup-apt"
8-
import { arm64, x86_64 } from "../utils/env/arch.js"
8+
import { getDebArch } from "../utils/env/arch.js"
99
import { hasDnf } from "../utils/env/hasDnf.js"
1010
import { isArch } from "../utils/env/isArch.js"
1111
import { isUbuntu } from "../utils/env/isUbuntu.js"
@@ -17,11 +17,11 @@ import { majorLLVMVersion } from "./utils.js"
1717

1818
export async function setupLLVMBin(version: string, setupDir: string, arch: string) {
1919
const installInfo = await setupBin("llvm", version, getLLVMPackageInfo, setupDir, arch)
20-
await llvmBinaryDeps(majorLLVMVersion(version))
20+
await llvmBinaryDeps(majorLLVMVersion(version), arch)
2121
return installInfo
2222
}
2323

24-
async function llvmBinaryDeps_(_majorVersion: number) {
24+
async function llvmBinaryDeps_(_majorVersion: number, arch: string) {
2525
if (isUbuntu()) {
2626
for (const dep of ["libtinfo5", "libtinfo6"]) {
2727
/* eslint-disable no-await-in-loop */
@@ -32,14 +32,10 @@ async function llvmBinaryDeps_(_majorVersion: number) {
3232
if (dep === "libtinfo5") {
3333
// Manually install libtinfo5 if the package is not available
3434
info(`Failed to install ${dep}\nManually installing the package`)
35-
const arch = x86_64.includes(process.arch)
36-
? "amd64"
37-
: arm64.includes(process.arch)
38-
? "arm64"
39-
: process.arch
4035

41-
const fileName = `libtinfo5_6.3-2ubuntu0.1_${arch}.deb`
42-
const url = `http://launchpadlibrarian.net/666971015/${fileName}`
36+
const fileName = `libtinfo5_6.3-2ubuntu0.1_${getDebArch(arch)}.deb`
37+
const url = `https://launchpad.net/ubuntu/+archive/primary/+files/${fileName}`
38+
4339
const dl = new DownloaderHelper(url, tmpdir(), { fileName })
4440
dl.on("error", async (dlErr) => {
4541
info(`Failed to download ${url}: ${dlErr}`)

0 commit comments

Comments
 (0)