Skip to content

Commit b11bda7

Browse files
committed
Log to the CONFIG level the location of OpenSSL
* Should be helpful when debugging issues related to finding OpenSSL. (cherry picked from commit f6faf21)
1 parent 4c5ca55 commit b11bda7

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

lib/truffle/truffle/openssl-prefix.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
end
3131

3232
if openssl_prefix = ENV['OPENSSL_PREFIX']
33+
Truffle::Debug.log_config("Found OpenSSL in #{openssl_prefix}")
34+
3335
# We need to set PKG_CONFIG_PATH too, see https://github.com/oracle/truffleruby/issues/1830
3436
# OpenSSL's extconf.rb calls the pkg_config() helper.
3537
ENV['PKG_CONFIG_PATH'] = ["#{openssl_prefix}/lib/pkgconfig", *ENV['PKG_CONFIG_PATH']].join(':')

src/main/java/org/truffleruby/debug/TruffleDebugNodes.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,19 +352,35 @@ protected int getCacheLimit() {
352352

353353
}
354354

355+
@CoreMethod(names = "log_config", onSingleton = true, required = 1)
356+
public abstract static class LogConfigNode extends CoreMethodArrayArgumentsNode {
357+
358+
@Specialization
359+
protected DynamicObject logConfig(Object value,
360+
@Cached ToJavaStringNode toJavaStringNode) {
361+
config(toJavaStringNode.executeToJavaString(value));
362+
return nil();
363+
}
364+
365+
@TruffleBoundary
366+
static void config(String message) {
367+
RubyLanguage.LOGGER.config(message);
368+
}
369+
370+
}
371+
355372
@CoreMethod(names = "log_warning", isModuleFunction = true, required = 1)
356373
public abstract static class LogWarningNode extends CoreMethodArrayArgumentsNode {
357374

358375
@Specialization
359-
protected DynamicObject logWarning(
360-
VirtualFrame frame, Object value,
376+
protected DynamicObject logWarning(Object value,
361377
@Cached ToJavaStringNode toJavaStringNode) {
362378
warning(toJavaStringNode.executeToJavaString(value));
363379
return nil();
364380
}
365381

366382
@TruffleBoundary
367-
public static void warning(String message) {
383+
static void warning(String message) {
368384
RubyLanguage.LOGGER.warning(message);
369385
}
370386

0 commit comments

Comments
 (0)