From: =?utf-8?b?SsOpcsO0bWUgQ2hhcmFvdWk=?= <jerome@riseup.net>
Date: Mon, 9 Jan 2023 21:08:05 -0500
Subject: Add JRuby stdlib libraries to ruby-load-path

Since we don't run puppetserver with jruby-stdlib.jar on the
classpath (because we hope to get rid of it at some point) we need to
ensure we always have "/usr/share/jruby/lib/ruby/stdlib" on the JRuby
LOAD_PATH.

Forwarded: not-needed
---
 src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: puppetserver/src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
===================================================================
--- puppetserver.orig/src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
+++ puppetserver/src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
@@ -63,6 +63,9 @@
 (def default-vendored-gems-dir
   "/opt/puppetlabs/server/data/puppetserver/vendored-jruby-gems")
 
+(def debian-jruby-stdlib-dir
+  "/usr/share/jruby/lib/ruby/stdlib")
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Private
 
@@ -70,7 +73,7 @@
   "Return a list of ruby LOAD_PATH directories built from the
   user-configurable ruby-load-path setting of the jruby-puppet configuration."
   [ruby-load-path :- [schema/Str]]
-  (cons ruby-code-dir ruby-load-path))
+  (cons ruby-code-dir (cons debian-jruby-stdlib-dir ruby-load-path)))
 
 (schema/defn ^:always-validate config->puppet-config :- HashMap
   "Given the raw jruby-puppet configuration section, return a
