-
Notifications
You must be signed in to change notification settings - Fork 19
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
installing gems with jar dependencies like psych fails on recent ruby-maven/ruby-maven-libs #92
Comments
I have added a patch in Logstash to strip the output of maven https://github.com/elastic/logstash/pull/16919/files#diff-9e78c34e57f2d0ebb1b85aab010e6d6f55101da6da4f1c324f2246dcf334a366R137-R158 Example output:
|
This will be fixed momentarily when I release an update to jar-dependencies. |
Fixed by jar-dependencies 0.5.2. |
Thanks, I'm still hitting some issues with 9.4.10.0, so we may wait until a new release ships with jar-dependencies 0.5.2. I'm not sure why:
Works correctly, but:
Will fail with the same error:
|
handle maven output that can carry "garbage" information after the jar's name. this patch deletes that extra information, also pins psych to 5.2.2 until jruby ships with snakeyaml-engine 2.9 and jar-dependencies 0.5.2 Related to: https://github.com/jruby/jruby/issues/8579
8.x backport of #16919 handle maven output that can carry "garbage" information after the jar's name. this patch deletes that extra information, also pins psych to 5.2.2 until jruby ships with snakeyaml-engine 2.9 and jar-dependencies 0.5.2 Related to: jruby/jruby#8579
handle maven output that can carry "garbage" information after the jar's name. this patch deletes that extra information, also pins psych to 5.2.2 until jruby ships with snakeyaml-engine 2.9 and jar-dependencies 0.5.2 Related to: https://github.com/jruby/jruby/issues/8579 (cherry picked from commit 52b7fb0)
handle maven output that can carry "garbage" information after the jar's name. this patch deletes that extra information, also pins psych to 5.2.2 until jruby ships with snakeyaml-engine 2.9 and jar-dependencies 0.5.2 Related to: https://github.com/jruby/jruby/issues/8579 (cherry picked from commit 52b7fb0)
) handle maven output that can carry "garbage" information after the jar's name. this patch deletes that extra information, also pins psych to 5.2.2 until jruby ships with snakeyaml-engine 2.9 and jar-dependencies 0.5.2 Related to: https://github.com/jruby/jruby/issues/8579 (cherry picked from commit 52b7fb0) Co-authored-by: João Duarte <[email protected]>
) handle maven output that can carry "garbage" information after the jar's name. this patch deletes that extra information, also pins psych to 5.2.2 until jruby ships with snakeyaml-engine 2.9 and jar-dependencies 0.5.2 Related to: https://github.com/jruby/jruby/issues/8579 (cherry picked from commit 52b7fb0) Co-authored-by: João Duarte <[email protected]>
Wait a bit longer... there's some issues with the 0.5.2 release I'm working through today. |
@headius just fyi the extra text in the output of maven deps is still causing an issue even with jruby 9.4.11.0 and jar-dependencies 0.5.3. Given the Dockerfile: FROM openjdk:21
WORKDIR /tmp
RUN curl -s https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.4.11.0/jruby-dist-9.4.11.0-bin.tar.gz | tar -zxf -
ENV PATH="/tmp/jruby-9.4.11.0/bin:$PATH"
RUN mkdir /tmp/my_gem
RUN echo -e "Gem::Specification.new do |spec|\n" \
" spec.name = 'my_gem'\n" \
" spec.version = '0.1.0'\n" \
" spec.summary = 'A simple gem that downloads a JAR'\n" \
" spec.authors = ['Your Name']\n" \
" spec.email = ['[email protected]']\n" \
" spec.files = Dir['lib/**/*']\n" \
" spec.require_paths = ['lib']\n" \
" spec.add_dependency 'jar-dependencies'\n" \
" spec.requirements = 'jar com.google.protobuf:protobuf-java, 4.29.3'\n" \
" spec.platform = 'java'\n" \
"end" > my_gem.gemspec
RUN cat my_gem.gemspec
RUN gem build -q my_gem.gemspec
RUN gem install my_gem-0.1.0-java.gem -N errors with:
|
Ok I will try to reproduce and we will get this fixed. I'm going to move this to the jar-dependencies repo. At least we can upgrade it now! |
I found that trying to install gems that require jars using modern ruby-maven and ruby-maven-libs wont work.
However JRuby will pull older versions by default:
As we can see it works because older versions were still pulled even though I didn't ask for them:
However if I delete the older versions:
And try again, now we can see it fail:
ERROR TEMPLATE:
Environment
Bundler Build Metadata
Bundler settings
Gemfile
Gemfile
Gemfile.lock
I believe the reason this fails is because the new mvn libs is outputting text the gems are not expecting. I got this from Logstash:
mvn will output
org.snakeyaml:snakeyaml-engine:jar:2.7:compile:/Users/joaoduarte/.m2/repository/org/snakeyaml/snakeyaml-engine/2.7/snakeyaml-engine-2.7.jar -- module org.snakeyaml.engine.v2
, which then ends up being treated as the dependency's full name, so then FIleUtils.copy breaks:Let me know if I should move this to one of the jruby maven gem repositories instead.
The text was updated successfully, but these errors were encountered: