fix: pin vcpkg on Alpine Arm64

This commit is contained in:
Amin Yahyaabadi 2025-04-07 02:00:19 -07:00
parent a5ee5b0e9b
commit d60a91780b
12 changed files with 55 additions and 10 deletions

2
dist/legacy/lib.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"ninja":"1.12.1","cmake":"3.31.4","task":"3.40.1","powershell":"7.4.5","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.6.1","18":"0.61.4","else":"0.61.4"},"else":"1.6.1"},"else":"1.6.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-1","ubuntu":{"22":"1.13.2","18":"1.10.0","else":"1.10.0"},"else":"1.13.2"},"else":"1.13.2"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"}}
{"ninja":"1.12.1","cmake":"3.31.4","task":"3.40.1","powershell":"7.4.5","pip":">=22.2.0","python":">=3.7.9","vcpkg":{"linux":{"alpine":{"else":{"arm64":"d172727ef04337ef0021640302a9a3a91ad17414","else":""}},"else":""},"else":""},"meson":{"linux":{"ubuntu":{"20":"1.6.1","18":"0.61.4","else":"0.61.4"},"else":"1.6.1"},"else":"1.6.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-1","ubuntu":{"22":"1.13.2","18":"1.10.0","else":"1.10.0"},"else":"1.13.2"},"else":"1.13.2"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"}}

2
dist/modern/lib.mjs vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"ninja":"1.12.1","cmake":"3.31.4","task":"3.40.1","powershell":"7.4.5","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.6.1","18":"0.61.4","else":"0.61.4"},"else":"1.6.1"},"else":"1.6.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-1","ubuntu":{"22":"1.13.2","18":"1.10.0","else":"1.10.0"},"else":"1.13.2"},"else":"1.13.2"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"}}
{"ninja":"1.12.1","cmake":"3.31.4","task":"3.40.1","powershell":"7.4.5","pip":">=22.2.0","python":">=3.7.9","vcpkg":{"linux":{"alpine":{"else":{"arm64":"d172727ef04337ef0021640302a9a3a91ad17414","else":""}},"else":""},"else":""},"meson":{"linux":{"ubuntu":{"20":"1.6.1","18":"0.61.4","else":"0.61.4"},"else":"1.6.1"},"else":"1.6.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-1","ubuntu":{"22":"1.13.2","18":"1.10.0","else":"1.10.0"},"else":"1.13.2"},"else":"1.13.2"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"19.1.6"}}

View File

@ -1,6 +1,6 @@
{
"name": "setup-alpine",
"version": "1.0.0",
"version": "1.1.0",
"description": "Setup apk packages and repositories in Alpine Linux distributions",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/setup-alpine",

View File

@ -1,11 +1,15 @@
import memoizee from "memoizee"
import which from "which"
import { isAlpine } from "./is-alpine.js"
async function hasApk_() {
if (!isAlpine()) {
return false
}
try {
await which("apk")
return true
} catch (error) {
} catch {
return false
}
}

View File

@ -2,5 +2,6 @@ export * from "./apk-repository.js"
export * from "./has-apk.js"
export * from "./init-apt.js"
export * from "./install-package.js"
export * from "./is-alpine.js"
export * from "./qualify-install.js"
export * from "./update.js"

View File

@ -0,0 +1,15 @@
import { pathExistsSync } from "path-exists"
/**
* Check if the current platform is Alpine
*/
export function isAlpine() {
if (process.platform !== "linux") {
return false
}
try {
return pathExistsSync("/etc/alpine-release")
} catch {
return false
}
}

View File

@ -5,6 +5,18 @@
"powershell": "7.4.5",
"pip": ">=22.2.0",
"python": ">=3.7.9",
"vcpkg": {
"linux": {
"alpine": {
"else": {
"arm64": "d172727ef04337ef0021640302a9a3a91ad17414",
"else": ""
}
},
"else": ""
},
"else": ""
},
"meson": {
"linux": {
"ubuntu": {

View File

@ -2,9 +2,11 @@ import fs from "fs"
import path from "path"
import { fileURLToPath } from "url"
import memoize from "memoizee"
import { isAlpine } from "setup-alpine"
import type { CompilerInfo } from "../compilers.js"
import type { Opts } from "../options.js"
import type { Inputs, ToolName } from "../tool.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
@ -21,7 +23,10 @@ type DistroVersionMap = Record<
`${number}` | `${number}.${number}` | `${number}.${number}.${number}` | string | "else",
ArchVersionMap | string | undefined
>
type DistroMap = Record<"ubuntu" | "archlinux" | string | "else", DistroVersionMap | string | undefined>
type DistroMap = Record<
"ubuntu" | "archlinux" | "alpine" | "fedora" | string | "else",
DistroVersionMap | string | undefined
>
type PlatformMap = Record<NodeJS.Platform | "else", DistroMap | string | undefined>
type Versions = Record<ToolName | "pip", PlatformMap | string | undefined>
@ -62,7 +67,15 @@ export function getVersionDefault(
const distroMap = distroMapOrVersion
// check for distro-specific versions
const distro = isUbuntu() ? "ubuntu" : isArch() ? "archlinux" : "else"
const distro = isUbuntu()
? "ubuntu"
: isArch()
? "archlinux"
: isAlpine()
? "alpine"
: hasDnf()
? "fedora"
: "else"
const distroVersionMapOrVersion = distroMap[distro] ?? distroMap.else
if (distroVersionMapOrVersion === undefined) {
throw new Error(`Distro "${distro}" not found in versions data for tool "${tool}"`)