-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workaround for #14873 #14890
Workaround for #14873 #14890
Conversation
This fix isn't enough since JRuby ignores the files under "lib/jni" and uses the "jni" folder inside the jruby.jar. Two solutions are:
|
To test:
|
rubyUtils.gradle
Outdated
tasks.register("downloadAndInstallPreviousJRubyFFI", Copy) { | ||
dependsOn=[downloadPreviousJRuby] | ||
description "Install previous JRuby FFI files in the new JRuby directory" | ||
inputs.file(previousJrubyTarPath) | ||
outputs.dir("${projectDir}/vendor/jruby/lib/jni") | ||
outputs.file("${projectDir}/vendor/jruby/lib/jruby.jar") | ||
from tarTree(downloadPreviousJRuby.dest) | ||
eachFile { f -> | ||
f.path = f.path.replaceFirst("^jruby-${previousJRubyVersion}", '') | ||
} | ||
// Copy only the previous builds of libjffi that changed from JRuby 9.3.9.0 to 9.3.10.0 | ||
include "**/lib/jni/**/*" | ||
|
||
includeEmptyDirs = false | ||
into "${projectDir}/vendor/jruby/tmp" | ||
doLast { | ||
ant.jar(destfile: "${projectDir}/vendor/jruby/lib/jruby.jar", update: true) { | ||
fileset(dir: "${projectDir}/vendor/jruby/tmp/lib") | ||
} | ||
delete files("${projectDir}/vendor/jruby/tmp") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: minor re-arrange, return to only getting the FFI libs that are known to have changed, and output information about what we are injecting. I'm ok with filing this as a follow-up.
tasks.register("downloadAndInstallPreviousJRubyFFI", Copy) { | |
dependsOn=[downloadPreviousJRuby] | |
description "Install previous JRuby FFI files in the new JRuby directory" | |
inputs.file(previousJrubyTarPath) | |
outputs.dir("${projectDir}/vendor/jruby/lib/jni") | |
outputs.file("${projectDir}/vendor/jruby/lib/jruby.jar") | |
from tarTree(downloadPreviousJRuby.dest) | |
eachFile { f -> | |
f.path = f.path.replaceFirst("^jruby-${previousJRubyVersion}", '') | |
} | |
// Copy only the previous builds of libjffi that changed from JRuby 9.3.9.0 to 9.3.10.0 | |
include "**/lib/jni/**/*" | |
includeEmptyDirs = false | |
into "${projectDir}/vendor/jruby/tmp" | |
doLast { | |
ant.jar(destfile: "${projectDir}/vendor/jruby/lib/jruby.jar", update: true) { | |
fileset(dir: "${projectDir}/vendor/jruby/tmp/lib") | |
} | |
delete files("${projectDir}/vendor/jruby/tmp") | |
} | |
} | |
tasks.register("downloadAndInstallPreviousJRubyFFI", Copy) { | |
dependsOn=[downloadPreviousJRuby] | |
description "Install previous JRuby FFI files in the new JRuby directory" | |
inputs.file(previousJrubyTarPath) | |
outputs.dir("${projectDir}/vendor/jruby/lib/jni") | |
outputs.file("${projectDir}/vendor/jruby/lib/jruby.jar") | |
includeEmptyDirs = false | |
from(tarTree(downloadPreviousJRuby.dest)) { | |
// Copy only the previous builds of libjffi that changed from JRuby 9.3.9.0 to 9.3.10.0 | |
include "**/lib/jni/aarch64-Linux/libjffi-1.2.so" | |
include "**/lib/jni/arm-Linux/libjffi-1.2.so" | |
include "**/lib/jni/i386-Linux/libjffi-1.2.so" | |
include "**/lib/jni/x86_64-Linux/libjffi-1.2.so" | |
eachFile { f -> | |
f.path = f.path.replaceFirst("^jruby-${previousJRubyVersion}", '') | |
println "Installing Previous FFI: ${f.path}" | |
} | |
} | |
into "${projectDir}/vendor/jruby/tmp" | |
doLast { | |
ant.jar(destfile: "${projectDir}/vendor/jruby/lib/jruby.jar", update: true) { | |
fileset(dir: "${projectDir}/vendor/jruby/tmp/lib") | |
} | |
delete files("${projectDir}/vendor/jruby/tmp") | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and dipping down to ant
is much more straight-forward than the zip utility method I was attempting.
@logstashmachine backport 8.7 |
@logstashmachine backport 8.6 |
import platform-specific ffi binaries from JRuby 9.3.9.0 to overcome jruby/jruby#7579 Since JRuby ignores the files in "lib/jni" and uses the ones inside "lib/jruby.jar" instead, we have to inject the older versions into the new JRuby's "jruby.jar" fixes #14873 (cherry picked from commit 281ce70)
import platform-specific ffi binaries from JRuby 9.3.9.0 to overcome jruby/jruby#7579 Since JRuby ignores the files in "lib/jni" and uses the ones inside "lib/jruby.jar" instead, we have to inject the older versions into the new JRuby's "jruby.jar" fixes #14873 (cherry picked from commit 281ce70)
import platform-specific ffi binaries from JRuby 9.3.9.0 to overcome jruby/jruby#7579 Since JRuby ignores the files in "lib/jni" and uses the ones inside "lib/jruby.jar" instead, we have to inject the older versions into the new JRuby's "jruby.jar" fixes #14873 (cherry picked from commit 281ce70) Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
import platform-specific ffi binaries from JRuby 9.3.9.0 to overcome jruby/jruby#7579 Since JRuby ignores the files in "lib/jni" and uses the ones inside "lib/jruby.jar" instead, we have to inject the older versions into the new JRuby's "jruby.jar" fixes #14873 (cherry picked from commit 281ce70) Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
import ffi from JRuby 9.3.9.0 to overcome jruby/jruby#7579
Since JRuby ignores the files in "lib/jni" and uses the ones inside "lib/jruby.jar", we have to inject the older versions into the new JRuby's jruby.jar
fixes #14873