quarto-dev / quarto-dev/quarto-cli

Runtime directory path inconsistency on Linux (missing app name in XDG_RUNTIME_DIR)

Open
#14,240 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

maintenance
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Runtime directory path inconsistency on Linux

xdgUserRuntimeDir in src/core/appdirs.ts is the only XDG directory function that does not append the application name ("quarto") to the base path when XDG_RUNTIME_DIR is set. All other XDG functions (xdgUserDataDir, xdgUserConfigDir, xdgUserCacheDir) follow the pattern join(envVar, appName).

This means on Linux with XDG_RUNTIME_DIR=/run/user/1000:

  • quartoCacheDir("julia")/run/user/1000/.cache/quarto/julia
  • quartoRuntimeDir("julia")/run/user/1000/julia (no quarto/ segment)

Two subsystems use quartoRuntimeDir: the Julia engine ("julia" subdir for transport, log, and project files) and the Jupyter kernel ("jt" subdir for transport files).

This was introduced in 179f686 (Jan 2021) and has never been changed. It appears to be an oversight — the appName parameter is accepted but unused in the XDG_RUNTIME_DIR branch, and the fallback branch delegates to xdgUserDataDir(appName) which does append it.

Options
  1. Fix xdgUserRuntimeDir to append appName, matching all other XDG functions. Since XDG_RUNTIME_DIR is typically tmpfs (cleared on reboot/logout), the impact is limited to a single session: any running Julia server or Jupyter kernel would become invisible to quarto at the new path, requiring a restart. After the next reboot, no trace of the old path remains. The julia-engine test's reimplementation of this logic already assumes appName is appended, so this would fix the test without any change on their side.

  2. Keep the current behavior and update the julia-engine test to match. We've pushed a temporary workaround (0d4dfe508) to get CI green. If we decide the current behavior is intentional (or not worth changing), we can push this fix upstream to PumasAI/quarto-julia-engine and call it done. This leaves the inconsistency in place and requires anyone reimplementing the path logic to know about the special case.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/core/appdirs.ts and inspect xdgUserRuntimeDir alongside xdgUserDataDir, xdgUserConfigDir, and xdgUserCacheDir. Then review the Julia engine test's path reimplementation and the Julia and Jupyter runtime-directory callers. Confirm whether the app-name segment is intended, account for existing runtime paths, and update the relevant implementation and tests so both subsystems use the agreed path consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.