Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bhperry
Copy link
Contributor

@bhperry bhperry commented Sep 30, 2024

Add sha256 hash of the micromamba binary to the cache key so broken environments created from previous versions won't be restored for a new version.

Closes #91

@bhperry bhperry requested a review from pavelzw as a code owner September 30, 2024 23:07
@pavelzw
Copy link
Member

pavelzw commented Oct 1, 2024

Could you also compile the action and bump its version in package.json?

Co-authored-by: Pavel Zwerschke <[email protected]>
@bhperry
Copy link
Contributor Author

bhperry commented Oct 1, 2024

Could you also compile the action and bump its version in package.json?

@pavelzw minor bump for this?

@pavelzw
Copy link
Member

pavelzw commented Oct 1, 2024

Sure 👍🏻

@bhperry
Copy link
Contributor Author

bhperry commented Oct 1, 2024

Is test.sh outdated? Tried to run it, but no index.js in dist

@pavelzw pavelzw added the enhancement New feature or request label Oct 1, 2024
@pavelzw
Copy link
Member

pavelzw commented Oct 1, 2024

Yes seems like it 🤔 I nowadays just run the tests from GitHub ci

@pavelzw
Copy link
Member

pavelzw commented Oct 1, 2024


Error: src/cache.ts(43,22): error TS2339: Property 'readBinaryFile' does not exist on type 'typeof import("fs/promises")'.

@bhperry
Copy link
Contributor Author

bhperry commented Oct 1, 2024

hmm looked that one up somewhere, guess I was looking at the wrong fs package

@bhperry
Copy link
Contributor Author

bhperry commented Oct 1, 2024

seems like regular readFile with no encoding should do the trick

@pavelzw
Copy link
Member

pavelzw commented Oct 2, 2024

The ci failures look unrelated. I'll take a look at them later

@pavelzw
Copy link
Member

pavelzw commented Oct 2, 2024

the remaining failing ci is tracked in #230

@pavelzw pavelzw merged commit 59b1132 into mamba-org:main Oct 2, 2024
@bhperry bhperry deleted the bin-cache-key branch October 2, 2024 14:18
@tsibley
Copy link

tsibley commented Sep 17, 2025

FWIW, this doesn't work as expected because a promise is interpolated into the cache key string rather than the value the promise resolves to, e.g. I see cache keys like:

2025-09-16-linux-64-augur-args-30d39f4-root-dcc80ee-bin-[object Promise]

The issue is this bit of code added by 59b1132

const binHash = fs.readFile(options.micromambaBinPath).then(sha256)
const key = `${prefix}${arch}${envName}${createArgs}${rootPrefix}-bin-${binHash}`

because binHash is a promise.

@bhperry
Copy link
Contributor Author

bhperry commented Sep 18, 2025

#284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add micromamba version to cache key?

3 participants