-
Notifications
You must be signed in to change notification settings - Fork 13.7k
fix(apps): write ephemeral Deno config to writable runtime directory #41322
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -67,7 +67,12 @@ export class DenoRuntimeSubprocessController extends BaseRuntimeSubprocessContro | |||||||||||||||||||
| this.denoDir = process.env.DENO_DIR ?? path.join(this.packagePath, '.deno-cache'); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| this.denoRuntimePath = path.join(this.tempFilePath, 'deno-runtime', 'main.ts'); | ||||||||||||||||||||
| this.denoEphemeralConfigPath = this.denoConfigPath.replace('.jsonc', '.runtime.jsonc'); | ||||||||||||||||||||
| this.denoEphemeralConfigPath = path.join( | ||||||||||||||||||||
| this.tempFilePath, | ||||||||||||||||||||
| 'deno-runtime', | ||||||||||||||||||||
| 'deno.runtime.jsonc', | ||||||||||||||||||||
|
Comment on lines
+70
to
+73
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Indentation is inconsistent with the rest of the constructor body. The surrounding code uses two tabs for statements inside the constructor, but the new lines use only one tab. Consider aligning the indentation to match the file's convention (two tabs for constructor-body statements). Prompt for AI agents
Suggested change
|
||||||||||||||||||||
| ); | ||||||||||||||||||||
|
Comment on lines
+70
to
+74
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win The ephemeral config still resolves to the read-only package directory through the symlink. Line 82 creates a symlink: The fix is to place the ephemeral config in a directory that is not covered by the symlink: 🐛 Proposed fix: write ephemeral config outside the symlinked directory this.denoRuntimePath = path.join(this.tempFilePath, 'deno-runtime', 'main.ts');
- this.denoEphemeralConfigPath = path.join(
- this.tempFilePath,
- 'deno-runtime',
- 'deno.runtime.jsonc',
- );
+ this.denoEphemeralConfigPath = path.join(this.tempFilePath, 'deno-runtime-config', 'deno.runtime.jsonc');Then ensure the parent directory exists before writing (add before line 90): + fs.mkdirSync(path.dirname(this.denoEphemeralConfigPath), { recursive: true });
generateEphemeralDenoConfig(this.denoEphemeralConfigPath, this.denoConfigPath, this.appsEnginePath);This keeps the ephemeral config in the writable temp directory while the symlink at Also applies to: 82-90 🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| /** | ||||||||||||||||||||
| * Deno 2.x refuses to run scripts inside the node_modules, so we create a symlink to the deno runtime files in the temp directory | ||||||||||||||||||||
|
|
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P0: Writing ephemeral config to
<tempFilePath>/deno-runtime/deno.runtime.jsoncgoes through the symlink back to the read-only package directory, so the EROFS error on Snap deployments persists — the fix doesn't reach writable storage. The constructor creates a 'dir' symlink at<tempFilePath>/deno-runtime→<packageDir>/deno-runtime/before the config write. Write the ephemeral config to a path that does not traverse the symlink, e.g.path.join(this.tempFilePath, 'deno.runtime.jsonc'), and updategenerateEphemeralDenoConfigand the--configarg accordingly.Prompt for AI agents