Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 524217af2aef
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bd3f9bed66eb
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Oct 24, 2016

  1. [Truffle] silence curl

    pitr-ch committed Oct 24, 2016
    Copy the full SHA
    4c45611 View commit details
  2. Copy the full SHA
    bd3f9be View commit details
Showing with 18 additions and 19 deletions.
  1. +18 −19 lib/ruby/truffle/truffle/bundler-workarounds.rb
37 changes: 18 additions & 19 deletions lib/ruby/truffle/truffle/bundler-workarounds.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$quiet_workaround = false

workaround_header = <<-HEREDOC
==========================================
@@ -9,7 +8,7 @@
2. Try running gem tests, e.g.:
GEM_HOME=/Users/brandonfish/Documents/truffle_gem_home ../../jruby/bin/jruby -X+T -rbundler-workarounds -S bundle exec rake
HEREDOC
puts workaround_header unless $quiet_workaround
puts workaround_header if $VERBOSE



@@ -21,7 +20,7 @@
Called here:
lib/ruby/stdlib/rubygems/basic_specification.rb:313
HEREDOC
puts have_extensions unless $quiet_workaround
puts have_extensions if $VERBOSE
class Gem::BasicSpecification
def have_extensions?; !extensions.nil? && !extensions.empty?; end
end
@@ -31,7 +30,7 @@ def have_extensions?; !extensions.nil? && !extensions.empty?; end
==========================================
Workaround: Use wget in remote fetcher
HEREDOC
puts remote_fetcher unless $quiet_workaround
puts remote_fetcher if $VERBOSE

require 'rubygems/remote_fetcher'
class Gem::RemoteFetcher
@@ -140,7 +139,7 @@ def download(spec, source_uri, install_dir = Gem.dir)
==========================================
Workaround: Hardcode DNS Resolution to rubygems.org for gem install
HEREDOC
puts remote_fetcher_api unless $quiet_workaround
puts remote_fetcher_api if $VERBOSE

class Gem::RemoteFetcher
def api_endpoint(uri)
@@ -180,15 +179,15 @@ def api_endpoint(uri)
Called here:
lib/bundler/ruby_version.rb:98
HEREDOC
puts ruby_version unless $quiet_workaround
puts ruby_version if $VERBOSE
RUBY_ENGINE = "ruby"


curl_https = <<-HEREDOC
==========================================
Workaround: Use curl when URIs are https
HEREDOC
puts curl_https unless $quiet_workaround
puts curl_https if $VERBOSE
class CurlResponse < Net::HTTPOK
def body
@body
@@ -217,7 +216,7 @@ def fetch
# WORKAROUND START
if @uri.scheme == "https"
resp = CurlResponse.new("1.1", 200, "OK")
resp_raw = `curl -i #{@uri}`
resp_raw = `curl -i -s #{@uri}`
blank_line_idx = resp_raw.index("\r\n\r\n")
header = resp_raw[0, blank_line_idx]
resp.body = resp_raw[(blank_line_idx+4)..-1]
@@ -239,7 +238,7 @@ def fetch
- shell to tar for untarring
- skip some checksum/digest verification
HEREDOC
puts rubygems_package unless $quiet_workaround
puts rubygems_package if $VERBOSE
require 'rubygems/package'
class Gem::Package
def extract_files destination_dir, pattern = "*"
@@ -335,7 +334,7 @@ def verify_entry entry
==========================================
Workaround: Disable zlib crc check
HEREDOC
puts zlib_crc unless $quiet_workaround
puts zlib_crc if $VERBOSE
require "zlib"
module Zlib
class GzipFile
@@ -366,7 +365,7 @@ def gzfile_check_footer()
==========================================
Workaround: Shell to gunzip in bundler updater
HEREDOC
puts bundler_updater unless $quiet_workaround
puts bundler_updater if $VERBOSE
bundler_loaded = false
begin
require "bundler"
@@ -441,7 +440,7 @@ module Cipher
Called here:
lib/ruby/stdlib/rubygems/security.rb:372
HEREDOC
puts cipher_new unless $quiet_workaround
puts cipher_new if $VERBOSE

def self.new(enc)

@@ -457,7 +456,7 @@ def self.new(enc)
Called here:
bundler/vendor/net/http/persistent.rb:519
HEREDOC
puts verify_peer unless $quiet_workaround
puts verify_peer if $VERBOSE
module SSL
VERIFY_PEER = 1
end
@@ -470,7 +469,7 @@ module SSL
Called here:
bundler/vendor/net/http/persistent.rb:1142
HEREDOC
puts verify_none unless $quiet_workaround
puts verify_none if $VERBOSE
module SSL
VERIFY_NONE = 0
end
@@ -499,7 +498,7 @@ def add_file(f)
==========================================
Workaround: Use curl in bundler downloader for https requests
HEREDOC
puts bundler_fetcher unless $quiet_workaround
puts bundler_fetcher if $VERBOSE

require "openssl-stubs"

@@ -515,7 +514,7 @@ def fetch(uri, options = {}, counter = 0)
# WORKAROUND START
response = if uri.scheme == "https"
resp = CurlResponse.new("1.1", 200, "OK")
resp_raw = `curl -i #{uri}`
resp_raw = `curl -i -s #{uri}`
blank_line_idx = resp_raw.index("\r\n\r\n")
header = resp_raw[0, blank_line_idx]
resp.body = resp_raw[(blank_line_idx+4)..-1]
@@ -562,7 +561,7 @@ def fetch(uri, options = {}, counter = 0)
Error: type mismatch: String given
stdlib/rubygems/resolver.rb:237:in `block in search_for'
HEREDOC
puts resolver_search_for unless $quiet_workaround
puts resolver_search_for if $VERBOSE
require "rubygems/resolver"
class Gem::Resolver
def search_for(dependency)
@@ -584,7 +583,7 @@ def search_for(dependency)
Error: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
This can be used to ignore building gem extensions until this is working correctly.
HEREDOC
puts native_extensions unless $quiet_workaround
puts native_extensions if $VERBOSE
require "rubygems/ext/builder"

class Gem::Ext::Builder
@@ -615,4 +614,4 @@ def build_extensions
end
end

puts "==========================================" unless $quiet_workaround
puts "==========================================" if $VERBOSE