Skip to content

Commit

Permalink
fix: use ES-Module memoizee fork
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Sep 4, 2024
1 parent 57e4019 commit 57ab8d8
Show file tree
Hide file tree
Showing 22 changed files with 15 additions and 160 deletions.
17 changes: 0 additions & 17 deletions dist/legacy/gcc_matcher.json

This file was deleted.

17 changes: 0 additions & 17 deletions dist/legacy/llvm_matcher.json

This file was deleted.

18 changes: 0 additions & 18 deletions dist/legacy/msvc_matcher.json

This file was deleted.

18 changes: 0 additions & 18 deletions dist/legacy/python_matcher.json

This file was deleted.

2 changes: 0 additions & 2 deletions dist/modern/assets/actions_python-mhNRejTS.mjs

This file was deleted.

2 changes: 0 additions & 2 deletions dist/modern/assets/hdi-CLiriP2M.mjs

This file was deleted.

1 change: 0 additions & 1 deletion dist/modern/assets/hdi-CLiriP2M.mjs.map

This file was deleted.

2 changes: 0 additions & 2 deletions dist/modern/assets/proxy-agent-CtreyBpw.mjs

This file was deleted.

1 change: 0 additions & 1 deletion dist/modern/assets/proxy-agent-CtreyBpw.mjs.map

This file was deleted.

17 changes: 0 additions & 17 deletions dist/modern/gcc_matcher.json

This file was deleted.

17 changes: 0 additions & 17 deletions dist/modern/llvm_matcher.json

This file was deleted.

18 changes: 0 additions & 18 deletions dist/modern/msvc_matcher.json

This file was deleted.

18 changes: 0 additions & 18 deletions dist/modern/python_matcher.json

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@
"pnpm": {
"patchedDependencies": {
"@actions/[email protected]": "patches/@[email protected]"
},
"overrides": {
"memoizee": "https://github.com/aminya/memoizee#77c8b19"
}
}
}
2 changes: 1 addition & 1 deletion packages/envosman/src/rc-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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_, { promise: true })
export const sourceRCInRc = await memoize(sourceRCInRc_, { promise: true })

async function addRCHeader(options: RcOptions) {
// a variable that prevents source rc from being called from .bashrc and .profile
Expand Down
2 changes: 1 addition & 1 deletion packages/setup-apt/src/init-apt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, { promise: true })
export const initAptMemoized = await memoize(initApt, { promise: true })
2 changes: 1 addition & 1 deletion packages/setup-apt/src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ export function updateAptRepos(apt: string = getApt()) {
* Update the apt repositories (memoized)
* @param apt The apt command to use (optional)
*/
export const updateAptReposMemoized = memoize(updateAptRepos)
export const updateAptReposMemoized = await memoize(updateAptRepos)
6 changes: 3 additions & 3 deletions src/llvm/llvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function setupLLVMWithoutActivation_raw(version: string, setupDir: string,

return installationInfo
}
const setupLLVMWithoutActivation = memoize(setupLLVMWithoutActivation_raw, { promise: true })
const setupLLVMWithoutActivation = await memoize(setupLLVMWithoutActivation_raw, { promise: true })

/**
* Setup clang-format
Expand Down Expand Up @@ -84,7 +84,7 @@ async function llvmBinaryDeps_raw(majorVersion: number) {
}
}
}
const llvmBinaryDeps = memoize(llvmBinaryDeps_raw, { promise: true })
const llvmBinaryDeps = await memoize(llvmBinaryDeps_raw, { promise: true })

async function setupLLVMDeps_raw(arch: string) {
if (process.platform === "linux") {
Expand All @@ -93,7 +93,7 @@ async function setupLLVMDeps_raw(arch: string) {
await setupGcc(getVersion("gcc", undefined, await ubuntuVersion()), "", arch, 40)
}
}
const setupLLVMDeps = memoize(setupLLVMDeps_raw, { promise: true })
const setupLLVMDeps = await memoize(setupLLVMDeps_raw, { promise: true })

export async function activateLLVM(directory: string) {
const ld = process.env.LD_LIBRARY_PATH ?? ""
Expand Down
2 changes: 1 addition & 1 deletion src/python/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,4 @@ async function addPythonBaseExecPrefix_raw(python: string) {
*
* The answer is cached for subsequent calls
*/
export const addPythonBaseExecPrefix = memoize(addPythonBaseExecPrefix_raw, { promise: true })
export const addPythonBaseExecPrefix = await memoize(addPythonBaseExecPrefix_raw, { promise: true })
2 changes: 1 addition & 1 deletion src/utils/env/macos_version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ function macosVersion_raw() {
const { version } = macosRelease()
return version.split(".").map((v) => Number.parseInt(v, 10))
}
export const macosVersion = memoize(macosVersion_raw)
export const macosVersion = await memoize(macosVersion_raw)
2 changes: 1 addition & 1 deletion src/utils/env/ubuntu_version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function ubuntuVersion_raw(): Promise<number[] | null> {
}

/** Detect Ubuntu version */
export const ubuntuVersion = memoize(ubuntuVersion_raw, { promise: true })
export const ubuntuVersion = await memoize(ubuntuVersion_raw, { promise: true })

/** Detect Ubuntu version using os.version() for Ubuntu based distros */
function detectUsingOsVersion() {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/setup/setupPipPack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function getPipxHome_raw() {
await mkdirp(join(pipxHome, "venv"))
return pipxHome
}
const getPipxHome = memoize(getPipxHome_raw, { promise: true })
const getPipxHome = await memoize(getPipxHome_raw, { promise: true })

async function getPipxBinDir_raw() {
if (process.env.PIPX_BIN_DIR !== undefined) {
Expand All @@ -141,7 +141,7 @@ async function getPipxBinDir_raw() {
await mkdirp(pipxBinDir)
return pipxBinDir
}
const getPipxBinDir = memoize(getPipxBinDir_raw, { promise: true })
const getPipxBinDir = await memoize(getPipxBinDir_raw, { promise: true })

async function getPython_raw(): Promise<string> {
const pythonBin = (await setupPython(getVersion("python", undefined, await ubuntuVersion()), "", process.arch)).bin
Expand All @@ -150,7 +150,7 @@ async function getPython_raw(): Promise<string> {
}
return pythonBin
}
const getPython = memoize(getPython_raw, { promise: true })
const getPython = await memoize(getPython_raw, { promise: true })

async function pipHasPackage(python: string, name: string) {
const result = await execa(python, ["-m", "pip", "-qq", "index", "versions", name], {
Expand Down

0 comments on commit 57ab8d8

Please sign in to comment.