Update snakeyaml #305

Merged
merged 3 commits into from Dec 13, 2016

Projects

None yet

2 participants

@headius
Contributor
headius commented Dec 13, 2016

This re-updates snakeyaml to 1.17. I originally made the change in 146a637 and @hsbt reverted the code part in f545521. This broke psych on JRuby, since the code changes there were required for the update to snakeyaml. @hsbt said there was a build error he was trying to fix...if that occurs again I will look into it.

We need to get this out into a release ASAP since the currently-released psych for JRuby is broken, and we hoped to update to it for our next release to pick up other bug fixes.

headius added some commits Dec 13, 2016
@headius headius Revert "Partly reverted build error introduced 146a637."
This reverts commit f545521.
893d2fe
@headius headius Hardcode Snakeyaml versions to avoid conflict with JRuby consts.
cb13c8b
@headius headius Try just using rake, so psych doesn't get activated.
03872f4
@headius
Contributor
headius commented Dec 13, 2016

This branch now builds all MRI versions properly. It also builds the JRuby ext jar, but for some reason the rake build fails on travis (but works for me locally). I'm not concerned about that right now. I can run locally and get the expected test failures. I'd be satisfied getting a release of 2.2.2 out with these changes so we have a working psych gem to update for JRuby 9.1.7.0.

@headius
Contributor
headius commented Dec 13, 2016 edited

rake followed by gem build psych.gemspec appears to build a working JRuby psych gem from a clean clone.

@headius headius referenced this pull request in jruby/jruby Dec 13, 2016
Closed

Update Psych to eliminate deprecated usage #4196

@headius
Contributor
headius commented Dec 13, 2016

Going ahead with this after talking with @tenderlove. I'll put out a 2.2.2 release that has only MRI changes from master and JRuby changes from this branch.

@headius headius merged commit ab38c31 into master Dec 13, 2016

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@headius headius deleted the update-snakeyaml branch Dec 13, 2016
@hsbt
Member
hsbt commented Dec 13, 2016 edited

It still broke rake compile task with JRuby-9.1.6.0

ext/java/PsychParser.java:246: error: cannot find symbol
            RubyArray.newArray(runtime, runtime.newFixnum(_version.major()), runtime.newFixnum(_version.minor()));
                                                                  ^
  symbol:   method major()
  location: variable _version of type Version
ext/java/PsychParser.java:246: error: cannot find symbol
            RubyArray.newArray(runtime, runtime.newFixnum(_version.major()), runtime.newFixnum(_version.minor()));
                                                                                                       ^
  symbol:   method minor()
  location: variable _version of type Version

I'm ok to merge this, but I can't care jruby release in this status.

@headius
Contributor
headius commented Dec 14, 2016

@hsbt It worked properly here for me. I believe your environment has some version issues.

@headius headius added a commit to jruby/jruby that referenced this pull request Dec 14, 2016
@headius headius Update to Psych 2.2.2. See ruby/psych#305
Fixes #4196 again.
a477070
@hsbt
Member
hsbt commented Dec 14, 2016

It caused by JRuby 9.1.6.0 with snakeyaml-1.14 probably. I'm waiting to release JRuby 9.1.7.0 with snameyaml-1.17. :octocat:

so, I can care java version of psych after release it.

@headius
Contributor
headius commented Dec 14, 2016

Most of the build issues are due to it now activating bundler and rubygems, which pulls in the already-installed psych and seems to really mess up the versioning. I had to modify the build to just rake instead of bundle exec rake because that is broken currently. For the issue you're seeing, the problem is that it's confusing the snakeyaml version used by the default psych and the snakeyaml version that psych itself wants. This is all due to the build activating psych where before it just add it lib to load path.

I want to make this work easily so anyone can cut JRuby ext releases, but the build is kinda just broken right now and I've only done some minor patching around it.

@headius
Contributor
headius commented Dec 14, 2016

jruby-head has been updated to the 2.2.2 gems. At least for now, jruby-head should work for building, installing, and testing psych 2.2.2+.

@headius
Contributor
headius commented Dec 14, 2016
[] ~/projects/psych $ jruby -v
jruby 9.1.7.0-SNAPSHOT (2.3.1) 2016-12-13 a477070 Java HotSpot(TM) 64-Bit Server VM 25.112-b16 on 1.8.0_112-b16 +jit [darwin-x86_64]

[] ~/projects/psych $ rake compile
/Users/headius/projects/psych/lib/psych/versions.rb:4: warning: already initialized constant VERSION
/Users/headius/projects/psych/lib/psych/versions.rb:7: warning: already initialized constant DEFAULT_SNAKEYAML_VERSION
mvn dependency:build-classpath -Dsnakeyaml.version=1.17 -Dverbose=true
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building psych 0.0.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:build-classpath (default-cli) @ psych ---
[INFO] Wrote classpath file '/Users/headius/projects/psych/pkg/classpath'.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.600 s
[INFO] Finished at: 2016-12-13T18:17:40-06:00
[INFO] Final Memory: 29M/320M
[INFO] ------------------------------------------------------------------------
mkdir -p tmp/java/psych
javac -extdirs "/Users/headius/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java" -target 1.7 -source 1.7 -Xlint:unchecked  -cp "/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/classes:/Users/headius/projects/jruby/lib/jruby.jar:/Users/headius/.m2/repository/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar" -d tmp/java/psych ext/java/PsychEmitter.java ext/java/PsychLibrary.java ext/java/PsychParser.java ext/java/PsychToRuby.java ext/java/PsychYamlTree.java
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
touch tmp/java/psych/.build
jar cf tmp/java/psych/psych.jar -C tmp/java/psych org/jruby/ext/psych/PsychEmitter\$1.class -C tmp/java/psych org/jruby/ext/psych/PsychEmitter.class -C tmp/java/psych org/jruby/ext/psych/PsychLibrary\$1.class -C tmp/java/psych org/jruby/ext/psych/PsychLibrary\$YAMLEncoding.class -C tmp/java/psych org/jruby/ext/psych/PsychLibrary.class -C tmp/java/psych org/jruby/ext/psych/PsychParser\$1.class -C tmp/java/psych org/jruby/ext/psych/PsychParser.class -C tmp/java/psych org/jruby/ext/psych/PsychToRuby\$ClassLoader.class -C tmp/java/psych org/jruby/ext/psych/PsychToRuby\$ToRuby.class -C tmp/java/psych org/jruby/ext/psych/PsychToRuby.class -C tmp/java/psych org/jruby/ext/psych/PsychYamlTree.class
install -c tmp/java/psych/psych.jar lib/psych.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment