Skip to content

revert ipv6 availability#7071

Merged
headius merged 1 commit intojruby:jruby-9.3from
ahorek:revert_ipv6
Mar 16, 2022
Merged

revert ipv6 availability#7071
headius merged 1 commit intojruby:jruby-9.3from
ahorek:revert_ipv6

Conversation

@ahorek
Copy link
Contributor

@ahorek ahorek commented Feb 4, 2022

partly reverts #6945

see #7069

@ahorek ahorek changed the title WIP: revert ipv6 availability revert ipv6 availability Feb 4, 2022
@ahorek ahorek requested a review from headius February 4, 2022 22:34
@ahorek ahorek added this to the JRuby 9.3.4.0 milestone Feb 4, 2022
@headius
Copy link
Member

headius commented Feb 7, 2022

Looks good. This issue makes me think we were right to hold off on defining all socket constants a la #6839 and #6840. Perhaps we need to reevaluate those?

@headius
Copy link
Member

headius commented Feb 7, 2022

This issue makes me think we were right to hold off

Actually perhaps this means we could go ahead defining everything? It seems like CRuby only avoids defining these constants if the underlying platform does not provide the C defines necessary, rather than detecting if those socket features are available. I am unsure. 🤔

Waiting on @p-mongo for confirmation.

@p-mongo
Copy link

p-mongo commented Feb 7, 2022

I get this error when trying to build jruby-9.3:

[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (anno) @ jruby-base ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:copy-resources (default) @ jruby-base ---
[INFO] Using 'utf-8' encoding to copy filtered resources.
[INFO] Using 'utf-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource to /home/w/apps/exp/jruby/core/src/main/java
[INFO] Copying 4 resources to /home/w/apps/exp/jruby/core/src/main/java/META-INF/
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jruby-base ---
[INFO] Compiling 176 source files to /home/w/apps/exp/jruby/core/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING : 
[INFO] -------------------------------------------------------------
[WARNING] [options] bootstrap class path not set in conjunction with -source 8
[WARNING] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/parser/RubyParser.java:[3241,28] [deprecation] Integer(int) in Integer has been deprecated
[INFO] 2 warnings 
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] method org.jruby.ext.socket.Ifaddr.netmask(org.jruby.runtime.ThreadContext) should not throw exceptions: java.net.UnknownHostException
/home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[37,34] error: cannot find symbol
  symbol:   class RubyModule$INVOKER$i$2$0$alias_method
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[67,34] error: cannot find symbol
  symbol:   class RubyModule$INVOKER$i$0$0$rbProtected
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[152,34] error: cannot find symbol
  symbol:   class RubyModule$INVOKER$i$0$0$rbPrivate
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[184,34] error: cannot find symbol
  symbol:   class RubyModule$INVOKER$i$0$0$rbPublic
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[187,34] error: cannot find symbol
  symbol:   class RubyModule$INVOKER$i$0$0$module_function
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[229,34] error: cannot find symbol
  symbol:   class RubyModule$INVOKER$i$1$0$autoload_p
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyString$POPULATOR.java:[322,34] error: cannot find symbol
  symbol:   class RubyString$INVOKER$i$1$0$unpack
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1437,12] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1447,27] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1458,18] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1459,58] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1461,41] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1461,71] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1462,23] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1470,23] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyEnumerator$POPULATOR.java:[34,34] error: cannot find symbol
  symbol:   class RubyEnumerator$INVOKER$i$1$0$op_plus
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyInteger$POPULATOR.java:[164,34] error: cannot find symbol
  symbol:   class RubyInteger$INVOKER$i$1$0$op_aref
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyHash$POPULATOR.java:[90,34] error: cannot find symbol
  symbol:   class RubyHash$INVOKER$i$0$0$transform_keys
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyHash$POPULATOR.java:[175,34] error: cannot find symbol
  symbol:   class RubyHash$INVOKER$i$0$0$transform_keys_bang
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyComparable$POPULATOR.java:[39,34] error: cannot find symbol
  symbol:   class RubyComparable$INVOKER$s$2$0$clamp
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyThread$POPULATOR.java:[178,34] error: cannot find symbol
  symbol:   class RubyThread$INVOKER$i$0$0$safe_level
  location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRClosure.java:[57,20] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRClosure.java:[337,28] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$ext$pathname$RubyPathname$POPULATOR.java:[29,47] error: cannot find symbol
  symbol:   class RubyPathname$INVOKER$s$0$1$glob
  location: package org.jruby.ext.pathname
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/persistence/IRReaderStream.java:[496,59] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/persistence/IRReaderStream.java:[497,24] error: reference to Integer is ambiguous
  both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[INFO] 26 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for JRuby 9.3.4.0-SNAPSHOT:
[INFO] 
[INFO] JRuby .............................................. SUCCESS [  0.181 s]
[INFO] JRuby Base ......................................... FAILURE [  4.231 s]
[INFO] JRuby Core ......................................... SKIPPED
[INFO] JRuby Lib Setup .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.118 s
[INFO] Finished at: 2022-02-07T14:55:16-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project jruby-base: Compilation failure: Compilation failure: 
[ERROR] method org.jruby.ext.socket.Ifaddr.netmask(org.jruby.runtime.ThreadContext) should not throw exceptions: java.net.UnknownHostException
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[37,34] error: cannot find symbol
[ERROR]   symbol:   class RubyModule$INVOKER$i$2$0$alias_method
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[67,34] error: cannot find symbol
[ERROR]   symbol:   class RubyModule$INVOKER$i$0$0$rbProtected
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[152,34] error: cannot find symbol
[ERROR]   symbol:   class RubyModule$INVOKER$i$0$0$rbPrivate
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[184,34] error: cannot find symbol
[ERROR]   symbol:   class RubyModule$INVOKER$i$0$0$rbPublic
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[187,34] error: cannot find symbol
[ERROR]   symbol:   class RubyModule$INVOKER$i$0$0$module_function
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyModule$POPULATOR.java:[229,34] error: cannot find symbol
[ERROR]   symbol:   class RubyModule$INVOKER$i$1$0$autoload_p
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyString$POPULATOR.java:[322,34] error: cannot find symbol
[ERROR]   symbol:   class RubyString$INVOKER$i$1$0$unpack
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1437,12] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1447,27] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1458,18] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1459,58] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1461,41] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1461,71] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1462,23] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRBuilder.java:[1470,23] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyEnumerator$POPULATOR.java:[34,34] error: cannot find symbol
[ERROR]   symbol:   class RubyEnumerator$INVOKER$i$1$0$op_plus
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyInteger$POPULATOR.java:[164,34] error: cannot find symbol
[ERROR]   symbol:   class RubyInteger$INVOKER$i$1$0$op_aref
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyHash$POPULATOR.java:[90,34] error: cannot find symbol
[ERROR]   symbol:   class RubyHash$INVOKER$i$0$0$transform_keys
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyHash$POPULATOR.java:[175,34] error: cannot find symbol
[ERROR]   symbol:   class RubyHash$INVOKER$i$0$0$transform_keys_bang
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyComparable$POPULATOR.java:[39,34] error: cannot find symbol
[ERROR]   symbol:   class RubyComparable$INVOKER$s$2$0$clamp
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$RubyThread$POPULATOR.java:[178,34] error: cannot find symbol
[ERROR]   symbol:   class RubyThread$INVOKER$i$0$0$safe_level
[ERROR]   location: package org.jruby
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRClosure.java:[57,20] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/IRClosure.java:[337,28] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/target/generated-sources/org/jruby/gen/org$jruby$ext$pathname$RubyPathname$POPULATOR.java:[29,47] error: cannot find symbol
[ERROR]   symbol:   class RubyPathname$INVOKER$s$0$1$glob
[ERROR]   location: package org.jruby.ext.pathname
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/persistence/IRReaderStream.java:[496,59] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] /home/w/apps/exp/jruby/core/src/main/java/org/jruby/ir/persistence/IRReaderStream.java:[497,24] error: reference to Integer is ambiguous
[ERROR]   both class org.jruby.ir.operands.Integer in org.jruby.ir.operands and class java.lang.Integer in java.lang match
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :jruby-base
serene2% 

