Skip to content

fix: Don't require a writable HOME directory - #52

Merged
jbaiter merged 2 commits into
mainfrom
fix-homelessness-is-great
Nov 23, 2026
Merged

jbaiter merged 2 commits into
mainfrom
fix-homelessness-is-great

Conversation

@jbaiter

@jbaiter jbaiter commented Nov 20, 2026

Copy link
Copy Markdown
Member

The container image runs as an unprivileged user whose home directory is absent
or root-owned (/app), so everything that wrote below $HOME failed or
silently degraded:

  • GraalVM extracted its attach library into $HOME/.cache, could not, and fell
    back to the interpreter-only Truffle runtime. Extension hooks then ran
    without JIT; the only trace was a warning about a missing resource.
  • npm could not write its logs and aborted with a permissions error.
  • pip warned about its unwritable cache on every install.

Point GraalVM's resource cache at <data-directory>/.truffle through
polyglot.engine.userResourceCache, unless the operator set the property
explicitly, and skip it when the data directory is not writable so the runtime
still degrades gracefully. Pass npm_config_cache and PIP_CACHE_DIR to the
installers instead of relying on $HOME.

The dependency update moved the GraalVM and Truffle libraries to 25.0.5.1 and `mise.toml` followed, but the image still downloaded JDK 25.0.5. Mixing library and JDK release lines makes Truffle reject the pairing and fall back to its interpreter-only runtime. Download 25.0.5.1 instead, matching the version in `pom.xml`.
@jbaiter
jbaiter force-pushed the fix-homelessness-is-great branch from d5be5bd to 6a49526 Compare November 23, 2026 10:44
The container image runs as an unprivileged user whose home directory is absent
or root-owned (`/app`), so everything that wrote below `$HOME` failed or
silently degraded:

* GraalVM extracted its attach library into `$HOME/.cache`, could not, and fell
  back to the interpreter-only Truffle runtime. Extension hooks then ran
  without JIT; the only trace was a warning about a missing resource.
* npm could not write its logs and aborted with a permissions error.
* pip warned about its unwritable cache on every install.

Point GraalVM's resource cache at `<data-directory>/.truffle` through
`polyglot.engine.userResourceCache`, unless the operator set the property
explicitly, and skip it when the data directory is not writable so the runtime
still degrades gracefully. Pass `npm_config_cache` and `PIP_CACHE_DIR` to the
installers instead of relying on `$HOME`.
@jbaiter
jbaiter force-pushed the fix-homelessness-is-great branch from 6a49526 to 073210d Compare November 23, 2026 10:46
@jbaiter
jbaiter merged commit 0947f13 into main Nov 23, 2026
6 checks passed
@jbaiter
jbaiter deleted the fix-homelessness-is-great branch November 23, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants