Merge pull request #132 from aminya/update-deps [skip ci]

This commit is contained in:
Amin Yahyaabadi 2022-10-19 15:23:57 -07:00 committed by GitHub
commit 83ace57d30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 1260 additions and 1098 deletions

View File

@ -80,8 +80,8 @@ inputs:
required: false
runs:
using: "node12"
main: "dist/setup_cpp.js"
using: "node16"
main: "dist/node16/setup_cpp.js"
branding:
icon: "award"

View File

@ -11,7 +11,7 @@ RUN pacman -S --noconfirm --needed nodejs
RUN pacman -S --noconfirm --needed curl
# add setup_cpp.js
COPY "./dist/" "/"
COPY "./dist/node12" "/"
WORKDIR "/"
# run installation

View File

@ -8,7 +8,7 @@ RUN dnf -y install nodejs
RUN dnf -y install curl
# add setup_cpp.js
COPY "./dist/" "/"
COPY "./dist/node12" "/"
WORKDIR "/"
# run installation

View File

@ -12,7 +12,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y --no-install-recommends nodejs
# add setup_cpp.js
ADD "./dist/" "/"
COPY "./dist/node12" "/"
WORKDIR "/"
# run installation

View File

@ -4,7 +4,7 @@ RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends nodejs
# add setup_cpp.js
COPY "./dist/" "/"
COPY "./dist/node12" "/"
WORKDIR "/"
# run installation

View File

@ -27,7 +27,7 @@ function main() {
return Promise.all(
exes.map((exe) =>
exec(
`./node_modules/.bin/caxa --input ./dist --output ./exe/setup_cpp_${getPlatformName()}${exe} -- "{{caxa}}/node_modules/.bin/node${exe}" "{{caxa}}/setup_cpp.js"`
`./node_modules/.bin/caxa --input ./dist/node16 --output ./exe/setup_cpp_${getPlatformName()}${exe} -- "{{caxa}}/node_modules/.bin/node${exe}" "{{caxa}}/setup_cpp.js"`
)
)
)

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

2
dist/node12/setup_cpp.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/node12/setup_cpp.js.map vendored Normal file

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

17
dist/node16/gcc_matcher.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "gcc",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}

17
dist/node16/llvm_matcher.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "llvm",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}

18
dist/node16/msvc_matcher.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "msvc",
"pattern": [
{
"regexp": "^(?:\\s+\\d+>)?(\\S.*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
]
}
]
}

18
dist/node16/python_matcher.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "python",
"pattern": [
{
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
"file": 1,
"line": 2
},
{
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
"message": 2
}
]
}
]
}

2
dist/node16/setup_cpp.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/node16/setup_cpp.js.map vendored Normal file

File diff suppressed because one or more lines are too long

2
dist/setup_cpp.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

@ -6,17 +6,17 @@
"license": "Apache-2.0",
"author": "Amin Yahyaabadi",
"exports": {
"import": "./dist/setup-cpp.mjs",
"require": "./dist/setup-cpp.js"
"import": "./dist/node12/setup-cpp.mjs",
"require": "./dist/node12/setup-cpp.js"
},
"main": "./dist/setup_cpp.js",
"main": "./dist/node12/setup_cpp.js",
"source": "./src/main.ts",
"bin": {
"setup-cpp": "./dist/setup_cpp.js",
"setup_cpp": "./dist/setup_cpp.js"
"setup-cpp": "./dist/node12/setup_cpp.js",
"setup_cpp": "./dist/node12/setup_cpp.js"
},
"scripts": {
"build": "shx rm -rf dist/ && shx mkdir ./dist && run-p lint.tsc build.parcel copy.matchers",
"build": "shx rm -rf dist/ && shx mkdir -p ./dist/node12 ./dist/node16 && run-p lint.tsc build.parcel copy.matchers",
"build.docker": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup_cpp .",
"build.docker.arch": "pnpm build && docker build -f ./dev/docker/arch_node.dockerfile -t setup_cpp:arch .",
"build.docker.fedora": "pnpm build && docker build -f ./dev/docker/fedora_node.dockerfile -t setup_cpp:fedora .",
@ -24,7 +24,7 @@
"build.parcel": "cross-env NODE_ENV=production parcel build --detailed-report",
"bump": "ncu -u -x execa,numerous && pnpm update",
"clean": "shx rm -rf .parcel-cache dist exe",
"copy.matchers": "shx cp ./src/gcc/gcc_matcher.json ./dist/ && shx cp ./src/msvc/msvc_matcher.json ./dist && shx cp ./src/python/python_matcher.json ./dist/ && shx cp ./src/llvm/llvm_matcher.json ./dist/ ",
"copy.matchers": "shx cp ./src/gcc/gcc_matcher.json ./dist/node12/ && shx cp ./src/msvc/msvc_matcher.json ./dist/node12/ && shx cp ./src/python/python_matcher.json ./dist/node12/ && shx cp ./src/llvm/llvm_matcher.json ./dist/node12/ && shx cp ./dist/node12/*.json ./dist/node16/",
"dev": "cross-env NODE_ENV=development parcel watch",
"docs": "shx rm -rf packages/*/README.md && pnpm -r exec readme --path ../../dev/readme/template.md -y && pnpm -r exec ts-readme",
"format": "run-s lint.prettier",
@ -50,7 +50,7 @@
},
"prettier": "prettier-config-atomic",
"dependencies": {
"@actions/core": "^1.9.1",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^2.0.1",
@ -65,8 +65,8 @@
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",
"numerous": "1.0.3",
"patha": "^0.4.1",
"semver": "7.3.7",
"setup-python": "github:actions/setup-python#c474c82340438924daab9282d07300bfe7e3692d",
"semver": "7.3.8",
"setup-python": "github:actions/setup-python#v4.3.0",
"time-delta": "github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e",
"ubuntu-version": "^2.0.0",
"untildify-user": "workspace:1.0.0",
@ -75,21 +75,21 @@
},
"devDependencies": {
"@types/cross-spawn": "^6.0.2",
"@types/jest": "^29.0.3",
"@types/jest": "^29.2.0",
"@types/mri": "^1.1.1",
"@types/node": "^18.7.18",
"@types/node": "^18.11.2",
"@types/semver": "^7.3.12",
"@types/which": "^2.0.1",
"caxa": "^2.1.0",
"caxa": "^3.0.1",
"cross-env": "7.0.3",
"cross-spawn": "^7.0.3",
"cspell": "^6.9.1",
"eslint": "^8.23.1",
"cspell": "^6.12.0",
"eslint": "^8.25.0",
"eslint-config-atomic": "^1.18.1",
"gen-readme": "^1.6.0",
"jest": "^29.0.3",
"jest": "^29.2.1",
"loose-ts-check": "^1.2.0",
"npm-check-updates": "^16.1.3",
"npm-check-updates": "^16.3.14",
"npm-run-all2": "^6.0.2",
"parcel": "2.7.0",
"prettier": "2.7.1",
@ -97,9 +97,9 @@
"readme-md-generator": "^1.0.0",
"shx": "0.3.4",
"terser-config-atomic": "^0.1.1",
"ts-jest": "^29.0.1",
"ts-jest": "^29.0.3",
"ts-readme": "^1.1.3",
"typescript": "^4.8.3"
"typescript": "^4.8.4"
},
"engines": {
"node": ">=12.x"
@ -127,10 +127,11 @@
"electron": false,
"patha": "patha/dist/index.node.mjs"
},
"main.actions": "./dist/node16/setup_cpp.js",
"pnpm": {
"overrides": {
"semver": "7.3.7",
"eslint": "^8.23.1",
"semver": "7.3.8",
"eslint": "^8.25.0",
"prettier": "2.7.1",
"lru-cache": "7.8.1",
"core-js": "*",
@ -151,6 +152,15 @@
"includeNodeModules": true,
"optimize": true,
"outputFormat": "commonjs"
},
"main.actions": {
"context": "node",
"engines": {
"node": ">=16.x"
},
"includeNodeModules": true,
"optimize": true,
"outputFormat": "commonjs"
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -5,69 +5,47 @@ import { info, warning } from "ci-log"
import { debug } from "@actions/core"
import { join } from "patha"
import ciDetect from "@npmcli/ci-detect"
import { isCacheFeatureAvailable, IS_LINUX, IS_WINDOWS } from "setup-python/src/utils"
import { isCacheFeatureAvailable, IS_MAC } from "setup-python/src/utils"
import { getCacheDistributor } from "setup-python/src/cache-distributions/cache-factory"
function isPyPyVersion(versionSpec: string) {
return versionSpec.startsWith("pypy")
}
/*
function resolveVersionInput(version: string): string {
let versionFile = getInput("python-version-file")
if (version && versionFile) {
warning("Both python-version and python-version-file inputs are specified, only python-version will be used")
}
if (version) {
return version
}
versionFile = versionFile || ".python-version"
if (!existsSync(versionFile)) {
throw new Error(`The specified python version file at: ${versionFile} does not exist`)
}
version = readFileSync(versionFile, "utf8")
info(`Resolved ${versionFile} as ${version}`)
return version
}
*/
export async function cacheDependencies(cache: string, pythonVersion: string) {
const cacheDependencyPath = undefined // core.getInput("cache-dependency-path") || undefined
const cacheDependencyPath = undefined
const cacheDistributor = getCacheDistributor(cache, pythonVersion, cacheDependencyPath)
await cacheDistributor.restoreCache()
}
const checkLatest = false
export async function setupActionsPython(version: string, _setupDir: string, arch: string) {
// According to the README windows binaries do not require to be installed
// in the specific location, but Mac and Linux do
if (!IS_WINDOWS && !process.env.AGENT_TOOLSDIRECTORY?.trim()) {
if (IS_LINUX) {
process.env.AGENT_TOOLSDIRECTORY = "/opt/hostedtoolcache"
} else {
process.env.AGENT_TOOLSDIRECTORY = "/Users/runner/hostedtoolcache"
}
if (IS_MAC) {
process.env.AGENT_TOOLSDIRECTORY = "/Users/runner/hostedtoolcache"
}
const agent_toolsdirectory = process.env.AGENT_TOOLSDIRECTORY?.trim()
if (typeof agent_toolsdirectory === "string" && agent_toolsdirectory !== "") {
process.env.RUNNER_TOOL_CACHE = process.env.AGENT_TOOLSDIRECTORY
}
debug(`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env.RUNNER_TOOL_CACHE}`)
// const version = resolveVersionInput(versionGiven)
debug(`Python is expected to be installed into ${process.env.RUNNER_TOOL_CACHE}`)
if (version) {
let pythonVersion: string
if (isPyPyVersion(version)) {
const installed = await findPyPyVersion(version, arch, true)
const installed = await findPyPyVersion(version, arch, true, checkLatest)
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`
info(`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`)
} else {
const installed = await useCpythonVersion(version, arch, true)
const installed = await useCpythonVersion(version, arch, true, checkLatest)
pythonVersion = installed.version
info(`Successfully set up ${installed.impl} (${pythonVersion})`)
}
if (isCacheFeatureAvailable()) {
const cache = "pip" // core.getInput("cache") // package manager used for caching
const cache = "pip" // package manager used for caching
await cacheDependencies(cache, pythonVersion)
}
}

View File

@ -2,7 +2,7 @@
"compilerOptions": {
"strict": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"noUnusedLocals": false,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noImplicitAny": true,