Skip to content

Commit f37a612

Browse files
authored
Merge pull request #389 from aminya/alpine-vcpkg-arm64
fix: pin vcpkg on Alpine Arm64
2 parents a5ee5b0 + d60a917 commit f37a612

File tree

12 files changed

+55
-10
lines changed

12 files changed

+55
-10
lines changed

dist/legacy/lib.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/lib.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/versions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +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"}}
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","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"}}

dist/modern/lib.mjs

+1-1
Large diffs are not rendered by default.

dist/modern/lib.mjs.map

+1-1
Large diffs are not rendered by default.

dist/modern/versions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +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"}}
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","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"}}

packages/setup-alpine/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "setup-alpine",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Setup apk packages and repositories in Alpine Linux distributions",
55
"repository": "https://github.com/aminya/setup-cpp",
66
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/setup-alpine",

packages/setup-alpine/src/has-apk.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import memoizee from "memoizee"
22
import which from "which"
3+
import { isAlpine } from "./is-alpine.js"
34

45
async function hasApk_() {
6+
if (!isAlpine()) {
7+
return false
8+
}
59
try {
610
await which("apk")
711
return true
8-
} catch (error) {
12+
} catch {
913
return false
1014
}
1115
}

packages/setup-alpine/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ export * from "./apk-repository.js"
22
export * from "./has-apk.js"
33
export * from "./init-apt.js"
44
export * from "./install-package.js"
5+
export * from "./is-alpine.js"
56
export * from "./qualify-install.js"
67
export * from "./update.js"
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { pathExistsSync } from "path-exists"
2+
3+
/**
4+
* Check if the current platform is Alpine
5+
*/
6+
export function isAlpine() {
7+
if (process.platform !== "linux") {
8+
return false
9+
}
10+
try {
11+
return pathExistsSync("/etc/alpine-release")
12+
} catch {
13+
return false
14+
}
15+
}

src/versions/versions.json

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
"powershell": "7.4.5",
66
"pip": ">=22.2.0",
77
"python": ">=3.7.9",
8+
"vcpkg": {
9+
"linux": {
10+
"alpine": {
11+
"else": {
12+
"arm64": "d172727ef04337ef0021640302a9a3a91ad17414",
13+
"else": ""
14+
}
15+
},
16+
"else": ""
17+
},
18+
"else": ""
19+
},
820
"meson": {
921
"linux": {
1022
"ubuntu": {

src/versions/versions.ts

+15-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import fs from "fs"
22
import path from "path"
33
import { fileURLToPath } from "url"
44
import memoize from "memoizee"
5+
import { isAlpine } from "setup-alpine"
56
import type { CompilerInfo } from "../compilers.js"
67
import type { Opts } from "../options.js"
78
import type { Inputs, ToolName } from "../tool.js"
9+
import { hasDnf } from "../utils/env/hasDnf.js"
810
import { isArch } from "../utils/env/isArch.js"
911
import { isUbuntu } from "../utils/env/isUbuntu.js"
1012

@@ -21,7 +23,10 @@ type DistroVersionMap = Record<
2123
`${number}` | `${number}.${number}` | `${number}.${number}.${number}` | string | "else",
2224
ArchVersionMap | string | undefined
2325
>
24-
type DistroMap = Record<"ubuntu" | "archlinux" | string | "else", DistroVersionMap | string | undefined>
26+
type DistroMap = Record<
27+
"ubuntu" | "archlinux" | "alpine" | "fedora" | string | "else",
28+
DistroVersionMap | string | undefined
29+
>
2530
type PlatformMap = Record<NodeJS.Platform | "else", DistroMap | string | undefined>
2631
type Versions = Record<ToolName | "pip", PlatformMap | string | undefined>
2732

@@ -62,7 +67,15 @@ export function getVersionDefault(
6267
const distroMap = distroMapOrVersion
6368

6469
// check for distro-specific versions
65-
const distro = isUbuntu() ? "ubuntu" : isArch() ? "archlinux" : "else"
70+
const distro = isUbuntu()
71+
? "ubuntu"
72+
: isArch()
73+
? "archlinux"
74+
: isAlpine()
75+
? "alpine"
76+
: hasDnf()
77+
? "fedora"
78+
: "else"
6679
const distroVersionMapOrVersion = distroMap[distro] ?? distroMap.else
6780
if (distroVersionMapOrVersion === undefined) {
6881
throw new Error(`Distro "${distro}" not found in versions data for tool "${tool}"`)

0 commit comments

Comments
 (0)