Skip to content

Backport 9.3 fixes for 9.2.12#6285

Merged
headius merged 11 commits intojruby:jruby-9.2from
headius:backports_for_9_2_12
Jun 17, 2020
Merged

Backport 9.3 fixes for 9.2.12#6285
headius merged 11 commits intojruby:jruby-9.2from
headius:backports_for_9_2_12

Conversation

@headius
Copy link
Member

@headius headius commented Jun 16, 2020

This PR will pull in small backports from master that we want to release as part of 9.2.12.

@headius headius added this to the JRuby 9.2.12.0 milestone Jun 16, 2020
@headius
Copy link
Member Author

headius commented Jun 16, 2020

Cherry pick 8562267 for #6112

@headius headius changed the title [fix] Enumerable#any? does not require an arg Backport 9.3 fixes for 9.2.12 Jun 16, 2020
headius added 2 commits June 16, 2020 18:57
This isn't great since we're allowing a null field and checking
for null, but the logic surrounding this has been designed to
lazily create the channel or stream in question. This is likely
due to the use of URLResource and its siblings as generic path/URI
mungers that can clean up and canonicalize/abosolutize even paths
that do not exist. Rather than attempt to isolate that behavior
(which might be a lot more work), I've opted to mimic FileResource
in raising an error along the lazy path when it's clear we don't
have a resource in hand to open.

This fixes jruby#6219.
@headius
Copy link
Member Author

headius commented Jun 16, 2020

Cherry picked bc5967c and c259d52 from #6256 for #6219.

headius added 4 commits June 16, 2020 19:00
Because all modules will report isOpen => true when called from
the unnamed module, we need a different way of accessing them.
This logic makes two changes:

* Use Lookup to acquire a method handle rather than using the
  reflected object. This allows to be sure we now have a fully
  accessible mechanism for accessing the related field or method,
  without triggering any warnings. Lookup.unreflect* will raise
  an exception if the reflected object is not already accessible,
  rather than a warning we cannot detect.
* Use addOpens to attempt to *really* make the pseudo-open
  packages be open. This allows us to proceed to setAccessible
  knowing the package has moved from "kinda-sorta-open" to really
  open.

The fallbacks here occur in the following cases:

* If we cannot acquire a reference to a non-standard JDK class,
  like those in sun.nio.ch. This should not ever fail; reflecting
  against these classes is always permitted.
* If we cannot acquire the method or field in question because it
  is not there. Again this should not fail under normal
  circumstances.
* If we cannot unreflect a handle and cannot addOpens for the
  package in question.
@headius
Copy link
Member Author

headius commented Jun 17, 2020

Cherry picked 01830ee, 233f676, 9a40173, 3e4fa01, and e8dbe9c from #6195 to fix various issues relating to JPMS warnings.

@headius
Copy link
Member Author

headius commented Jun 17, 2020

Looking into the build failure locally. Clearly we did something on master to fix it but I can't remember what. 🤔

headius added 3 commits June 17, 2020 03:29
This is a partial fix for jruby#6103. The issue there is that in 9.2.10
we updated to a version of RubyGems that no longer supports the
--no-rdoc and --no-ri flags. Normally the build here would run
with 9.2.7.0, which does support those flags, but when running a
SNAPSHOT build we use the version of JRuby that we're building.
If that version is >= 9.2.10.0 it will fail because the --no-rdoc
flag is not recognized.

We could fix it by enabling rdoc and bypassing the relevant logic
in the InstallMojo from gem-maven-plugin, but we don't really want
to install rdoc and ri for the bootstrap gems.

Instead, I am forcing this to always use 9.2.7.0 until we can get
the plugin updated to a newer JRuby and fix the flags
appropriately.

This allows a non-SNAPSHOT bootstrap to almost work; it then fails
with the issue in jruby#6174. I will commit a separate workaround for
that.

Works around jruby#6103.
This gem was only being installed for non-snapshot (release)
builds, even though we don't ever ship the results of that
install. Because of jruby#6174, that install fails because no
jruby.home is passed in the extension-building subprocess.

This works around the issue by not installing jruby-launcher for
release builds, but the problem remains: gem-maven-plugin cannot
currently install gems with native builds due to the build command
line not providing a jruby.home.

This relates to jruby#6103, which prevented us from getting to this
point before if building a non-snapshot build. With this change,
both snapshots and releases will bootstrap correctly, and neither
will install jruby-launcher.
@headius
Copy link
Member Author

headius commented Jun 17, 2020

See #6103 and #6174 which were the causes of build failures. The trigger was not having the branch pointing at a SNAPSHOT build, which caused the bootstrap build to use the current JRuby (which doesn't support --no-rdoc, #6103) and install jruby-launcher using the gem-maven-plugin (#6174).

I have worked around these issues on the branch, and my workarounds should be safe to merge to master.

@headius headius merged commit a1c0d77 into jruby:jruby-9.2 Jun 17, 2020
@headius headius deleted the backports_for_9_2_12 branch June 17, 2020 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants