Skip to content

Commit a31f8b0

Browse files
authored
Fix julia engine smoke test cleaning the wrong runtime dir on Linux (#15264)
The julia engine smoke test's log-file check cleaned the wrong runtime directory on Linux. The test built its path with a "quarto" segment under $XDG_RUNTIME_DIR, but the engine uses $XDG_RUNTIME_DIR as-is. Setup deleted files in that wrong directory, so an earlier julia render's server log survived and was printed instead of the "doesn't exist" message. Use the engine's runtime path in the test again. The XDG_RUNTIME_DIR-unset fallback also matches the engine's app dirs ($XDG_DATA_HOME/quarto rather than the cache dir). - Compute the julia runtime dir in the smoke test as the engine does - Align the unset-XDG_RUNTIME_DIR fallback with appdirs Related to #15156 See PumasAI/quarto-julia-engine#17
1 parent 708e443 commit a31f8b0

5 files changed

Lines changed: 18 additions & 5 deletions

File tree

‎.claude/rules/extension-subtrees.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Current subtrees (see [`src/command/dev-call/pull-git-subtree/cmd.ts`](../../src
2424
```
2525
4. The command adds two commits (squash + merge) — **do not edit those commits**
2626
5. **Do not rebase** a branch that contains the subtree-pull commits — they cannot be rebased cleanly. Merge to `main` without rebasing, or remove the two commits before rebasing and re-run the pull command.
27+
6. **Merge the PR with "Create a merge commit" and GitHub's default message.** Never squash-merge, and never paste the commit list into the merge message. A copied `git-subtree-dir:`/`git-subtree-split:` trailer on a non-squash commit becomes the base of the next pull, which then silently overwrites in-tree changes (#14864 → #15156). See `dev-docs/subtree-extensions.md` § Merging the subtree-pull PR.
2728

2829
## Reference
2930

‎dev-docs/subtree-extensions.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ So you must either
5454
- run the command when ready to merge to main, or
5555
- remove the commits when rebasing, and run the `dev-call` command again
5656

57+
### Merging the subtree-pull PR
58+
59+
Merge with **Create a merge commit** and keep GitHub's default message (`Merge pull request #N from ...` plus the PR title). Never squash-merge, and never paste the commit list into the merge message.
60+
61+
`git subtree pull --squash` finds the previous squash by searching history for the most recent `git-subtree-dir:` trailer. Any other commit on `main` carrying a copied `git-subtree-dir:` / `git-subtree-split:` trailer gets picked up as "the previous squash". The next pull then uses that full-repo commit as its base, and upstream's files silently replace any quarto-cli changes under the prefix. This happened with #14864 (0.2.2): its merge commit message embedded the squash commit's trailers, and the 0.2.3 pull (#15156) reverted an in-tree test fix without a conflict.
62+
63+
Check before the next pull: `git log --format='%h %s' --grep='git-subtree-dir: src/resources/extension-subtrees/<name>' main | head -1` must show a `Squashed '...' changes from ...` commit, not a PR merge.
64+
5765
## Recovery: edits made in-tree by mistake
5866

5967
If a fix has already been committed directly inside the subtree prefix (wrong workflow), it needs to be re-authored upstream before resuming the normal flow. Two paths:

‎packages/quarto-types/dist/index.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ export interface QuartoAPI {
11681168
* Returns the appropriate runtime/state directory based on platform:
11691169
* - macOS: ~/Library/Caches/quarto/{subdir}
11701170
* - Windows: %LOCALAPPDATA%/quarto/{subdir}
1171-
* - Linux: $XDG_RUNTIME_DIR or ~/.local/share/quarto/{subdir}
1171+
* - Linux: $XDG_RUNTIME_DIR/{subdir} (no quarto segment), or ~/.local/share/quarto/{subdir} when unset
11721172
*
11731173
* Automatically creates the directory if it doesn't exist.
11741174
*

‎packages/quarto-types/src/quarto-api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ export interface QuartoAPI {
491491
* Returns the appropriate runtime/state directory based on platform:
492492
* - macOS: ~/Library/Caches/quarto/{subdir}
493493
* - Windows: %LOCALAPPDATA%/quarto/{subdir}
494-
* - Linux: $XDG_RUNTIME_DIR or ~/.local/share/quarto/{subdir}
494+
* - Linux: $XDG_RUNTIME_DIR/{subdir} (no quarto segment), or ~/.local/share/quarto/{subdir} when unset
495495
*
496496
* Automatically creates the directory if it doesn't exist.
497497
*

‎src/resources/extension-subtrees/julia-engine/tests/smoke/julia-engine/julia.test.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ function quartoRuntimeDir(): string {
2323
base = join(Deno.env.get("LOCALAPPDATA")!, "quarto");
2424
break;
2525
default: {
26+
// Note: quarto's xdgUserRuntimeDir does not append the app name
27+
// when XDG_RUNTIME_DIR is set (unlike the other XDG dir functions),
28+
// and falls back to the XDG data dir, not the cache dir.
2629
const xdgRuntime = Deno.env.get("XDG_RUNTIME_DIR");
2730
if (xdgRuntime) {
28-
base = join(xdgRuntime, "quarto");
31+
base = xdgRuntime;
2932
} else {
30-
const cacheHome = Deno.env.get("XDG_CACHE_HOME") ?? join(Deno.env.get("HOME")!, ".cache");
31-
base = join(cacheHome, "quarto");
33+
const dataHome = Deno.env.get("XDG_DATA_HOME") ||
34+
join(Deno.env.get("HOME")!, ".local", "share");
35+
base = join(dataHome, "quarto");
3236
}
3337
break;
3438
}

0 commit comments

Comments
 (0)