File: 0003-Add-JRuby-stdlib-libraries-to-ruby-load-path.patch

package info (click to toggle)
puppetserver 8.7.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,456 kB
  • sloc: ruby: 5,764; sh: 997; java: 221; xml: 111; makefile: 94
file content (37 lines) | stat: -rw-r--r-- 1,529 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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