feat: add setup-apt package for all the apt utils

This commit is contained in:
Amin Yahyaabadi 2024-08-16 01:50:32 -07:00
parent 1704d8457d
commit dc74686724
No known key found for this signature in database
GPG Key ID: F52AF77F636088F0
33 changed files with 680 additions and 615 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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,7 +1,7 @@
pre-commit:
parallel: false
commands:
lint:
run: pnpm run lint
test.lint:
run: pnpm run test.lint
build:
run: pnpm run clean && pnpm i && pnpm run build -- --no-color && git add ./dist

View File

@ -32,7 +32,7 @@
"build.babel": "babel ./dist --out-dir dist --plugins @upleveled/babel-plugin-remove-node-prefix --plugins @babel/plugin-transform-private-methods --compact --no-babelrc --source-maps true",
"build.modern": "shx cp -r ./dist/actions/* ./dist/modern",
"bump": "ncu -u -x numerous,execa,prettier,@types/node,eslint,@types/eslint && pnpm update && pnpx typesync && pnpm run clean",
"clean": "shx rm -rf ./dist ./exe ./packages/*/dist/ ./.parcel-cache && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern ",
"clean": "shx rm -rf ./dist ./exe ./.parcel-cache && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern ",
"copy.matchers": "run-p copy.matchers.legacy copy.matchers.actions",
"copy.matchers.legacy": "shx cp ./src/gcc/gcc_matcher.json ./dist/legacy/ && shx cp ./src/msvc/msvc_matcher.json ./dist/legacy/ && shx cp ./src/python/python_matcher.json ./dist/legacy/ && shx cp ./src/llvm/llvm_matcher.json ./dist/legacy/",
"copy.matchers.actions": "shx cp ./src/gcc/gcc_matcher.json ./dist/actions/ && shx cp ./src/msvc/msvc_matcher.json ./dist/actions/ && shx cp ./src/python/python_matcher.json ./dist/actions/ && shx cp ./src/llvm/llvm_matcher.json ./dist/actions/",
@ -86,6 +86,7 @@
"escape-path-with-spaces": "^1.0.2",
"escape-quotes": "^1.0.2",
"escape-string-regexp": "^5.0.0",
"setup-apt": "workspace:*",
"eslint": "^8.57.0",
"eslint-config-atomic": "^1.22.1",
"exec-powershell": "workspace:*",
@ -129,12 +130,14 @@
"productionDependencies": [
"@actions/core",
"@actions/exec",
"@actions/http-client",
"@actions/io",
"@actions/tool-cache",
"@iarna/toml",
"admina",
"ci-info",
"ci-log",
"os-env",
"diagnostics_channel",
"escape-path-with-spaces",
"escape-quotes",
"escape-string-regexp",
@ -145,18 +148,19 @@
"mri",
"msvc-dev-cmd",
"numerous",
"os-env",
"path-exists",
"patha",
"retry-as-promised",
"semver",
"setup-apt",
"setup-python",
"simple-update-notifier",
"time-delta",
"ubuntu-version",
"untildify-user",
"web-streams-polyfill",
"util.types",
"diagnostics_channel"
"web-streams-polyfill"
],
"engines": {
"node": ">=12.x",

View File

@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json"
}

View File

@ -0,0 +1,47 @@
{
"name": "setup-apt",
"version": "1.0.0",
"description": "Setup apt packages and repositories in Debian/Ubuntu-based distributions",
"homepage": "https://github.com/aminya/setup-cpp",
"license": "Apache-2.0",
"author": "Amin Yahyaabadi",
"main": "./dist/index.js",
"source": "./src/index.ts",
"scripts": {
"build": "tsc --pretty",
"lint.tsc": "tsc --noEmit --pretty",
"lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix"
},
"dependencies": {
"@types/node": "^12",
"admina": "^1.0.1",
"ci-info": "^4.0.0",
"path-exists": "^5.0.0",
"ci-log": "workspace:*",
"os-env": "workspace:*",
"which": "4.0.0",
"execa": "^7.2.0",
"escape-string-regexp": "^5.0.0"
},
"engines": {
"node": ">=12"
},
"keywords": [
"setup",
"apt",
"apt-get",
"repository",
"add-apt-repository",
"apt-cache",
"aptitude",
"install",
"setup-apt",
"repositories",
"linux",
"ubuntu",
"debian",
"package",
"apt-key"
],
"devDependencies": {}
}

View File

@ -0,0 +1,354 @@
import { promises } from "fs"
import { defaultExecOptions, execRoot, execRootSync } from "admina"
import { GITHUB_ACTIONS } from "ci-info"
import { info, warning } from "ci-log"
import escapeRegex from "escape-string-regexp"
import { type ExecaError, execa } from "execa"
import { sourceRC } from "os-env"
import type { RcOptions } from "os-env/dist/rc-file.js"
import { pathExists } from "path-exists"
import which from "which"
const { appendFile } = promises
export type InstallationInfo = {
/** The install dir of the package (Defaults to `undefined`) */
installDir?: string
/** The bin dir of the package (Defaults to `/usr/bin`) */
binDir: string
/** The bin path of the package (Defaults to `undefined`) */
bin?: string
}
/* eslint-disable require-atomic-updates */
let didUpdate: boolean = false
let didInit: boolean = false
// wait up to 300 seconds if the apt-get lock is held
export const aptTimeout = "Dpkg::Lock::Timeout=300"
export type AptPackage = {
name: string
version?: string
repositories?: string[]
}
const retryErrors = [
"E: Could not get lock",
"dpkg: error processing archive",
"dpkg: error: dpkg status database is locked by another process",
]
/** A function that installs a package using apt */
export async function installAptPack(packages: AptPackage[], update = false): Promise<InstallationInfo> {
const apt: string = getApt()
for (const { name, version } of packages) {
info(`Installing ${name} ${version ?? ""} via ${apt}`)
}
// Update the repos if needed
if (update) {
updateRepos(apt)
didUpdate = true
}
// Add the repos if needed
await addRepositories(apt, packages)
const needToInstall = await filterAndQualifyAptPackages(apt, packages)
if (needToInstall.length === 0) {
info("All packages are already installed")
return { binDir: "/usr/bin/" }
}
// Initialize apt if needed
if (!didInit) {
await initApt(apt)
didInit = true
}
// Install
try {
execRootSync(apt, ["install", "--fix-broken", "-y", ...needToInstall], { ...defaultExecOptions, env: getEnv(apt) })
} catch (err) {
if (isExecaError(err)) {
if (retryErrors.some((error) => err.stderr.includes(error))) {
warning(`Failed to install packages ${needToInstall}. Retrying...`)
execRootSync(
apt,
["install", "--fix-broken", "-y", "-o", aptTimeout, ...needToInstall],
{ ...defaultExecOptions, env: getEnv(apt) },
)
}
} else {
throw err
}
}
return { binDir: "/usr/bin/" }
}
function isExecaError(err: unknown): err is ExecaError {
return typeof (err as ExecaError).stderr === "string"
}
export function hasNala() {
return which.sync("nala", { nothrow: true }) !== null
}
export function getApt() {
let apt: string
if (hasNala()) {
apt = "nala"
} else {
apt = "apt-get"
}
return apt
}
function getEnv(apt: string) {
const env: NodeJS.ProcessEnv = { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
if (apt === "nala") {
// if LANG/LC_ALL is not set, enable utf8 otherwise nala fails because of ASCII encoding
if (env.LANG === undefined) {
env.LANG = "C.UTF-8"
}
if (env.LC_ALL === undefined) {
env.LC_ALL = "C.UTF-8"
}
}
return env
}
export enum AptPackageType {
NameDashVersion = 0,
NameEqualsVersion = 1,
Name = 2,
None = 3,
}
/**
* Filter out the packages that are already installed and qualify the packages into a full package name/version
*/
async function filterAndQualifyAptPackages(apt: string, packages: AptPackage[]) {
return (await Promise.all(packages.map((pack) => qualifiedNeededAptPackage(apt, pack))))
.filter((pack) => pack !== undefined)
}
async function qualifiedNeededAptPackage(apt: string, pack: AptPackage) {
// Qualify the packages into full package name/version
const qualified = await getAptArg(apt, pack.name, pack.version)
// filter out the packages that are already installed
return (await isAptPackInstalled(qualified)) ? undefined : qualified
}
async function addRepositories(apt: string, packages: AptPackage[]) {
const allRepositories = [...new Set(packages.flatMap((pack) => pack.repositories ?? []))]
if (allRepositories.length !== 0) {
if (!didInit) {
await initApt(apt)
didInit = true
}
await installAddAptRepo(apt)
for (const repo of allRepositories) {
// eslint-disable-next-line no-await-in-loop
execRootSync("add-apt-repository", ["-y", "--no-update", repo], { ...defaultExecOptions, env: getEnv(apt) })
}
updateRepos(apt)
didUpdate = true
}
}
async function aptPackageType(apt: string, name: string, version: string | undefined): Promise<AptPackageType> {
if (version !== undefined && version !== "") {
const { stdout } = await execa("apt-cache", [
"search",
"--names-only",
`^${escapeRegex(name)}-${escapeRegex(version)}$`,
], { env: getEnv(apt), stdio: "pipe" })
if (stdout.trim() !== "") {
return AptPackageType.NameDashVersion
}
try {
// check if apt-get show can find the version
// eslint-disable-next-line @typescript-eslint/no-shadow
const { stdout } = await execa("apt-cache", ["show", `${name}=${version}`], { env: getEnv(apt) })
if (stdout.trim() === "") {
return AptPackageType.NameEqualsVersion
}
} catch {
// ignore
}
}
try {
const { stdout: showStdout } = await execa("apt-cache", ["show", name], { env: getEnv(apt), stdio: "pipe" })
if (showStdout.trim() !== "") {
return AptPackageType.Name
}
} catch {
// ignore
}
// If apt-cache fails, update the repos and try again
if (!didUpdate) {
updateRepos(getApt())
didUpdate = true
return aptPackageType(apt, name, version)
}
return AptPackageType.None
}
async function getAptArg(apt: string, name: string, version: string | undefined) {
const package_type = await aptPackageType(apt, name, version)
switch (package_type) {
case AptPackageType.NameDashVersion:
return `${name}-${version}`
case AptPackageType.NameEqualsVersion:
return `${name}=${version}`
case AptPackageType.Name:
if (version !== undefined && version !== "") {
warning(`Could not find package ${name} with version ${version}. Installing the latest version.`)
}
return name
default:
throw new Error(`Could not find package ${name} ${version ?? ""}`)
}
}
function updateRepos(apt: string) {
execRootSync(
apt,
apt !== "nala" ? ["update", "-y", "-o", aptTimeout] : ["update", "-o", aptTimeout],
{ ...defaultExecOptions, env: getEnv(apt) },
)
}
async function installAddAptRepo(apt: string) {
if (await isAptPackInstalled("software-properties-common")) {
return
}
execRootSync(
apt,
["install", "-y", "--fix-broken", "-o", aptTimeout, "software-properties-common"],
{ ...defaultExecOptions, env: getEnv(apt) },
)
}
/** Install gnupg and certificates (usually missing from docker containers) */
async function initApt(apt: string) {
// Update the repos if needed
if (!didUpdate) {
updateRepos(apt)
didUpdate = true
}
const toInstall = await filterAndQualifyAptPackages(apt, [
{ name: "ca-certificates" },
{ name: "gnupg" },
{ name: "apt-utils" },
])
if (toInstall.length !== 0) {
execRootSync(apt, ["install", "-y", "--fix-broken", "-o", aptTimeout, ...toInstall], {
...defaultExecOptions,
env: getEnv(apt),
})
}
await Promise.all([
addAptKeyViaServer(["3B4FE6ACC0B21F32", "40976EAF437D05B5"], "setup-cpp-ubuntu-archive.gpg"),
addAptKeyViaServer(["1E9377A2BA9EF27F"], "launchpad-toolchain.gpg"),
])
}
function initGpg() {
execRootSync("gpg", ["-k"])
}
export async function addAptKeyViaServer(keys: string[], name: string, server = "keyserver.ubuntu.com") {
try {
const fileName = `/etc/apt/trusted.gpg.d/${name}`
if (!(await pathExists(fileName))) {
initGpg()
await Promise.all(
keys.map(async (key) => {
await execRoot("gpg", [
"--no-default-keyring",
"--keyring",
`gnupg-ring:${fileName}`,
"--keyserver",
server,
"--recv-keys",
key,
])
await execRoot("chmod", ["644", fileName])
}),
)
}
return fileName
} catch (err) {
warning(`Failed to add apt key via server ${server}: ${err}`)
return undefined
}
}
export async function addAptKeyViaDownload(name: string, url: string) {
const fileName = `/etc/apt/trusted.gpg.d/${name}`
if (!(await pathExists(fileName))) {
initGpg()
await installAptPack([{ name: "curl" }, { name: "ca-certificates" }], undefined)
await execa("curl", ["-s", url, "-o", `/tmp/${name}`])
execRootSync("gpg", ["--no-default-keyring", "--keyring", `gnupg-ring:${fileName}`, "--import", `/tmp/${name}`])
execRootSync("chmod", ["644", fileName])
}
return fileName
}
export async function updateAptAlternatives(name: string, path: string, rcOptions: RcOptions, priority: number = 40) {
if (GITHUB_ACTIONS) {
await execRoot("update-alternatives", ["--install", `/usr/bin/${name}`, name, path, priority.toString()])
} else {
await sourceRC(rcOptions)
await appendFile(
rcOptions.rcPath,
`\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${name} ${name} ${path} ${priority}; fi\n`,
)
}
}
export async function isAptPackInstalled(pack: string) {
try {
// check if a package is installed
const { stdout } = await execa("dpkg", ["-s", pack], { env: getEnv("apt-get"), stdio: "pipe" })
if (typeof stdout !== "string") {
return false
}
const lines = stdout.split("\n")
// check if the output contains a line that starts with "Status: install ok installed"
return lines.some((line) => line.startsWith("Status: install ok installed"))
} catch {
return false
}
}
export async function isAptPackRegexInstalled(regexp: string) {
try {
// check if a package matching the regexp is installed
const { stdout } = await execa("dpkg", ["-l", regexp], { env: getEnv("apt-get"), stdio: "pipe" })
if (typeof stdout !== "string") {
return false
}
const lines = stdout.split("\n")
// check if the output contains any lines that start with "ii"
return lines.some((line) => line.startsWith("ii"))
} catch {
return false
}
}

View File

@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"noEmit": false,
"allowImportingTsExtensions": false
},
"include": ["./src"]
}

View File

@ -176,6 +176,9 @@ importers:
semver:
specifier: 7.6.3
version: 7.6.3
setup-apt:
specifier: workspace:*
version: link:packages/setup-apt
setup-python:
specifier: github:aminya/setup-python#a783db655c6e40317e2c0c96f9d162d9c9f4a751
version: https://codeload.github.com/aminya/setup-python/tar.gz/a783db655c6e40317e2c0c96f9d162d9c9f4a751(encoding@0.1.13)
@ -277,6 +280,36 @@ importers:
specifier: workspace:*
version: link:../untildify-user
packages/setup-apt:
dependencies:
'@types/node':
specifier: ^12
version: 12.20.55
admina:
specifier: ^1.0.1
version: 1.0.1
ci-info:
specifier: ^4.0.0
version: 4.0.0
ci-log:
specifier: workspace:*
version: link:../ci-log
escape-string-regexp:
specifier: ^5.0.0
version: 5.0.0
execa:
specifier: ^7.2.0
version: 7.2.0
os-env:
specifier: workspace:*
version: link:../os-env
path-exists:
specifier: ^5.0.0
version: 5.0.0
which:
specifier: 4.0.0
version: 4.0.0
packages/untildify-user:
dependencies:
admina:
@ -6347,17 +6380,16 @@ snapshots:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.17.1
'@parcel/bundler-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/bundler-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/graph': 3.2.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0
'@parcel/utils': 2.12.0
nullthrows: 1.1.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/cache@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
dependencies:
@ -6373,47 +6405,46 @@ snapshots:
dependencies:
chalk: 4.1.2
'@parcel/compressor-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/compressor-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/config-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)(postcss@8.4.41)(typescript@5.5.4)':
dependencies:
'@parcel/bundler-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/compressor-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/bundler-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/compressor-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/namer-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/optimizer-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/optimizer-htmlnano': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)(postcss@8.4.41)(typescript@5.5.4)
'@parcel/optimizer-image': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/optimizer-svgo': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/namer-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/optimizer-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/optimizer-htmlnano': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(postcss@8.4.41)(typescript@5.5.4)
'@parcel/optimizer-image': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/optimizer-svgo': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/optimizer-swc': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/packager-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/packager-html': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/packager-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/packager-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/packager-svg': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/packager-wasm': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/reporter-dev-server': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/resolver-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/runtime-browser-hmr': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/runtime-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/runtime-react-refresh': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/runtime-service-worker': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-babel': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-html': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-image': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/packager-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-html': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-svg': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-wasm': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/reporter-dev-server': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/resolver-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/runtime-browser-hmr': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/runtime-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/runtime-react-refresh': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/runtime-service-worker': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-babel': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-html': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-image': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-json': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-postcss': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-posthtml': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-react-refresh-wrap': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-svg': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/transformer-json': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-postcss': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-posthtml': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-react-refresh-wrap': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-svg': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies:
- '@swc/helpers'
- cssnano
@ -6435,13 +6466,13 @@ snapshots:
'@parcel/graph': 3.2.0
'@parcel/logger': 2.12.0
'@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/profiler': 2.12.0
'@parcel/rust': 2.12.0
'@parcel/source-map': 2.1.1
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
abortcontroller-polyfill: 1.7.5
base-x: 3.0.10
browserslist: 4.23.3
@ -6469,7 +6500,7 @@ snapshots:
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0
'@parcel/watcher': 2.4.1
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies:
- '@swc/helpers'
@ -6486,14 +6517,13 @@ snapshots:
dependencies:
chalk: 4.1.2
'@parcel/namer-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/namer-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
nullthrows: 1.1.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/node-resolver-core@3.3.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
@ -6507,10 +6537,10 @@ snapshots:
transitivePeerDependencies:
- '@parcel/core'
'@parcel/optimizer-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/optimizer-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0
browserslist: 4.23.3
@ -6518,18 +6548,16 @@ snapshots:
nullthrows: 1.1.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/optimizer-htmlnano@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)(postcss@8.4.41)(typescript@5.5.4)':
'@parcel/optimizer-htmlnano@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(postcss@8.4.41)(typescript@5.5.4)':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
htmlnano: 2.1.1(postcss@8.4.41)(svgo@2.8.0)(typescript@5.5.4)
nullthrows: 1.1.1
posthtml: 0.16.6
svgo: 2.8.0
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
- cssnano
- postcss
- purgecss
@ -6539,31 +6567,28 @@ snapshots:
- typescript
- uncss
'@parcel/optimizer-image@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/optimizer-image@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0
'@parcel/utils': 2.12.0
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
transitivePeerDependencies:
- '@swc/helpers'
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/optimizer-svgo@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/optimizer-svgo@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
svgo: 2.8.0
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/optimizer-swc@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0
'@swc/core': 1.7.11(@swc/helpers@0.5.12)
@ -6581,39 +6606,37 @@ snapshots:
'@parcel/node-resolver-core': 3.3.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@swc/core': 1.7.11(@swc/helpers@0.5.12)
semver: 7.6.3
transitivePeerDependencies:
- '@swc/helpers'
'@parcel/packager-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/packager-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0
lightningcss: 1.26.0
nullthrows: 1.1.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/packager-html@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/packager-html@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0
nullthrows: 1.1.1
posthtml: 0.16.6
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/packager-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/packager-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0
'@parcel/source-map': 2.1.1
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
@ -6622,38 +6645,33 @@ snapshots:
nullthrows: 1.1.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/packager-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/packager-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/packager-svg@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/packager-svg@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0
posthtml: 0.16.6
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/packager-wasm@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/packager-wasm@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/plugin@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/plugin@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/profiler@2.12.0':
dependencies:
@ -6661,79 +6679,71 @@ snapshots:
'@parcel/events': 2.12.0
chrome-trace-event: 1.0.4
'@parcel/reporter-cli@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/reporter-cli@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0
chalk: 4.1.2
term-size: 2.2.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/reporter-dev-server@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/reporter-dev-server@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/reporter-tracer@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/reporter-tracer@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
chrome-trace-event: 1.0.4
nullthrows: 1.1.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/resolver-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/resolver-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/node-resolver-core': 3.3.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/runtime-browser-hmr@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/runtime-browser-hmr@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/runtime-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/runtime-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
nullthrows: 1.1.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/runtime-react-refresh@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/runtime-react-refresh@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
react-error-overlay: 6.0.9
react-refresh: 0.9.0
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/runtime-service-worker@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/runtime-service-worker@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
nullthrows: 1.1.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/rust@2.12.0': {}
@ -6741,10 +6751,10 @@ snapshots:
dependencies:
detect-libc: 1.0.3
'@parcel/transformer-babel@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-babel@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0
browserslist: 4.23.3
@ -6753,12 +6763,11 @@ snapshots:
semver: 7.6.3
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0
browserslist: 4.23.3
@ -6766,12 +6775,11 @@ snapshots:
nullthrows: 1.1.1
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-html@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-html@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0
nullthrows: 1.1.1
posthtml: 0.16.6
@ -6781,45 +6789,41 @@ snapshots:
srcset: 4.0.0
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-image@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-image@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
nullthrows: 1.1.1
transitivePeerDependencies:
- '@swc/helpers'
'@parcel/transformer-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0
'@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@swc/helpers': 0.5.12
browserslist: 4.23.3
nullthrows: 1.1.1
regenerator-runtime: 0.13.11
semver: 7.6.3
'@parcel/transformer-json@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-json@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
json5: 2.2.3
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-postcss@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-postcss@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0
'@parcel/utils': 2.12.0
clone: 2.1.2
@ -6828,11 +6832,10 @@ snapshots:
semver: 7.6.3
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-posthtml@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-posthtml@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
nullthrows: 1.1.1
posthtml: 0.16.6
@ -6841,28 +6844,25 @@ snapshots:
semver: 7.6.3
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-react-refresh-wrap@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-react-refresh-wrap@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
react-refresh: 0.9.0
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-svg@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/transformer-svg@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0
nullthrows: 1.1.1
posthtml: 0.16.6
@ -6871,7 +6871,6 @@ snapshots:
semver: 7.6.3
transitivePeerDependencies:
- '@parcel/core'
- '@swc/helpers'
'@parcel/types@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
dependencies:
@ -6880,7 +6879,7 @@ snapshots:
'@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/source-map': 2.1.1
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
utility-types: 3.11.0
transitivePeerDependencies:
- '@parcel/core'
@ -6953,7 +6952,7 @@ snapshots:
'@parcel/watcher-win32-ia32': 2.4.1
'@parcel/watcher-win32-x64': 2.4.1
'@parcel/workers@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
'@parcel/workers@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies:
'@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/diagnostic': 2.12.0
@ -6962,8 +6961,6 @@ snapshots:
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0
nullthrows: 1.1.1
transitivePeerDependencies:
- '@swc/helpers'
'@pkgr/core@0.1.1': {}
@ -10531,9 +10528,9 @@ snapshots:
'@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/logger': 2.12.0
'@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/reporter-cli': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/reporter-dev-server': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/reporter-tracer': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/reporter-cli': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/reporter-dev-server': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/reporter-tracer': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0
chalk: 4.1.2
commander: 7.2.0

View File

@ -1,8 +1,8 @@
import { execRootSync } from "admina"
import { addAptKeyViaDownload, installAptPack } from "setup-apt"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { addAptKeyViaDownload, setupAptPack } from "../utils/setup/setupAptPack.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
@ -36,7 +36,7 @@ export async function setupBazel(version: string, _setupDir: string, _arch: stri
"-c",
`echo "deb [arch=amd64 signed-by=${keyFileName}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`,
])
return setupAptPack([{ name: "bazel", version }], true)
return installAptPack([{ name: "bazel", version }], true)
}
throw new Error("Unsupported linux distribution")
}

View File

@ -1,7 +1,7 @@
import { installAptPack } from "setup-apt"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
@ -22,7 +22,7 @@ export function setupCcache(version: string, _setupDir: string, _arch: string) {
} else if (hasDnf()) {
return setupDnfPack([{ name: "ccache", version }])
} else if (isUbuntu()) {
return setupAptPack([{ name: "ccache", version }])
return installAptPack([{ name: "ccache", version }])
}
throw new Error("Unsupported linux distribution")
}

View File

@ -1,9 +1,9 @@
import { addPath } from "os-env"
import { installAptPack } from "setup-apt"
import { rcOptions } from "../cli-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
@ -26,7 +26,7 @@ export async function setupCppcheck(version: string | undefined, _setupDir: stri
} else if (hasDnf()) {
return setupDnfPack([{ name: "ccache", version }])
} else if (isUbuntu()) {
return setupAptPack([{ name: "cppcheck", version }])
return installAptPack([{ name: "cppcheck", version }])
}
throw new Error("Unsupported linux distribution")
}

View File

@ -1,9 +1,9 @@
import { info, notice } from "ci-log"
import { addPath } from "os-env"
import { addExeExt, join } from "patha"
import { installAptPack } from "setup-apt"
import { setupGraphviz } from "../graphviz/graphviz.js"
import { extractTar, extractZip } from "../utils/setup/extract.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
@ -97,7 +97,7 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
} else if (hasDnf()) {
return setupDnfPack([{ name: "doxygen", version }])
} else if (isUbuntu()) {
installationInfo = await setupAptPack([{ name: "doxygen", version }])
installationInfo = await installAptPack([{ name: "doxygen", version }])
} else {
throw new Error("Unsupported linux distributions")
}
@ -106,13 +106,13 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
try {
await setupAptPack([{ name: "libclang-cpp9" }])
await installAptPack([{ name: "libclang-cpp9" }])
} catch (err) {
info(`Failed to download libclang-cpp9 that might be needed for running doxygen. ${err}`)
}
} catch (err) {
notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
installationInfo = await setupAptPack([{ name: "doxygen" }])
installationInfo = await installAptPack([{ name: "doxygen" }])
}
} else {
throw new Error("Unsupported linux distributions")

View File

@ -7,13 +7,13 @@ import { pathExists } from "path-exists"
import { addExeExt, join } from "patha"
import semverCoerce from "semver/functions/coerce"
import semverMajor from "semver/functions/major"
import { installAptPack, updateAptAlternatives } from "setup-apt"
import { rcOptions } from "../cli-options.js"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { extract7Zip } from "../utils/setup/extract.js"
import { setupAptPack, updateAptAlternatives } from "../utils/setup/setupAptPack.js"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
@ -110,7 +110,7 @@ export async function setupGcc(version: string, setupDir: string, arch: string,
{ name: "libstdc++-devel" },
])
} else if (isUbuntu()) {
installationInfo = await setupAptPack([
installationInfo = await installAptPack([
{ name: "gcc", version, repositories: ["ppa:ubuntu-toolchain-r/test"] },
{ name: "g++", version, repositories: ["ppa:ubuntu-toolchain-r/test"] },
])
@ -120,7 +120,7 @@ export async function setupGcc(version: string, setupDir: string, arch: string,
if (isArch()) {
await setupPacmanPack("gcc-multilib", version)
} else if (isUbuntu()) {
await setupAptPack([{ name: "gcc-multilib", version, repositories: ["ppa:ubuntu-toolchain-r/test"] }])
await installAptPack([{ name: "gcc-multilib", version, repositories: ["ppa:ubuntu-toolchain-r/test"] }])
}
}
break
@ -129,7 +129,7 @@ export async function setupGcc(version: string, setupDir: string, arch: string,
// TODO support abi
// case "none": {
// if (arch === "arm" || arch === "arm64") {
// return setupAptPack("gcc-arm-none-eabi", version, [
// return installAptPack("gcc-arm-none-eabi", version, [
// "ppa:ubuntu-toolchain-r/test",
// ])
// } else {
@ -161,7 +161,7 @@ export async function setupMingw(version: string, setupDir: string, arch: string
} else if (hasDnf()) {
installationInfo = await setupDnfPack([{ name: "mingw64-gcc", version }])
} else if (isUbuntu()) {
installationInfo = await setupAptPack([
installationInfo = await installAptPack([
{ name: "mingw-w64", version, repositories: ["ppa:ubuntu-toolchain-r/test"] },
])
}
@ -231,10 +231,10 @@ async function activateGcc(version: string, binDir: string, priority: number = 4
if (isUbuntu()) {
promises.push(
updateAptAlternatives("cc", `${binDir}/gcc-${majorVersion}`, rcOptions.rcPath, priority),
updateAptAlternatives("cxx", `${binDir}/g++-${majorVersion}`, rcOptions.rcPath, priority),
updateAptAlternatives("gcc", `${binDir}/gcc-${majorVersion}`, rcOptions.rcPath, priority),
updateAptAlternatives("g++", `${binDir}/g++-${majorVersion}`, rcOptions.rcPath, priority),
updateAptAlternatives("cc", `${binDir}/gcc-${majorVersion}`, rcOptions, priority),
updateAptAlternatives("cxx", `${binDir}/g++-${majorVersion}`, rcOptions, priority),
updateAptAlternatives("gcc", `${binDir}/gcc-${majorVersion}`, rcOptions, priority),
updateAptAlternatives("g++", `${binDir}/g++-${majorVersion}`, rcOptions, priority),
)
}
} else {
@ -245,10 +245,10 @@ async function activateGcc(version: string, binDir: string, priority: number = 4
if (isUbuntu()) {
promises.push(
updateAptAlternatives("cc", `${binDir}/gcc-${version}`, rcOptions.rcPath, priority),
updateAptAlternatives("cxx", `${binDir}/g++-${version}`, rcOptions.rcPath, priority),
updateAptAlternatives("gcc", `${binDir}/gcc-${version}`, rcOptions.rcPath, priority),
updateAptAlternatives("g++", `${binDir}/g++-${version}`, rcOptions.rcPath, priority),
updateAptAlternatives("cc", `${binDir}/gcc-${version}`, rcOptions, priority),
updateAptAlternatives("cxx", `${binDir}/g++-${version}`, rcOptions, priority),
updateAptAlternatives("gcc", `${binDir}/gcc-${version}`, rcOptions, priority),
updateAptAlternatives("g++", `${binDir}/g++-${version}`, rcOptions, priority),
)
}
}

View File

@ -1,9 +1,9 @@
import { addPath } from "os-env"
import { installAptPack } from "setup-apt"
import { rcOptions } from "../cli-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import type { InstallationInfo } from "../utils/setup/setupBin.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
@ -26,7 +26,7 @@ export async function setupGraphviz(version: string, _setupDir: string, _arch: s
} else if (hasDnf()) {
return setupDnfPack([{ name: "graphviz", version }])
} else if (isUbuntu()) {
return setupAptPack([{ name: "graphviz", version }])
return installAptPack([{ name: "graphviz", version }])
}
throw new Error("Unsupported linux distribution")
}

View File

@ -1,6 +1,7 @@
import { info } from "ci-log"
import { execa } from "execa"
import { addExeExt, join } from "patha"
import { installAptPack } from "setup-apt"
import { untildifyUser } from "untildify-user"
import which from "which"
import { setupCmake } from "../cmake/cmake.js"
@ -10,7 +11,6 @@ import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { ubuntuVersion } from "../utils/env/ubuntu_version.js"
import { extractTarByExe } from "../utils/setup/extract.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
@ -49,7 +49,7 @@ async function buildKcov(file: string, dest: string) {
} else if (hasDnf()) {
await setupDnfPack([{ name: "libdwarf-devel" }, { name: "libcurl-devel" }])
} else if (isUbuntu()) {
await setupAptPack([{ name: "libdw-dev" }, { name: "libcurl4-openssl-dev" }])
await installAptPack([{ name: "libdw-dev" }, { name: "libcurl4-openssl-dev" }])
}
}
@ -117,7 +117,7 @@ export async function setupKcov(versionGiven: string, setupDir: string, arch: st
} else if (hasDnf()) {
await setupDnfPack([{ name: "binutils" }])
} else if (isUbuntu()) {
await setupAptPack([{ name: "libbinutils" }])
await installAptPack([{ name: "libbinutils" }])
}
return installationInfo
} else {

View File

@ -5,12 +5,12 @@ import memoize from "micro-memoize"
import { addEnv } from "os-env"
import { pathExists } from "path-exists"
import { addExeExt, join } from "patha"
import { installAptPack, updateAptAlternatives } from "setup-apt"
import { rcOptions } from "../cli-options.js"
import { setupGcc } from "../gcc/gcc.js"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { ubuntuVersion } from "../utils/env/ubuntu_version.js"
import { setupAptPack, updateAptAlternatives } from "../utils/setup/setupAptPack.js"
import { type InstallationInfo, setupBin } from "../utils/setup/setupBin.js"
import { semverCoerceIfInvalid } from "../utils/setup/version.js"
import { getVersion } from "../versions/versions.js"
@ -75,9 +75,9 @@ async function setupLLVMOnly(
async function llvmBinaryDeps_raw(majorVersion: number) {
if (isUbuntu()) {
if (majorVersion <= 10) {
await setupAptPack([{ name: "libtinfo5" }])
await installAptPack([{ name: "libtinfo5" }])
} else {
await setupAptPack([{ name: "libtinfo-dev" }])
await installAptPack([{ name: "libtinfo-dev" }])
}
}
}
@ -131,13 +131,13 @@ export async function activateLLVM(directory: string) {
if (isUbuntu()) {
const priority = 60
actPromises.push(
updateAptAlternatives("cc", `${directory}/bin/clang`, rcOptions.rcPath, priority),
updateAptAlternatives("cxx", `${directory}/bin/clang++`, rcOptions.rcPath, priority),
updateAptAlternatives("clang", `${directory}/bin/clang`, rcOptions.rcPath),
updateAptAlternatives("clang++", `${directory}/bin/clang++`, rcOptions.rcPath),
updateAptAlternatives("lld", `${directory}/bin/lld`, rcOptions.rcPath),
updateAptAlternatives("ld.lld", `${directory}/bin/ld.lld`, rcOptions.rcPath),
updateAptAlternatives("llvm-ar", `${directory}/bin/llvm-ar`, rcOptions.rcPath),
updateAptAlternatives("cc", `${directory}/bin/clang`, rcOptions, priority),
updateAptAlternatives("cxx", `${directory}/bin/clang++`, rcOptions, priority),
updateAptAlternatives("clang", `${directory}/bin/clang`, rcOptions),
updateAptAlternatives("clang++", `${directory}/bin/clang++`, rcOptions),
updateAptAlternatives("lld", `${directory}/bin/lld`, rcOptions),
updateAptAlternatives("ld.lld", `${directory}/bin/ld.lld`, rcOptions),
updateAptAlternatives("llvm-ar", `${directory}/bin/llvm-ar`, rcOptions),
)
}

View File

@ -3,9 +3,9 @@ import { execRoot } from "admina"
import { execa } from "execa"
import { chmod, readFile, writeFile } from "fs/promises"
import { addPath } from "os-env"
import { aptTimeout, hasNala, installAptPack, isAptPackRegexInstalled } from "setup-apt"
import { rcOptions } from "../cli-options.js"
import { DEFAULT_TIMEOUT } from "../installTool.js"
import { aptTimeout, hasNala, isPackageRegexInstalled, setupAptPack } from "../utils/setup/setupAptPack.js"
import type { InstallationInfo } from "../utils/setup/setupBin.js"
export enum LLVMPackages {
@ -21,10 +21,10 @@ export async function setupLLVMApt(
// TODO for older versions, this also includes the minor version
const installationFolder = `/usr/lib/llvm-${majorVersion}`
await setupAptPack([{ name: "curl" }])
await installAptPack([{ name: "curl" }])
await execa("curl", ["-LJO", "https://apt.llvm.org/llvm.sh"], { cwd: "/tmp" })
const neededPackages = await patchAptLLVMScript("/tmp/llvm.sh", "/tmp/llvm-setup-cpp.sh", majorVersion, packages)
await setupAptPack(neededPackages)
await installAptPack(neededPackages)
await chmod("/tmp/llvm-setup-cpp.sh", "755")
await execRoot(
"bash",
@ -88,7 +88,7 @@ async function removeConflictingPackages(givenScript: string) {
await Promise.all(
conflictingPackages.map(async (pack) => {
const installingPack = pack.replace("$LLVM_VERSION", "*")
if (await isPackageRegexInstalled(installingPack)) {
if (await isAptPackRegexInstalled(installingPack)) {
info(`Removing conflicting package ${installingPack}`)
script = script.replace(pack, "")
}

View File

@ -1,9 +1,9 @@
import { addPath } from "os-env"
import { installAptPack } from "setup-apt"
import { rcOptions } from "../cli-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
@ -26,7 +26,7 @@ export async function setupMake(version: string, _setupDir: string, _arch: strin
} else if (hasDnf()) {
return setupDnfPack([{ name: "make", version }])
} else if (isUbuntu()) {
return setupAptPack([{ name: "make", version }])
return installAptPack([{ name: "make", version }])
}
throw new Error("Unsupported linux distribution")
}

View File

@ -1,8 +1,8 @@
import { execRootSync } from "admina"
import { dirname } from "patha"
import { addAptKeyViaDownload, hasNala, installAptPack } from "setup-apt"
import which from "which"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { addAptKeyViaDownload, hasNala, setupAptPack } from "../utils/setup/setupAptPack.js"
let binDir: string | undefined
@ -21,7 +21,7 @@ export async function setupNala(version: string, _setupDir: string, _arch: strin
return { binDir }
}
await setupAptPack([{ name: "python3-apt" }])
await installAptPack([{ name: "python3-apt" }])
// https://gitlab.com/volian/nala/-/wikis/Installation
const keyFileName = await addAptKeyViaDownload(
@ -35,12 +35,12 @@ export async function setupNala(version: string, _setupDir: string, _arch: strin
try {
if (version !== "legacy") {
await setupAptPack([{ name: "nala" }], true)
await installAptPack([{ name: "nala" }], true)
} else {
await setupAptPack([{ name: "nala-legacy" }], true)
await installAptPack([{ name: "nala-legacy" }], true)
}
} catch (err) {
await setupAptPack([{ name: "nala-legacy" }], true)
await installAptPack([{ name: "nala-legacy" }], true)
}
binDir = "/usr/bin" // eslint-disable-line require-atomic-updates

View File

@ -1,11 +1,11 @@
import { execRootSync } from "admina"
import { addPath } from "os-env"
import { installAptPack } from "setup-apt"
import { rcOptions } from "../cli-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { ubuntuVersion } from "../utils/env/ubuntu_version.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
@ -34,7 +34,7 @@ export async function setupPowershell(version: string | undefined, _setupDir: st
])
return setupDnfPack([{ name: "powershell", version }])
} else if (isUbuntu()) {
await setupAptPack([{ name: "curl" }])
await installAptPack([{ name: "curl" }])
const ubuntuVerSplitted = (await ubuntuVersion())!
const ubuntuVersionString = `${ubuntuVerSplitted[0]}.0${ubuntuVerSplitted[1]}`
@ -54,7 +54,7 @@ export async function setupPowershell(version: string | undefined, _setupDir: st
// `echo "deb [arch=amd64 signed-by=${keyFileName}] https://packages.microsoft.com/repos/microsoft-debian-bullseye-prod bullseye main" > /etc/apt/sources.list.d/microsoft.list`,
// ])
return setupAptPack([{ name: "powershell", version }], true)
return installAptPack([{ name: "powershell", version }], true)
}
throw new Error("Unsupported linux distribution")
}

View File

@ -10,12 +10,12 @@ import memoize from "micro-memoize"
import { addPath } from "os-env"
import { pathExists } from "path-exists"
import { addExeExt, dirname, join } from "patha"
import { installAptPack } from "setup-apt"
import which from "which"
import { rcOptions } from "../cli-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import type { InstallationInfo } from "../utils/setup/setupBin.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
@ -157,7 +157,7 @@ async function setupPythonSystem(setupDir: string, version: string) {
} else if (hasDnf()) {
installInfo = await setupDnfPack([{ name: "python3", version }])
} else if (isUbuntu()) {
installInfo = await setupAptPack([{ name: "python3", version }, { name: "python-is-python3" }])
installInfo = await installAptPack([{ name: "python3", version }, { name: "python-is-python3" }])
} else {
throw new Error("Unsupported linux distributions")
}

View File

@ -1,7 +1,7 @@
import { installAptPack } from "setup-apt"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import { setupBrewPack } from "../utils/setup/setupBrewPack.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
@ -25,7 +25,7 @@ export function setupSevenZip(version: string, _setupDir: string, _arch: string)
{ name: "p7zip-plugins", version },
])
} else if (isUbuntu()) {
return setupAptPack([{ name: "p7zip-full", version }])
return installAptPack([{ name: "p7zip-full", version }])
}
throw new Error("Unsupported linux distribution")
}

View File

@ -1,9 +1,9 @@
import os from "os"
import { warning } from "ci-log"
import memoize from "micro-memoize"
import { installAptPack } from "setup-apt"
import { getUbuntuVersion } from "ubuntu-version"
import which from "which"
import { setupAptPack } from "../setup/setupAptPack.js"
import { isUbuntu } from "./isUbuntu.js"
async function ubuntuVersion_raw(): Promise<number[] | null> {
@ -11,7 +11,7 @@ async function ubuntuVersion_raw(): Promise<number[] | null> {
if (isUbuntu()) {
try {
if (which.sync("lsb_release", { nothrow: true }) === null) {
await setupAptPack([{ name: "lsb-release" }])
await installAptPack([{ name: "lsb-release" }])
}
} catch {
return detectUsingOsVersion()

View File

@ -1,346 +0,0 @@
import { defaultExecOptions, execRoot, execRootSync } from "admina"
import { GITHUB_ACTIONS } from "ci-info"
import { info, warning } from "ci-log"
import escapeRegex from "escape-string-regexp"
import { type ExecaError, execa } from "execa"
import { appendFile } from "fs/promises"
import { sourceRC } from "os-env"
import { pathExists } from "path-exists"
import which from "which"
import { rcOptions } from "../../cli-options.js"
import type { InstallationInfo } from "./setupBin.js"
/* eslint-disable require-atomic-updates */
let didUpdate: boolean = false
let didInit: boolean = false
// wait up to 300 seconds if the apt-get lock is held
export const aptTimeout = "Dpkg::Lock::Timeout=300"
export type AptPackage = {
name: string
version?: string
repositories?: string[]
}
const retryErrors = [
"E: Could not get lock",
"dpkg: error processing archive",
"dpkg: error: dpkg status database is locked by another process",
]
/** A function that installs a package using apt */
export async function setupAptPack(packages: AptPackage[], update = false): Promise<InstallationInfo> {
const apt: string = getApt()
for (const { name, version } of packages) {
info(`Installing ${name} ${version ?? ""} via ${apt}`)
}
// Update the repos if needed
if (update) {
updateRepos(apt)
didUpdate = true
}
// Add the repos if needed
await addRepositories(apt, packages)
const needToInstall = await filterAndQualifyAptPackages(apt, packages)
if (needToInstall.length === 0) {
info("All packages are already installed")
return { binDir: "/usr/bin/" }
}
// Initialize apt if needed
if (!didInit) {
await initApt(apt)
didInit = true
}
// Install
try {
execRootSync(apt, ["install", "--fix-broken", "-y", ...needToInstall], { ...defaultExecOptions, env: getEnv(apt) })
} catch (err) {
if (isExecaError(err)) {
if (retryErrors.some((error) => err.stderr.includes(error))) {
warning(`Failed to install packages ${needToInstall}. Retrying...`)
execRootSync(
apt,
["install", "--fix-broken", "-y", "-o", aptTimeout, ...needToInstall],
{ ...defaultExecOptions, env: getEnv(apt) },
)
}
} else {
throw err
}
}
return { binDir: "/usr/bin/" }
}
function isExecaError(err: unknown): err is ExecaError {
return typeof (err as ExecaError).stderr === "string"
}
export function hasNala() {
return which.sync("nala", { nothrow: true }) !== null
}
export function getApt() {
let apt: string
if (hasNala()) {
apt = "nala"
} else {
apt = "apt-get"
}
return apt
}
function getEnv(apt: string) {
const env: NodeJS.ProcessEnv = { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
if (apt === "nala") {
// if LANG/LC_ALL is not set, enable utf8 otherwise nala fails because of ASCII encoding
if (env.LANG === undefined) {
env.LANG = "C.UTF-8"
}
if (env.LC_ALL === undefined) {
env.LC_ALL = "C.UTF-8"
}
}
return env
}
export enum AptPackageType {
NameDashVersion = 0,
NameEqualsVersion = 1,
Name = 2,
None = 3,
}
/**
* Filter out the packages that are already installed and qualify the packages into a full package name/version
*/
async function filterAndQualifyAptPackages(apt: string, packages: AptPackage[]) {
return (await Promise.all(packages.map((pack) => qualifiedNeededAptPackage(apt, pack))))
.filter((pack) => pack !== undefined)
}
async function qualifiedNeededAptPackage(apt: string, pack: AptPackage) {
// Qualify the packages into full package name/version
const qualified = await getAptArg(apt, pack.name, pack.version)
// filter out the packages that are already installed
return (await isPackageInstalled(qualified)) ? undefined : qualified
}
async function addRepositories(apt: string, packages: AptPackage[]) {
const allRepositories = [...new Set(packages.flatMap((pack) => pack.repositories ?? []))]
if (allRepositories.length !== 0) {
if (!didInit) {
await initApt(apt)
didInit = true
}
await installAddAptRepo(apt)
for (const repo of allRepositories) {
// eslint-disable-next-line no-await-in-loop
execRootSync("add-apt-repository", ["-y", "--no-update", repo], { ...defaultExecOptions, env: getEnv(apt) })
}
updateRepos(apt)
didUpdate = true
}
}
async function aptPackageType(apt: string, name: string, version: string | undefined): Promise<AptPackageType> {
if (version !== undefined && version !== "") {
const { stdout } = await execa("apt-cache", [
"search",
"--names-only",
`^${escapeRegex(name)}-${escapeRegex(version)}$`,
], { env: getEnv(apt), stdio: "pipe" })
if (stdout.trim() !== "") {
return AptPackageType.NameDashVersion
}
try {
// check if apt-get show can find the version
// eslint-disable-next-line @typescript-eslint/no-shadow
const { stdout } = await execa("apt-cache", ["show", `${name}=${version}`], { env: getEnv(apt) })
if (stdout.trim() === "") {
return AptPackageType.NameEqualsVersion
}
} catch {
// ignore
}
}
try {
const { stdout: showStdout } = await execa("apt-cache", ["show", name], { env: getEnv(apt), stdio: "pipe" })
if (showStdout.trim() !== "") {
return AptPackageType.Name
}
} catch {
// ignore
}
// If apt-cache fails, update the repos and try again
if (!didUpdate) {
updateRepos(getApt())
didUpdate = true
return aptPackageType(apt, name, version)
}
return AptPackageType.None
}
async function getAptArg(apt: string, name: string, version: string | undefined) {
const package_type = await aptPackageType(apt, name, version)
switch (package_type) {
case AptPackageType.NameDashVersion:
return `${name}-${version}`
case AptPackageType.NameEqualsVersion:
return `${name}=${version}`
case AptPackageType.Name:
if (version !== undefined && version !== "") {
warning(`Could not find package ${name} with version ${version}. Installing the latest version.`)
}
return name
default:
throw new Error(`Could not find package ${name} ${version ?? ""}`)
}
}
function updateRepos(apt: string) {
execRootSync(
apt,
apt !== "nala" ? ["update", "-y", "-o", aptTimeout] : ["update", "-o", aptTimeout],
{ ...defaultExecOptions, env: getEnv(apt) },
)
}
async function installAddAptRepo(apt: string) {
if (await isPackageInstalled("software-properties-common")) {
return
}
execRootSync(
apt,
["install", "-y", "--fix-broken", "-o", aptTimeout, "software-properties-common"],
{ ...defaultExecOptions, env: getEnv(apt) },
)
}
/** Install gnupg and certificates (usually missing from docker containers) */
async function initApt(apt: string) {
// Update the repos if needed
if (!didUpdate) {
updateRepos(apt)
didUpdate = true
}
const toInstall = await filterAndQualifyAptPackages(apt, [
{ name: "ca-certificates" },
{ name: "gnupg" },
{ name: "apt-utils" },
])
if (toInstall.length !== 0) {
execRootSync(apt, ["install", "-y", "--fix-broken", "-o", aptTimeout, ...toInstall], {
...defaultExecOptions,
env: getEnv(apt),
})
}
const promises: Promise<string | void>[] = [
addAptKeyViaServer(["3B4FE6ACC0B21F32", "40976EAF437D05B5"], "setup-cpp-ubuntu-archive.gpg"),
addAptKeyViaServer(["1E9377A2BA9EF27F"], "launchpad-toolchain.gpg"),
]
await Promise.all(promises)
}
function initGpg() {
execRootSync("gpg", ["-k"])
}
export async function addAptKeyViaServer(keys: string[], name: string, server = "keyserver.ubuntu.com") {
try {
const fileName = `/etc/apt/trusted.gpg.d/${name}`
if (!(await pathExists(fileName))) {
initGpg()
await Promise.all(
keys.map(async (key) => {
await execRoot("gpg", [
"--no-default-keyring",
"--keyring",
`gnupg-ring:${fileName}`,
"--keyserver",
server,
"--recv-keys",
key,
])
await execRoot("chmod", ["644", fileName])
}),
)
}
return fileName
} catch (err) {
warning(`Failed to add apt key via server ${server}: ${err}`)
return undefined
}
}
export async function addAptKeyViaDownload(name: string, url: string) {
const fileName = `/etc/apt/trusted.gpg.d/${name}`
if (!(await pathExists(fileName))) {
initGpg()
await setupAptPack([{ name: "curl" }, { name: "ca-certificates" }], undefined)
await execa("curl", ["-s", url, "-o", `/tmp/${name}`])
execRootSync("gpg", ["--no-default-keyring", "--keyring", `gnupg-ring:${fileName}`, "--import", `/tmp/${name}`])
execRootSync("chmod", ["644", fileName])
}
return fileName
}
export async function updateAptAlternatives(name: string, path: string, rcPath: string, priority: number = 40) {
if (GITHUB_ACTIONS) {
await execRoot("update-alternatives", ["--install", `/usr/bin/${name}`, name, path, priority.toString()])
} else {
await sourceRC(rcOptions)
await appendFile(
rcPath,
`\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${name} ${name} ${path} ${priority}; fi\n`,
)
}
}
export async function isPackageInstalled(pack: string) {
try {
// check if a package is installed
const { stdout } = await execa("dpkg", ["-s", pack], { env: getEnv("apt-get"), stdio: "pipe" })
if (typeof stdout !== "string") {
return false
}
const lines = stdout.split("\n")
// check if the output contains a line that starts with "Status: install ok installed"
return lines.some((line) => line.startsWith("Status: install ok installed"))
} catch {
return false
}
}
export async function isPackageRegexInstalled(regexp: string) {
try {
// check if a package matching the regexp is installed
const { stdout } = await execa("dpkg", ["-l", regexp], { env: getEnv("apt-get"), stdio: "pipe" })
if (typeof stdout !== "string") {
return false
}
const lines = stdout.split("\n")
// check if the output contains any lines that start with "ii"
return lines.some((line) => line.startsWith("ii"))
} catch {
return false
}
}

View File

@ -7,11 +7,11 @@ import { tmpdir } from "os"
import { GITHUB_ACTIONS } from "ci-info"
import { pathExists } from "path-exists"
import retry from "retry-as-promised"
import { installAptPack } from "setup-apt"
import { maybeGetInput, rcOptions } from "../../cli-options.js"
import { hasDnf } from "../env/hasDnf.js"
import { isArch } from "../env/isArch.js"
import { isUbuntu } from "../env/isUbuntu.js"
import { setupAptPack } from "./setupAptPack.js"
import { setupDnfPack } from "./setupDnfPack.js"
import { setupPacmanPack } from "./setupPacmanPack.js"
@ -108,7 +108,7 @@ export async function setupBin(
} else if (hasDnf()) {
await setupDnfPack([{ name: "unzip" }, { name: "tar" }, { name: "xz" }])
} else if (isUbuntu()) {
await setupAptPack([{ name: "unzip" }, { name: "tar" }, { name: "xz-utils" }])
await installAptPack([{ name: "unzip" }, { name: "tar" }, { name: "xz-utils" }])
}
}
// eslint-disable-next-line require-atomic-updates

View File

@ -5,6 +5,7 @@ import { mkdirp } from "mkdirp"
import { addPath } from "os-env"
import { pathExists } from "path-exists"
import { addExeExt, dirname, join } from "patha"
import { installAptPack } from "setup-apt"
import { untildifyUser } from "untildify-user"
import which from "which"
import { rcOptions } from "../../cli-options.js"
@ -14,7 +15,6 @@ import { hasDnf } from "../env/hasDnf.js"
import { isArch } from "../env/isArch.js"
import { isUbuntu } from "../env/isUbuntu.js"
import { ubuntuVersion } from "../env/ubuntu_version.js"
import { setupAptPack } from "./setupAptPack.js"
import type { InstallationInfo } from "./setupBin.js"
import { setupDnfPack } from "./setupDnfPack.js"
import { setupPacmanPack } from "./setupPacmanPack.js"
@ -183,7 +183,7 @@ export function setupPipPackSystem(name: string, addPythonPrefix = true) {
} else if (hasDnf()) {
return setupDnfPack([{ name: addPythonPrefix ? `python3-${name}` : name }])
} else if (isUbuntu()) {
return setupAptPack([{ name: addPythonPrefix ? `python3-${name}` : name }])
return installAptPack([{ name: addPythonPrefix ? `python3-${name}` : name }])
}
}
return null

View File

@ -4,12 +4,12 @@ import { execaSync } from "execa"
import { addPath } from "os-env"
import { pathExists } from "path-exists"
import { addShExt, addShRelativePrefix, dirname, join } from "patha"
import { installAptPack } from "setup-apt"
import which from "which"
import { rcOptions } from "../cli-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { setupAptPack } from "../utils/setup/setupAptPack.js"
import type { InstallationInfo } from "../utils/setup/setupBin.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
@ -40,7 +40,7 @@ export async function setupVcpkg(version: string, setupDir: string, _arch: strin
{ name: "pkg-config" },
])
} else if (isUbuntu()) {
await setupAptPack([
await installAptPack([
{ name: "curl" },
{ name: "zip" },
{ name: "unzip" },

View File

@ -4,16 +4,13 @@
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": ["dist/**"]
"outputs": ["dist/"]
},
"lint.tsc": {
"dependsOn": ["build", "^lint.tsc"],
"inputs": ["$TURBO_DEFAULT$", ".env*"]
"dependsOn": ["build", "^lint.tsc"]
},
"lint.eslint": {
"dependsOn": ["build", "^lint.eslint"],
"inputs": ["$TURBO_DEFAULT$", ".env*"]
"dependsOn": ["build", "^lint.eslint"]
},
"lint": {
"dependsOn": ["lint.tsc", "lint.eslint"]