I built master successfully but the patches don't apply there.

@ahorek
Copy link
Contributor Author

ahorek commented Feb 8, 2022

@headius CRuby does define these constants (if they're present on the platform aka jnr-constants), but it doesn't mean that any ipv6 connection has to be usable. Also, interfaces could be changed at runtime.

CRuby does raise when you want to use such an address
https://github.com/ruby/ruby/blob/master/lib/resolv.rb#L752
https://github.com/ruby/ruby/blob/master/spec/ruby/library/socket/fixtures/classes.rb#L53

due to these differences in behavior, I think this change should be reverted

we do ignore forced protocols and we have some fallbacks to ipv4, so this part doesn't work the same due to implementation differences (native socket vs java)
I'm surprised tests didn't break, maybe GHA does support ipv6 now?

@p-mongo these errors are weird, could you try a clean build? mvn clean & mvn ?

@headius
Copy link
Member

headius commented Feb 8, 2022

@p-mongo That looks like a stale build. Try mvn clean build

@enebo
Copy link
Member

enebo commented Mar 16, 2022

@p-mongo any chance you can try this again with a clean build mvn clean build?

@p-mongo
Copy link

p-mongo commented Mar 16, 2022

mvn clean build did not work: https://gist.github.com/p-mongo/9a0bbd82473ac87ab90990b79bf422f8

I assume the clean part worked, I am running ./mvnw per the building instructions now.

@p-mongo
Copy link

p-mongo commented Mar 16, 2022

Built was successful but the binary fails at trying to load rubygems:

serene2% env - PATH=$PATH bash
w@serene2:/home/w/apps/exp/jruby$ ls
BSDL                LICENSE.RUBY  bench                     ivy                             pom.rb   test
BUILDING.md         README.md     bin                       lib                             pom.xml  tool
CODE_OF_CONDUCT.md  Rakefile      core                      lifecycle-mapping-metadata.xml  rakelib
COPYING             SECURITY.md   default.build.properties  maven                           samples
Gemfile             VERSION       findbugs.xml              mvnw                            shaded
LEGAL               antlib        install                   mvnw.cmd                        spec
w@serene2:/home/w/apps/exp/jruby$ which ruby
/home/w/.rbenv/shims/ruby
w@serene2:/home/w/apps/exp/jruby$ export PATH=`pwd`/bin:$PATH
w@serene2:/home/w/apps/exp/jruby$ which ruby
/home/w/apps/exp/jruby/bin/ruby
w@serene2:/home/w/apps/exp/jruby$ irb
LoadError: load error: rubygems -- java.lang.ArrayIndexOutOfBoundsException: Index 378 out of bounds for length 374
  require at org/jruby/RubyKernel.java:1017
   <main> at /home/w/apps/exp/jruby/bin/irb:9
w@serene2:/home/w/apps/exp/jruby$ ruby -rrubygems
LoadError: load error: rubygems -- java.lang.ArrayIndexOutOfBoundsException: Index 378 out of bounds for length 374
  require at org/jruby/RubyKernel.java:1017
w@serene2:/home/w/apps/exp/jruby$ 

I normally use rbenv (and zsh), thus the first command is intended to get rid of any rbenv setup that might be loaded.

@headius headius merged commit ad9d038 into jruby:jruby-9.3 Mar 16, 2022
@p-mongo
Copy link

p-mongo commented Mar 16, 2022

I realized that I was trying to test master which is 9.4, after I switched to 9.3 and rebuilt the two tests which have been previously failing are now passing.

@headius
Copy link
Member

headius commented Mar 16, 2022

@p-mongo Oh great, thank you!

We will have to look into the brokenness on master, but this is merged and will be in 9.3.4!

@p-mongo
Copy link

p-mongo commented Mar 16, 2022

Actually my machine (without docker) may have always worked, to test this it properly I'd probably need to use the snapshot after all.

@Milanhe92
Copy link

Procureo Rubi token

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.

5 participants