-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Getting "error: Read-only file system" for .graph
cache file
#6080
Comments
Thanks for the report @TooTallNate
This is most likely the cause, changing the paths should hot-fix this problem, but ultimately we need to fix it in Deno. I just realized that the same is valid for source map files.
Unfortunately not
This file was introduced in #5029 to keep track of dependencies of compiled file - it's used to invalidate the cache if content of any of dependencies is changed. Unfortunately this made I'll look into this issue |
There is an issue with `.graph` files on v1.0.3 and newer. See: denoland/deno#6080
Thanks for the quick reply!
Great! Will this happen via relative file URIs (again, just curious)?
Also the |
Hot-fixes a Deno issue: denoland/deno#6080
Just wanted to chime in that the hot-fix of correcting the absolute file paths does indeed work. Here's a servereless function running Deno v1.0.5. Still looking forward to the proper fix! |
* refactor "compile" and "runtimeCompile" in "compiler.ts" and factor out separate methods for "compile" and "bundle" operations * remove noisy debug output from "compiler.ts" * provide "Serialize" implementations for enums in "msg.rs" * rename "analyze_dependencies_and_references" to "pre_process_file" and move it to "tsc.rs" * refactor ModuleGraph to use more concrete types and properly annotate locations where errors occur * remove dead code from "file_fetcher.rs" - "SourceFile.types_url" is no longer needed, as type reference parsing is done in "ModuleGraph" * remove unneeded field "source_path" from ".meta" files stored for compiled source file (towards #6080)
Two workarounds were required to make Deno v1.1.2 work properly: * A `HOME` environment variable needs to be set since AWS Lambda does not define one by default, and `deno` would panic without "being able to find the home directory". * The `.buildinfo` files in the Deno cache need to be patched to change the tmp directory references to use `/var/task`. Without the patching, `deno` attempts to compile the source files again which fails due to AWS Lambda's read-only filesystem (similar to denoland/deno#6080).
I'm not sure if I should create a new issue, but basically the same problem is happening now with the The same hot-patching method works for my purpose, though the patching buildinfo files is a bit more complicated now as the JSON structure is more complicated, but you can see what I did to make it working here: vercel-community/deno@0c38731 |
@TooTallNate this issue is still on my radar - now that incremental compilation is working I'll see to make |
@TooTallNate this issue should now be resolved - @kitsonk did massive refactors in the module grap infrastructure over the past year. I'm going to tentatively close this issue, please let me know if the problem persists. |
Starting with
deno
v1.0.3, a new.graph
file seems to be output into thegen
files in the deno cache alongside the other compiled files. For example:I am deploying to a Lambda function which has a read-only filesystem where the deno cache resides (same setup as in #5688). For some reason, when executing
deno run hello.ts
from within the Lambda,deno
decides to compile thehello.ts
file again causing the command to fail:I'm not sure why this is happening (why
deno
considers that it needs to be compiled again), but it could be due to the fact that the.graph
file contains absolute file paths, and the directory where thedeno cache
command is run is a different directory path than the wheredeno run
command is run (the deno cache directory gets moved from a temp dir to/var/task
in the runtime). So I'm thinking the (mismatching) absolute paths could be the culprit… Would re-writing those file paths to the correct destination directory preventdeno
from trying to re-compile the TS file?Or alternatively, is there a way to tell
deno
to never compile in thedeno run
command?Also, out of curiosity, what is this new
.graph
file? I can't seem to find any mention of it in the release notes for v1.0.3.The text was updated successfully, but these errors were encountered: