|
285 | 285 | FileUtils.rm([libssl_match, libcrypto_match])
|
286 | 286 | end
|
287 | 287 | elsif windows_target?
|
288 |
| - dll_folder = File.join(install_dir, "embedded3", "DLLS") |
289 | 288 | # Build the cryptography library in this case so that it gets linked to Agent's OpenSSL
|
290 |
| - # We first need to copy some files around (we need the .lib files for building) |
291 |
| - copy File.join(install_dir, "embedded3", "lib", "libssl.dll.a"), |
| 289 | + lib_folder = File.join(install_dir, "embedded3", "lib") |
| 290 | + dll_folder = File.join(install_dir, "embedded3", "DLLS") |
| 291 | + include_folder = File.join(install_dir, "embedded3", "include") |
| 292 | + |
| 293 | + # We first need create links to some files around such that cryptography finds .lib files |
| 294 | + link File.join(lib_folder, "libssl.dll.a"), |
292 | 295 | File.join(dll_folder, "libssl-3-x64.lib")
|
293 |
| - copy File.join(install_dir, "embedded3", "lib", "libcrypto.dll.a"), |
| 296 | + link File.join(lib_folder, "libcrypto.dll.a"), |
294 | 297 | File.join(dll_folder, "libcrypto-3-x64.lib")
|
295 | 298 |
|
296 |
| - command "#{python} -m pip install --force-reinstall --no-deps --no-binary cryptography cryptography==43.0.1", |
297 |
| - env: { |
298 |
| - "OPENSSL_LIB_DIR" => dll_folder, |
299 |
| - "OPENSSL_INCLUDE_DIR" => File.join(install_dir, "embedded3", "include"), |
300 |
| - "OPENSSL_LIBS" => "libssl-3-x64:libcrypto-3-x64", |
301 |
| - } |
| 299 | + block "Build cryptopgraphy library against Agent's OpenSSL" do |
| 300 | + cryptography_requirement = (shellout! "#{python} -m pip list --format=freeze").stdout[/cryptography==.*?$/] |
| 301 | + |
| 302 | + shellout! "#{python} -m pip install --force-reinstall --no-deps --no-binary cryptography #{cryptography_requirement}", |
| 303 | + env: { |
| 304 | + "OPENSSL_LIB_DIR" => dll_folder, |
| 305 | + "OPENSSL_INCLUDE_DIR" => include_folder, |
| 306 | + "OPENSSL_LIBS" => "libssl-3-x64:libcrypto-3-x64", |
| 307 | + } |
| 308 | + end |
302 | 309 | # Python extensions on windows require this to find their DLL dependencies,
|
303 | 310 | # we abuse the `.pth` loading system to inject it
|
304 | 311 | block "Inject dll path for Python extensions" do
|
|
0 commit comments