Skip to content

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

@gordonwoodhull

Description

@gordonwoodhull

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 (0d4dfe5) 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions