Skip to content

Instantly share code, notes, and snippets.

@bjfish
bjfish / console.log
Created September 14, 2017 01:57
jt environment
$ jt environment
Environment
JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
RUBY_BIN:
GRAALVM_BIN:
GRAAL_HOME:
JVMCI_BIN:
JVMCI_GRAAL_HOME:
GRAAL_JS_JAR:
SL_JAR:
@bjfish
bjfish / headers.patch
Last active September 5, 2017 00:41
Patch file
Only in lib/cext/ruby: config.h
diff -ur ../ruby/include/ruby/encoding.h lib/cext/ruby/encoding.h
--- ../ruby/include/ruby/encoding.h 2017-06-28 20:38:05.000000000 -0500
+++ lib/cext/ruby/encoding.h 2017-09-03 10:51:53.000000000 -0500
@@ -44,10 +44,7 @@
#define RB_ENCODING_GET_INLINED(obj) \
(int)((RBASIC(obj)->flags & RUBY_ENCODING_MASK)>>RUBY_ENCODING_SHIFT)
-#define RB_ENCODING_GET(obj) \
- (RB_ENCODING_GET_INLINED(obj) != RUBY_ENCODING_INLINE_MAX ? \
@bjfish
bjfish / running_with_sulong.md
Last active January 9, 2017 04:59
Running with Sulong
  1. Follow the steps to setup sulong from the README: https://github.com/graalvm/sulong

OSX Steps

  1. Install llvm version 3.3 I installed with the following way (mileage may vary):

    wget https://raw.githubusercontent.com/Homebrew/homebrew-versions/75e1f3f6e640b97c4f0d64d8797da94073cd612c/llvm33.rb
    brew install llvm33.rb
    
@bjfish
bjfish / dep_tree.md
Last active January 9, 2017 17:53
Dependency Tree

Gem Testing

bundle install && bundle exec rake test

bundle exec rake test
\- bundle install
   \- openssl
irb(main):017:0> "\xD8\x00\x30\x42".force_encoding(Encoding::UTF_16BE).scrub("dog".encode(Encoding::UTF_16BE)) { "cat".encode(Encoding::UTF_16BE) }
=> "dog\u3042"
irb(main):018:0> "\xD8\x00\x30\x42".scrub("dog") { "cat" }
=> "cat\u00000B"
@bjfish
bjfish / gist:762dabd9aaac3fd1c0040ce18e50587e
Created December 14, 2016 23:05
Trying to update a sprintf node, ArrayIndexOutOfBoundsException for parent frame in snippet node
@NodeChild(value = "value", type = FormatNode.class)
public abstract class ToDoubleWithCoercionNode extends FormatNode {
@Child private SnippetNode snippetNode = new SnippetNode();
public ToDoubleWithCoercionNode(RubyContext context) {
super(context);
}
@Specialization
@bjfish
bjfish / gist:d70799f5362123df458d3b35671a6618
Created December 14, 2016 22:42
processs and exec spec failures
Brandons-MacBook-Pro:jruby brandonfish$ jt build
$ JRUBY_BUILD_MORE_QUIET=true ./mvnw -q package
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=2048m; support was removed in 8.0
/Users/brandonfish/Documents/jruby/core/target/generated-sources/annotated_classes.txt - not found. skip generator.
Brandons-MacBook-Pro:jruby brandonfish$ jt test spec/ruby/core/process/exec_spec.rb
$ ruby spec/mspec/bin/mspec run --config spec/truffle/truffle.mspec --excl-tag fails spec/ruby/core/process/exec_spec.rb
jruby+truffle 9.1.7.0-SNAPSHOT (2.3.1) 2016-12-03 unknown Java HotSpot(TM) 64-Bit Server VM 25.66-b17 on 1.8.0_66-b17 [darwin-x86_64]
1)
Process.exec raises Errno::ENOENT for a command which does not exist ERROR
diff --git a/lib/ruby/stdlib/mkmf.rb b/lib/ruby/stdlib/mkmf.rb
index 3181b05..1f11e6a 100644
--- a/lib/ruby/stdlib/mkmf.rb
+++ b/lib/ruby/stdlib/mkmf.rb
@@ -2718,5 +2718,5 @@ end
include MakeMakefile
if not $extmk and /\A(extconf|makefile).rb\z/ =~ File.basename($0)
- END {mkmf_failed($0)}
+ #END {mkmf_failed($0)}
1)
Socket.unpack_sockaddr_in raises an ArgumentError when the sin_family is not AF_INET ERROR
RuntimeError: FFI::Library method gai_strerror with caller /Users/brandonfish/Documents/jruby/lib/ruby/truffle/rubysl/rubysl-socket/lib/rubysl/socket.rb not implemented
/Users/brandonfish/Documents/jruby/truffle/src/main/ruby/core/library.rb:64:in `gai_strerror'
/Users/brandonfish/Documents/jruby/lib/ruby/truffle/rubysl/rubysl-socket/lib/rubysl/socket.rb:466:in `block (3 levels) in getnameinfo'
/Users/brandonfish/Documents/jruby/truffle/src/main/ruby/core/truffle/ffi/pointer.rb:286:in `new'
irb(main):004:0> Errno::EAGAIN::Errno.class
=> Module
irb(main):005:0> Errno::EAGAIN::Errno.object_id
=> 84
irb(main):006:0> Errno.object_id
=> 84