Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only invoke Deno.mkdir() if the cache file does not exist #29

Merged
merged 1 commit into from
Oct 13, 2020
Merged

Only invoke Deno.mkdir() if the cache file does not exist #29

merged 1 commit into from
Oct 13, 2020

Conversation

TooTallNate
Copy link
Contributor

This fixes using the prepare() function when the file
system is read-only (i.e. within AWS Lambda environment).

This fixes using the `prepare()` function when the file
system is read-only (i.e. within AWS Lambda environment).
@TooTallNate TooTallNate changed the title Only invoke Deno.mkdir() if the cache file needs to be downloaded Only invoke Deno.mkdir() if the cache file does not exist Oct 12, 2020
@manyuanrong
Copy link
Owner

It seems that there is no essential difference, are you sure this can solve the problem?

@TooTallNate
Copy link
Contributor Author

Sorry, I perhaps didn't explain properly. The read-only filesystem's contents have been previously generated from a build step. The contents of a built zip file are extracted in the lambda runtime environment before making the filesystem be read-only.

So in this case, the cached plugin file will already be present in the .deno_plugins directory, thus causing the exists() check to pass, and making this mkdir() invocation not happen in that case (which avoids the EROFS error at runtime).

Let me know if that helps explain a bit better 😄

@manyuanrong
Copy link
Owner

got it

@manyuanrong manyuanrong merged commit 75edefa into manyuanrong:master Oct 13, 2020
@manyuanrong
Copy link
Owner

Included in the v0.8.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants