Skip to content

Commit fdecea5

Browse files
committed
[GR-18163] Document OPENSSL_PREFIX and test Fedora 36 (#2660)
PullRequest: truffleruby/3364
2 parents 56588d6 + b85ea5a commit fdecea5

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

doc/user/installing-libssl.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@ permalink: /reference-manual/ruby/Installinglibssl/
77
# Installing `libssl`
88

99
TruffleRuby provides the `openssl` module but not the native `libssl` system library that the module uses.
10-
TruffleRuby supports both versions 1.0.2 and 1.1.0.
10+
TruffleRuby supports libssl versions 1.0.2 and 1.1.0 (not 3.0.0 currently).
1111

1212
If you experience `openssl`-related errors, it might help to recompile the `openssl` module by running `lib/truffle/post_install_hook.sh`.
1313
This is done automatically by Ruby managers, and mentioned in the post-install message when installing TruffleRuby via `gu install` in GraalVM.
1414

15+
To compile TruffleRuby against a non-system `libssl`, set `OPENSSL_PREFIX` while installing TruffleRuby:
16+
```bash
17+
export OPENSSL_PREFIX=/path/to/my/openssl-1.1.0
18+
```
19+
1520
### RedHat-based: Fedora, Oracle Linux, etc
1621

22+
On Fedora 36, use `openssl1.1-devel` instead.
23+
1724
```bash
1825
sudo dnf install openssl-devel
1926
```

lib/truffle/truffle/openssl-prefix.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
# Set OPENSSL_PREFIX in ENV to find the OpenSSL headers
1010

11+
module Truffle
12+
OPENSSL_PREFIX_WAS_SET = ENV.key?('OPENSSL_PREFIX')
13+
end
14+
1115
search_homebrew = -> homebrew {
1216
if prefix = "#{homebrew}/opt/[email protected]" and Dir.exist?(prefix)
1317
prefix

src/main/c/openssl/extconf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def find_openssl_library
110110

111111
# TruffleRuby: do not perform all checks again if extconf.h already exists
112112
extconf_h = "#{__dir__}/extconf.h"
113-
if File.exist?(extconf_h) && File.mtime(extconf_h) >= File.mtime(__FILE__ )
113+
if File.exist?(extconf_h) && File.mtime(extconf_h) >= File.mtime(__FILE__ ) && !Truffle::OPENSSL_PREFIX_WAS_SET
114114
$extconf_h = extconf_h
115115
else
116116
### START of checks

tool/docker-configs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ fedora28:
3939
locale:
4040
<<: *rpm
4141

42+
fedora36:
43+
base: fedora:36
44+
install: RUN dnf install -y
45+
locale: glibc-langpack-en
46+
<<: *rpm
47+
openssl: openssl1.1-devel
48+
4249
fedora34:
4350
base: fedora:34
4451
install: RUN dnf install -y

0 commit comments

Comments
 (0)