Skip to content

Allow specifying AppCDS cache location and use safer default #9667

Closed

Description

@headius

JRuby is frequently installed via a package manager that makes the install location read-only. This prevents the AppCDS cache (and any future caches stored in lib) from being writable, leading to warnings or errors at startup.

We need to provide a standard way to specify the location of the AppCDS jsa cache file. Additionally, this cache should probably default to somewhere under $HOME/.cache as is now common on most *nix platforms.

Activity

  1. added this to the JRuby 10.0.x milestone on Sep 11, 2026
  2. headius commented on Sep 11, 2026

    @headius
    MemberAuthor

    I like JRUBY_CACHE_HOME as an env var after looking this Debian patch that mentions XDG_CACHE_HOME.

    I'm also coming around to defaulting to a subdirectory of $HOME/.cache which seems to be a standard these days. We would create directories as necessary in that location to separate JRuby AppCDS caches (and other JRuby caches in the future, like Prism parser dumps) from other non-JRuby caches. We would also need to continue separating those caches by the location of jruby.jar and the JDK used.

    Note that the Debian patch above also defaults to a location under $HOME/.cache.

    Additional debate: how much of this should ship with JRuby 10.0.x given that it is a stable branch. The config variable would be purely additive, but the new default cache location would be a surprise.

  3. headius commented on Sep 16, 2026

    @headius
    MemberAuthor

    Since we only use the cache location for JSA right now, I have gone with JRUBY_JSA_HOME in #9698. That would not conflict with a future general "cache home" variable, and may eventually be defunct if we start using the new AOT features of Java 25+.

    We'll call this one resolved with #9698 and if there's a need for a more general cache location config in the future we'll cross that bridge.

  4. headius commented on Sep 16, 2026

    @headius
    MemberAuthor

    Fixed by #9698.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions