fix: fix timeouts by using memoizee

This commit is contained in:
Amin Yahyaabadi 2024-08-29 16:12:54 -07:00
parent 9a295dea76
commit c17f568574
No known key found for this signature in database
GPG Key ID: F52AF77F636088F0
21 changed files with 300 additions and 160 deletions

View File

@ -12,24 +12,20 @@ ignorePaths:
- .vscode/extensions.json
words:
- aarch
- hadolint
- aminya
- envosman
- applellvm
- biome
- biomejs
- bazel
- bazelisk
- biome
- biomejs
- buildtools
- caxa
- ccache
- choco
- clangd
- cmake
- iarna
- cobertura
- copr
- pnpx
- CPATH
- Cppcheck
- CPPFLAGS
@ -43,6 +39,7 @@ words:
- DVCPKG
- dyld
- eabi
- envosman
- esmodule
- execa
- ftxui
@ -50,6 +47,8 @@ words:
- gcovr
- ghes
- Graphviz
- hadolint
- iarna
- inja
- isci
- isroot
@ -61,6 +60,7 @@ words:
- libdw
- libstdc
- libtinfo
- memoizee
- msbuild
- msvc
- msvcrt
@ -79,6 +79,7 @@ words:
- patha
- pipx
- pnpm
- pnpx
- pwsh
- pygments
- pypy

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

@ -73,6 +73,7 @@
"@types/eslint": "^8.56.11",
"@types/iarna__toml": "~2.0.5",
"@types/jest": "^29.5.12",
"@types/memoizee": "^0.4.11",
"@types/node": "^12.20.55",
"@types/semver": "^7.5.8",
"@types/which": "^3.0.4",
@ -86,10 +87,10 @@
"cspell": "^8.13.3",
"diagnostics_channel": "^1.1.0",
"dprint": "^0.47.2",
"envosman": "workspace:*",
"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:*",
@ -98,14 +99,14 @@
"jest": "^29.7.0",
"lefthook": "^1.7.12",
"macos-release": "^3.3.0",
"micro-memoize": "^4.1.2",
"memoizee": "^0.4.17",
"mkdirp": "^3.0.1",
"mri": "^1.2.0",
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#c01f519bd995460228ed3dec4df51df92dc290fd",
"node-downloader-helper": "2.1.9",
"npm-check-updates": "^17.0.6",
"npm-run-all2": "^6.2.2",
"numerous": "1.0.3",
"envosman": "workspace:*",
"p-timeout": "^6.1.2",
"parcel": "2.0.0-canary.1717",
"path-exists": "^5.0.0",
@ -115,8 +116,9 @@
"readme-md-generator": "^1.0.0",
"retry-as-promised": "^7.0.4",
"semver": "7.6.3",
"setup-python": "github:aminya/setup-python#a783db655c6e40317e2c0c96f9d162d9c9f4a751",
"setup-apt": "workspace:*",
"setup-brew": "workspace:*",
"setup-python": "github:aminya/setup-python#a783db655c6e40317e2c0c96f9d162d9c9f4a751",
"shx": "0.3.4",
"simple-update-notifier": "^2.0.0",
"terser-config-atomic": "^1.0.0",
@ -129,8 +131,7 @@
"untildify-user": "workspace:*",
"util.types": "^0.0.2",
"web-streams-polyfill": "^4.0.0",
"which": "^4.0.0",
"node-downloader-helper": "2.1.9"
"which": "^4.0.0"
},
"productionDependencies": [
"@actions/core",
@ -149,7 +150,7 @@
"exec-powershell",
"execa",
"is-url-online",
"micro-memoize",
"memoizee",
"mri",
"msvc-dev-cmd",
"node-downloader-helper",

View File

@ -23,7 +23,7 @@
"ci-info": "^4.0.0",
"escape-path-with-spaces": "^1.0.2",
"escape-quotes": "^1.0.2",
"micro-memoize": "^4.1.2",
"memoizee": "^0.4.17",
"path-exists": "^5.0.0",
"ci-log": "workspace:*",
"exec-powershell": "workspace:*",
@ -45,5 +45,7 @@
"unix",
"macos"
],
"devDependencies": {}
"devDependencies": {
"@types/memoizee": "0.4.11"
}
}

View File

@ -1,7 +1,7 @@
import { promises } from "fs"
import { grantUserWriteAccess } from "admina"
import { info, warning } from "ci-log"
import memoize from "micro-memoize"
import memoize from "memoizee"
import { pathExists } from "path-exists"
import { untildifyUser } from "untildify-user"
const { appendFile, readFile, writeFile } = promises
@ -38,7 +38,7 @@ async function sourceRCInRc_(options: RcOptions) {
/**
* handles adding conditions to source rc file from .bashrc and .profile
*/
export const sourceRCInRc = memoize(sourceRCInRc_, { isPromise: true })
export const sourceRCInRc = memoize(sourceRCInRc_, { promise: true })
async function addRCHeader(options: RcOptions) {
// a variable that prevents source rc from being called from .bashrc and .profile

View File

@ -27,7 +27,7 @@
"execa": "^7.2.0",
"escape-string-regexp": "^5.0.0",
"node-downloader-helper": "2.1.9",
"micro-memoize": "^4.1.2"
"memoizee": "^0.4.17"
},
"engines": {
"node": ">=12"
@ -49,5 +49,7 @@
"package",
"apt-key"
],
"devDependencies": {}
"devDependencies": {
"@types/memoizee": "0.4.11"
}
}

View File

@ -11,9 +11,8 @@ export async function addAptRepository(repo: string, apt = getApt()) {
await installAddAptRepo(apt)
execRootSync("add-apt-repository", ["-y", "--no-update", repo], { ...defaultExecOptions, env: getAptEnv(apt) })
// clear the cache
updateAptReposMemoized.cache.keys = []
updateAptReposMemoized.cache.values = []
// Update the repos
updateAptReposMemoized.clear() // ensure update is called
updateAptReposMemoized(apt)
}

View File

@ -1,5 +1,5 @@
import { defaultExecOptions, execRootSync } from "admina"
import memoize from "micro-memoize"
import memoize from "memoizee"
import { getAptEnv } from "./apt-env.js"
import { aptTimeout } from "./apt-timeout.js"
import { filterAndQualifyAptPackages } from "./qualify-install.js"
@ -25,4 +25,4 @@ export async function initApt(apt: string) {
}
/** Install gnupg and certificates (usually missing from docker containers) (memoized) */
export const initAptMemoized = memoize(initApt, { isPromise: true })
export const initAptMemoized = memoize(initApt, { promise: true })

View File

@ -4,7 +4,7 @@ import { execa } from "execa"
import { getAptEnv } from "./apt-env.js"
import type { AptPackage } from "./install.js"
import { isAptPackInstalled } from "./is-installed.js"
import { updateAptReposMemoized } from "./update.js"
import { updateAptReposMemoized, updatedRepos } from "./update.js"
/**
* The type of apt package to install
@ -64,7 +64,7 @@ async function aptPackageType(apt: string, name: string, version: string | undef
}
// If apt-cache fails, update the repos and try again
if (!updateAptReposMemoized.cache.keys.includes([apt])) {
if (!updatedRepos) {
updateAptReposMemoized(apt)
return aptPackageType(apt, name, version)
}

View File

@ -1,9 +1,11 @@
import { defaultExecOptions, execRootSync } from "admina"
import memoize from "micro-memoize"
import memoize from "memoizee"
import { getAptEnv } from "./apt-env.js"
import { aptTimeout } from "./apt-timeout.js"
import { getApt } from "./get-apt.js"
export let updatedRepos = false // eslint-disable-line import/no-mutable-exports
/**
* Update the apt repositories
* @param apt The apt command to use (optional)
@ -14,6 +16,8 @@ export function updateAptRepos(apt: string = getApt()) {
apt !== "nala" ? ["update", "-y", "-o", aptTimeout] : ["update", "-o", aptTimeout],
{ ...defaultExecOptions, env: getAptEnv(apt) },
)
updatedRepos = true
}
/**

View File

@ -53,6 +53,9 @@ importers:
'@types/jest':
specifier: ^29.5.12
version: 29.5.12
'@types/memoizee':
specifier: ^0.4.11
version: 0.4.11
'@types/node':
specifier: ^12.20.55
version: 12.20.55
@ -128,9 +131,9 @@ importers:
macos-release:
specifier: ^3.3.0
version: 3.3.0
micro-memoize:
specifier: ^4.1.2
version: 4.1.2
memoizee:
specifier: ^0.4.17
version: 0.4.17
mkdirp:
specifier: ^3.0.1
version: 3.0.1
@ -263,15 +266,19 @@ importers:
exec-powershell:
specifier: workspace:*
version: link:../exec-powershell
micro-memoize:
specifier: ^4.1.2
version: 4.1.2
memoizee:
specifier: ^0.4.17
version: 0.4.17
path-exists:
specifier: ^5.0.0
version: 5.0.0
untildify-user:
specifier: workspace:*
version: link:../untildify-user
devDependencies:
'@types/memoizee':
specifier: 0.4.11
version: 0.4.11
packages/exec-powershell:
dependencies:
@ -312,9 +319,9 @@ importers:
execa:
specifier: ^7.2.0
version: 7.2.0
micro-memoize:
specifier: ^4.1.2
version: 4.1.2
memoizee:
specifier: ^0.4.17
version: 0.4.17
node-downloader-helper:
specifier: 2.1.9
version: 2.1.9
@ -324,6 +331,10 @@ importers:
which:
specifier: 4.0.0
version: 4.0.0
devDependencies:
'@types/memoizee':
specifier: 0.4.11
version: 0.4.11
packages/setup-brew:
dependencies:
@ -1698,6 +1709,9 @@ packages:
'@types/mdast@4.0.4':
resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==}
'@types/memoizee@0.4.11':
resolution: {integrity: sha512-2gyorIBZu8GoDr9pYjROkxWWcFtHCquF7TVbN2I+/OvgZhnIGQS0vX5KJz4lXNKb8XOSfxFOSG5OLru1ESqLUg==}
'@types/minimatch@5.1.2':
resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==}
@ -2459,6 +2473,10 @@ packages:
resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==}
engines: {node: '>=8.0.0'}
d@1.0.2:
resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==}
engines: {node: '>=0.12'}
damerau-levenshtein@1.0.8:
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
@ -2739,6 +2757,20 @@ packages:
resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==}
engines: {node: '>= 0.4'}
es5-ext@0.10.64:
resolution: {integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==}
engines: {node: '>=0.10'}
es6-iterator@2.0.3:
resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==}
es6-symbol@3.1.4:
resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==}
engines: {node: '>=0.12'}
es6-weak-map@2.0.3:
resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==}
escalade@3.1.2:
resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==}
engines: {node: '>=6'}
@ -2946,6 +2978,10 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
hasBin: true
esniff@2.0.1:
resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==}
engines: {node: '>=0.10'}
espree@9.6.1:
resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@ -2975,6 +3011,9 @@ packages:
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
engines: {node: '>=0.10.0'}
event-emitter@0.3.5:
resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==}
event-target-shim@5.0.1:
resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==}
engines: {node: '>=6'}
@ -3003,6 +3042,9 @@ packages:
resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
ext@1.7.0:
resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==}
external-editor@3.1.0:
resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==}
engines: {node: '>=4'}
@ -3520,6 +3562,9 @@ packages:
resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==}
engines: {node: '>=12'}
is-promise@2.2.2:
resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==}
is-regex@1.1.4:
resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
engines: {node: '>= 0.4'}
@ -4022,6 +4067,9 @@ packages:
lru-cache@5.1.1:
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
lru-queue@0.1.0:
resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==}
macos-release@3.3.0:
resolution: {integrity: sha512-tPJQ1HeyiU2vRruNGhZ+VleWuMQRro8iFtJxYgnS4NQe+EukKF6aGiIT+7flZhISAt2iaXBCfFGvAyif7/f8nQ==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@ -4063,6 +4111,10 @@ packages:
meant@1.0.3:
resolution: {integrity: sha512-88ZRGcNxAq4EH38cQ4D85PM57pikCwS8Z99EWHODxN7KBY+UuPiqzRTtZzS8KTXO/ywSWbdjjJST2Hly/EQxLw==}
memoizee@0.4.17:
resolution: {integrity: sha512-DGqD7Hjpi/1or4F/aYAspXKNm5Yili0QDAFAY4QYvpqpgiY6+1jOfqpmByzjxbWd/T9mChbCArXAbDAsTm5oXA==}
engines: {node: '>=0.12'}
memorystream@0.3.1:
resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==}
engines: {node: '>= 0.10.0'}
@ -4074,9 +4126,6 @@ packages:
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
engines: {node: '>= 8'}
micro-memoize@4.1.2:
resolution: {integrity: sha512-+HzcV2H+rbSJzApgkj0NdTakkC+bnyeiUxgT6/m7mjcz1CmM22KYFKp+EVj1sWe4UYcnriJr5uqHQD/gMHLD+g==}
micromark-core-commonmark@2.0.1:
resolution: {integrity: sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==}
@ -4220,6 +4269,9 @@ packages:
natural-compare@1.4.0:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
next-tick@1.1.0:
resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==}
node-addon-api@6.1.0:
resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==}
@ -5018,6 +5070,10 @@ packages:
version: 1.0.0
engines: {node: '>=12'}
timers-ext@0.1.8:
resolution: {integrity: sha512-wFH7+SEAcKfJpfLPkrgMPvvwnEtj8W4IurvEyrKsDleXnKLCDw71w8jltvfLa8Rm4qQxxT4jmDBYbJG/z7qoww==}
engines: {node: '>=0.12'}
timsort@0.3.0:
resolution: {integrity: sha512-qsdtZH+vMoCARQtyod4imc2nIJwg9Cc7lPRrw9CzF8ZKR0khdr8+2nX80PBhET3tcyTtJDxAffGh2rXH4tyU8A==}
@ -5164,6 +5220,9 @@ packages:
resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==}
engines: {node: '>=12.20'}
type@2.7.3:
resolution: {integrity: sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==}
typed-array-buffer@1.0.2:
resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==}
engines: {node: '>= 0.4'}
@ -7195,6 +7254,8 @@ snapshots:
dependencies:
'@types/unist': 3.0.3
'@types/memoizee@0.4.11': {}
'@types/minimatch@5.1.2': {}
'@types/ms@0.7.34': {}
@ -8171,6 +8232,11 @@ snapshots:
dependencies:
css-tree: 1.1.3
d@1.0.2:
dependencies:
es5-ext: 0.10.64
type: 2.7.3
damerau-levenshtein@1.0.8:
optional: true
@ -8511,6 +8577,31 @@ snapshots:
is-date-object: 1.0.5
is-symbol: 1.0.4
es5-ext@0.10.64:
dependencies:
es6-iterator: 2.0.3
es6-symbol: 3.1.4
esniff: 2.0.1
next-tick: 1.1.0
es6-iterator@2.0.3:
dependencies:
d: 1.0.2
es5-ext: 0.10.64
es6-symbol: 3.1.4
es6-symbol@3.1.4:
dependencies:
d: 1.0.2
ext: 1.7.0
es6-weak-map@2.0.3:
dependencies:
d: 1.0.2
es5-ext: 0.10.64
es6-iterator: 2.0.3
es6-symbol: 3.1.4
escalade@3.1.2: {}
escape-path-with-spaces@1.0.2: {}
@ -8878,6 +8969,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
esniff@2.0.1:
dependencies:
d: 1.0.2
es5-ext: 0.10.64
event-emitter: 0.3.5
type: 2.7.3
espree@9.6.1:
dependencies:
acorn: 8.12.1
@ -8900,6 +8998,11 @@ snapshots:
esutils@2.0.3: {}
event-emitter@0.3.5:
dependencies:
d: 1.0.2
es5-ext: 0.10.64
event-target-shim@5.0.1: {}
events@3.3.0: {}
@ -8950,6 +9053,10 @@ snapshots:
jest-message-util: 29.7.0
jest-util: 29.7.0
ext@1.7.0:
dependencies:
type: 2.7.3
external-editor@3.1.0:
dependencies:
chardet: 0.7.0
@ -9454,6 +9561,8 @@ snapshots:
is-plain-obj@4.1.0: {}
is-promise@2.2.2: {}
is-regex@1.1.4:
dependencies:
call-bind: 1.0.7
@ -10128,6 +10237,10 @@ snapshots:
dependencies:
yallist: 3.1.1
lru-queue@0.1.0:
dependencies:
es5-ext: 0.10.64
macos-release@3.3.0: {}
make-dir@2.1.0:
@ -10182,14 +10295,23 @@ snapshots:
meant@1.0.3: {}
memoizee@0.4.17:
dependencies:
d: 1.0.2
es5-ext: 0.10.64
es6-weak-map: 2.0.3
event-emitter: 0.3.5
is-promise: 2.2.2
lru-queue: 0.1.0
next-tick: 1.1.0
timers-ext: 0.1.8
memorystream@0.3.1: {}
merge-stream@2.0.0: {}
merge2@1.4.1: {}
micro-memoize@4.1.2: {}
micromark-core-commonmark@2.0.1:
dependencies:
decode-named-character-reference: 1.0.2
@ -10395,6 +10517,8 @@ snapshots:
natural-compare@1.4.0: {}
next-tick@1.1.0: {}
node-addon-api@6.1.0: {}
node-addon-api@7.1.1: {}
@ -11254,6 +11378,11 @@ snapshots:
is-node: 1.0.2
numerous: 1.0.3
timers-ext@0.1.8:
dependencies:
es5-ext: 0.10.64
next-tick: 1.1.0
timsort@0.3.0: {}
tmp@0.0.33:
@ -11377,6 +11506,8 @@ snapshots:
type-fest@2.19.0: {}
type@2.7.3: {}
typed-array-buffer@1.0.2:
dependencies:
call-bind: 1.0.7

View File

@ -2,7 +2,7 @@ import { delimiter } from "path"
import { GITHUB_ACTIONS } from "ci-info"
import { info, warning } from "ci-log"
import { addEnv } from "envosman"
import memoize from "micro-memoize"
import memoize from "memoizee"
import { pathExists } from "path-exists"
import { addExeExt, join } from "patha"
import { addUpdateAlternativesToRc, installAptPack } from "setup-apt"
@ -35,7 +35,7 @@ async function setupLLVMWithoutActivation_raw(version: string, setupDir: string,
return installationInfo
}
const setupLLVMWithoutActivation = memoize(setupLLVMWithoutActivation_raw, { isPromise: true })
const setupLLVMWithoutActivation = memoize(setupLLVMWithoutActivation_raw, { promise: true })
/**
* Setup clang-format
@ -81,7 +81,7 @@ async function llvmBinaryDeps_raw(majorVersion: number) {
}
}
}
const llvmBinaryDeps = memoize(llvmBinaryDeps_raw, { isPromise: true })
const llvmBinaryDeps = memoize(llvmBinaryDeps_raw, { promise: true })
async function setupLLVMDeps_raw(arch: string) {
if (process.platform === "linux") {
@ -90,7 +90,7 @@ async function setupLLVMDeps_raw(arch: string) {
await setupGcc(getVersion("gcc", undefined, await ubuntuVersion()), "", arch, 40)
}
}
const setupLLVMDeps = memoize(setupLLVMDeps_raw, { isPromise: true })
const setupLLVMDeps = memoize(setupLLVMDeps_raw, { promise: true })
export async function activateLLVM(directory: string) {
const ld = process.env.LD_LIBRARY_PATH ?? ""

View File

@ -7,7 +7,7 @@ import { info, warning } from "ci-log"
import { addPath } from "envosman"
import { execa } from "execa"
import { readdir } from "fs/promises"
import memoize from "micro-memoize"
import memoize from "memoizee"
import { pathExists } from "path-exists"
import { addExeExt, dirname, join } from "patha"
import { installAptPack } from "setup-apt"
@ -108,7 +108,7 @@ async function findOrSetupPython(version: string, setupDir: string, arch: string
}
}
if (foundPython === undefined || installInfo?.bin === undefined) {
if (foundPython === undefined || installInfo.bin === undefined) {
foundPython = await findPython(setupDir)
if (foundPython === undefined) {
throw new Error("Python binary could not be found")
@ -317,4 +317,4 @@ async function addPythonBaseExecPrefix_raw(python: string) {
*
* The answer is cached for subsequent calls
*/
export const addPythonBaseExecPrefix = memoize(addPythonBaseExecPrefix_raw, { isPromise: true })
export const addPythonBaseExecPrefix = memoize(addPythonBaseExecPrefix_raw, { promise: true })

View File

@ -1,5 +1,5 @@
import macosRelease from "macos-release"
import memoize from "micro-memoize"
import memoize from "memoizee"
/**
* Get macOS version

View File

@ -1,6 +1,6 @@
import os from "os"
import { warning } from "ci-log"
import memoize from "micro-memoize"
import memoize from "memoizee"
import { installAptPack } from "setup-apt"
import { getUbuntuVersion } from "ubuntu-version"
import which from "which"
@ -34,7 +34,7 @@ async function ubuntuVersion_raw(): Promise<number[] | null> {
}
/** Detect Ubuntu version */
export const ubuntuVersion = memoize(ubuntuVersion_raw, { isPromise: true })
export const ubuntuVersion = memoize(ubuntuVersion_raw, { promise: true })
/** Detect Ubuntu version using os.version() for Ubuntu based distros */
function detectUsingOsVersion() {

View File

@ -1,7 +1,7 @@
import { info } from "@actions/core"
import { addPath } from "envosman"
import { execa, execaSync } from "execa"
import memoize from "micro-memoize"
import memoize from "memoizee"
import { mkdirp } from "mkdirp"
import { pathExists } from "path-exists"
import { addExeExt, dirname, join } from "patha"
@ -128,7 +128,7 @@ async function getPipxHome_raw() {
await mkdirp(join(pipxHome, "venv"))
return pipxHome
}
const getPipxHome = memoize(getPipxHome_raw, { isPromise: true })
const getPipxHome = memoize(getPipxHome_raw, { promise: true })
async function getPipxBinDir_raw() {
if (process.env.PIPX_BIN_DIR !== undefined) {
@ -140,7 +140,7 @@ async function getPipxBinDir_raw() {
await mkdirp(pipxBinDir)
return pipxBinDir
}
const getPipxBinDir = memoize(getPipxBinDir_raw, { isPromise: true })
const getPipxBinDir = memoize(getPipxBinDir_raw, { promise: true })
async function getPython_raw(): Promise<string> {
const pythonBin = (await setupPython(getVersion("python", undefined, await ubuntuVersion()), "", process.arch)).bin
@ -149,7 +149,7 @@ async function getPython_raw(): Promise<string> {
}
return pythonBin
}
const getPython = memoize(getPython_raw, { isPromise: true })
const getPython = memoize(getPython_raw, { promise: true })
async function pipHasPackage(python: string, name: string) {
const result = await execa(python, ["-m", "pip", "-qq", "index", "versions", name], {