|
114 | 114 | [ "#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install" ]
|
115 | 115 | end
|
116 | 116 |
|
| 117 | +# For the pdk runtime, the ruby bin directory is different then the main bin |
| 118 | +# directory. In order to run ruby *outside* of the normal pdk.bat then we need |
| 119 | +# to copy all dlls that ruby depends on from the main bin directory to ruby's |
| 120 | +# bin directory. This is because the main bin directory is not in our system |
| 121 | +# PATH and Windows doesn't support RPATH. However, as mentioned in |
| 122 | +# https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order, |
| 123 | +# Windows searches for DLLs in "The folder the calling process was loaded from |
| 124 | +# (the executable's folder)." |
| 125 | +# |
| 126 | +# The agent runtime used to have the same issue prior to puppet 6, for example |
| 127 | +# RE-7593. However, Windows paths were changed to match *nix in puppet 6, see |
| 128 | +# commit 4b9d126dd5b. So only the pdk has this issue. |
117 | 129 | if platform.is_windows? && settings[:bindir] != ruby_bindir
|
118 |
| - # As things stand right now, ssl should build under [INSTALLDIR]\Puppet\puppet on |
119 |
| - # windows. However, if things need to run *outside* of the normal batch file runs |
120 |
| - # (puppet.bat ,mco.bat etcc) the location of openssl away from where ruby is |
121 |
| - # installed will cause a failure. Specifically this is meant to help services like |
122 |
| - # mco that require openssl but don't have access to environment.bat. Refer to |
123 |
| - # https://tickets.puppetlabs.com/browse/RE-7593 for details on why this causes |
124 |
| - # failures and why these copies fix that. |
125 |
| - # -Sean P. McDonald 07/01/2016 |
| 130 | + # Ruby 3+ |
| 131 | + if Gem::Version.new(pkg.get_version) >= Gem::Version.new('3.0') |
| 132 | + pkg.install do |
| 133 | + [ |
| 134 | + "cp #{settings[:gcc_bindir]}/libssp-0.dll #{ruby_bindir}", |
| 135 | + ] |
| 136 | + end |
| 137 | + end |
| 138 | + |
126 | 139 | if platform.architecture == "x64"
|
127 | 140 | gcc_postfix = 'seh'
|
128 | 141 | ssl_postfix = '-x64'
|
|
131 | 144 | ssl_postfix = ''
|
132 | 145 | end
|
133 | 146 |
|
| 147 | + # OpenSSL |
134 | 148 | if Gem::Version.new(settings[:openssl_version]) >= Gem::Version.new('3.0')
|
135 | 149 | ssl_lib = "libssl-3#{ssl_postfix}.dll"
|
136 | 150 | crypto_lib = "libcrypto-3#{ssl_postfix}.dll"
|
|
0 commit comments