diff options
author | apolcyn <apolcyn@google.com> | 2018-01-09 09:53:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-09 09:53:12 -0800 |
commit | 1d1086f4c244da1654bd64e39f8070800de02ab4 (patch) | |
tree | c389e9fd14761f02dba4360601fae47e8fc024c0 /third_party/rake-compiler-dock/build | |
parent | fead0879460da1a7990d43472f770bb4fe8145f6 (diff) | |
parent | 8065a5e73c54801ed0f6c2b6e5469c4e34a83f48 (diff) |
Merge pull request #13910 from apolcyn/ruby_25_build
Base the ruby artifact-build docker file off of rake-compiler-dock's
Diffstat (limited to 'third_party/rake-compiler-dock/build')
11 files changed, 0 insertions, 246 deletions
diff --git a/third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/compat-with-bundler.diff b/third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/compat-with-bundler.diff deleted file mode 100644 index ea22bd928e..0000000000 --- a/third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/compat-with-bundler.diff +++ /dev/null @@ -1,105 +0,0 @@ -From 41f834449fc4323b2f995e8715aa5842d9fd9334 Mon Sep 17 00:00:00 2001 -From: Lars Kanis <lars@greiz-reinsdorf.de> -Date: Sat, 30 Jan 2016 08:08:07 +0100 -Subject: [PATCH] Change the fake mechanism to be compatible with bundler. - -The previous fake mechanism worked by hooking onto the -"require 'rbconfig'" call. -This is problematic because bundler internally requires rbconfig, but doesn't -work corretly in a faked environment. -It then fails to load gems that are also part of the standard library, like -json and rdoc. -This results in issues like https://github.com/rake-compiler/rake-compiler-dock/issues/8 - -The fake mechanism is now changed to hook onto the "require 'mkrb'" call, -which is typically part of the extconf file, and it is where the faked platform -values are actually needed. -That way it is loaded after bundler/setup, so that the library paths are -set according to the Gemfile.lock, to the native Linux libraries, before -the fake environment is active. - -Please note, that the build directory of a given gem needs to be cleared, -in order to get updated fake files. So do a "rm tmp pkg -rf". ---- - lib/rake/extensiontask.rb | 35 ++++++++++++++--------------------- - 1 file changed, 14 insertions(+), 21 deletions(-) - -diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb -index 030af96..f914919 100644 ---- a/lib/rake/extensiontask.rb -+++ b/lib/rake/extensiontask.rb -@@ -169,8 +169,8 @@ Java extension should be preferred. - # now add the extconf script - cmd << abs_extconf.relative_path_from(abs_tmp_path) - -- # rbconfig.rb will be present if we are cross compiling -- if t.prerequisites.include?("#{tmp_path}/rbconfig.rb") then -+ # fake.rb will be present if we are cross compiling -+ if t.prerequisites.include?("#{tmp_path}/fake.rb") then - options.push(*cross_config_options(platf)) - end - -@@ -365,39 +365,30 @@ Java extension should be preferred. - # define compilation tasks for cross platform! - define_compile_tasks(for_platform, ruby_ver) - -- # chain fake.rb, rbconfig.rb and mkmf.rb to Makefile generation -+ # chain fake.rb and mkmf.rb to Makefile generation - file "#{tmp_path}/Makefile" => ["#{tmp_path}/fake.rb", -- "#{tmp_path}/rbconfig.rb", - "#{tmp_path}/mkmf.rb"] - -- # copy the file from the cross-ruby location -- file "#{tmp_path}/rbconfig.rb" => [rbconfig_file] do |t| -+ # copy the rbconfig from the cross-ruby location and -+ # genearte fake.rb for different ruby versions -+ file "#{tmp_path}/fake.rb" => [rbconfig_file] do |t| - File.open(t.name, 'w') do |f| -- f.write "require 'fake.rb'\n\n" -+ f.write fake_rb(for_platform, ruby_ver) - f.write File.read(t.prerequisites.first) - end - end - - # copy mkmf from cross-ruby location - file "#{tmp_path}/mkmf.rb" => [mkmf_file] do |t| -- cp t.prerequisites.first, t.name -- if ruby_ver < "1.9" && "1.9" <= RUBY_VERSION -- File.open(t.name, 'r+t') do |f| -- content = f.read -+ File.open(t.name, 'w') do |f| -+ content = File.read(t.prerequisites.first) -+ content.sub!(/^(require ')rbconfig(')$/, '\\1fake\\2') -+ if ruby_ver < "1.9" && "1.9" <= RUBY_VERSION - content.sub!(/^( break )\*(defaults)$/, '\\1\\2.first') - content.sub!(/^( return )\*(defaults)$/, '\\1\\2.first') - content.sub!(/^( mfile\.)print( configuration\(srcprefix\))$/, '\\1puts\\2') -- f.rewind -- f.write content -- f.truncate(f.tell) - end -- end -- end -- -- # genearte fake.rb for different ruby versions -- file "#{tmp_path}/fake.rb" do |t| -- File.open(t.name, 'w') do |f| -- f.write fake_rb(for_platform, ruby_ver) -+ f.write content - end - end - -@@ -495,8 +486,10 @@ Java extension should be preferred. - # "cannot load such file -- win32/resolv" when it is required later on. - # See also: https://github.com/tjschuck/rake-compiler-dev-box/issues/5 - require 'resolv' -+ require 'rbconfig' - - class Object -+ remove_const :RbConfig - remove_const :RUBY_PLATFORM - remove_const :RUBY_VERSION - remove_const :RUBY_DESCRIPTION if defined?(RUBY_DESCRIPTION) --- -2.5.0.windows.1 - diff --git a/third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/without-exts.diff b/third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/without-exts.diff deleted file mode 100644 index 07739d33ec..0000000000 --- a/third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/without-exts.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake -index 6acc816..6aa2a49 100644 ---- a/tasks/bin/cross-ruby.rake -+++ b/tasks/bin/cross-ruby.rake -@@ -135,8 +135,7 @@ file "#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}/Makefile" => ["#{USER - "--build=#{RUBY_BUILD}", - '--enable-shared', - '--disable-install-doc', -- '--without-tk', -- '--without-tcl' -+ '--with-ext=' - ] - - # Force Winsock2 for Ruby 1.8, 1.9 defaults to it diff --git a/third_party/rake-compiler-dock/build/patches/ruby-1.8.7-p374/nop.patch b/third_party/rake-compiler-dock/build/patches/ruby-1.8.7-p374/nop.patch deleted file mode 100644 index fac8525da6..0000000000 --- a/third_party/rake-compiler-dock/build/patches/ruby-1.8.7-p374/nop.patch +++ /dev/null @@ -1,2 +0,0 @@ -diff --git a/configure b/configure -index 55157af..6630eba 100755 diff --git a/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/no_sendfile.patch b/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/no_sendfile.patch deleted file mode 100644 index d8f339e814..0000000000 --- a/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/no_sendfile.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/configure b/configure -index 898730c..cfe6253 100755 ---- a/configure -+++ b/configure -@@ -14695,7 +14695,7 @@ for ac_func in fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot ge - setsid telldir seekdir fchmod cosh sinh tanh log2 round\ - setuid setgid daemon select_large_fdset setenv unsetenv\ - mktime timegm gmtime_r clock_gettime gettimeofday poll ppoll\ -- pread sendfile shutdown sigaltstack dl_iterate_phdr -+ pread shutdown sigaltstack dl_iterate_phdr - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/nop.patch b/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/nop.patch deleted file mode 100644 index fac8525da6..0000000000 --- a/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/nop.patch +++ /dev/null @@ -1,2 +0,0 @@ -diff --git a/configure b/configure -index 55157af..6630eba 100755 diff --git a/third_party/rake-compiler-dock/build/patches/ruby-2.3.0/no_sendfile.patch b/third_party/rake-compiler-dock/build/patches/ruby-2.3.0/no_sendfile.patch deleted file mode 100644 index 915fc7b790..0000000000 --- a/third_party/rake-compiler-dock/build/patches/ruby-2.3.0/no_sendfile.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/configure b/configure -index ebe3d8c..a336b73 100755 ---- a/configure -+++ b/configure -@@ -18943,7 +18943,6 @@ do : - ac_fn_c_check_func "$LINENO" "sendfile" "ac_cv_func_sendfile" - if test "x$ac_cv_func_sendfile" = xyes; then : - cat >>confdefs.h <<_ACEOF --#define HAVE_SENDFILE 1 - _ACEOF - - fi diff --git a/third_party/rake-compiler-dock/build/patches/ruby-2.4.0/no_sendfile.patch b/third_party/rake-compiler-dock/build/patches/ruby-2.4.0/no_sendfile.patch deleted file mode 100644 index 915fc7b790..0000000000 --- a/third_party/rake-compiler-dock/build/patches/ruby-2.4.0/no_sendfile.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/configure b/configure -index ebe3d8c..a336b73 100755 ---- a/configure -+++ b/configure -@@ -18943,7 +18943,6 @@ do : - ac_fn_c_check_func "$LINENO" "sendfile" "ac_cv_func_sendfile" - if test "x$ac_cv_func_sendfile" = xyes; then : - cat >>confdefs.h <<_ACEOF --#define HAVE_SENDFILE 1 - _ACEOF - - fi diff --git a/third_party/rake-compiler-dock/build/runas b/third_party/rake-compiler-dock/build/runas deleted file mode 100755 index b29ce31fcc..0000000000 --- a/third_party/rake-compiler-dock/build/runas +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -groupadd -g "$GID" "$GROUP" -mkdir -p /tmp/home -useradd -g "$GID" -u "$UID" -G rvm,sudo -p "" -b /tmp/home -m "$USER" - -HOME=$(bash <<< "echo ~$USER") -ln -s /usr/local/rake-compiler "$HOME"/.rake-compiler - -sudo -u "$USER" --set-home \ - BASH_ENV=/etc/rubybashrc \ - -- "$@" diff --git a/third_party/rake-compiler-dock/build/sigfw.c b/third_party/rake-compiler-dock/build/sigfw.c deleted file mode 100644 index 291d76cec8..0000000000 --- a/third_party/rake-compiler-dock/build/sigfw.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This program handles SIGINT and forwards it to another process. - * It is intended to be run as PID 1. - * - * Docker starts processes with "docker run" as PID 1. - * On Linux, the default signal handler for PID 1 ignores any signals. - * Therefore Ctrl-C aka SIGINT is ignored per default. - */ - -#include <signal.h> -#include <sys/types.h> -#include <sys/wait.h> - -int pid = 0; - -void -handle_sigint (int signum) -{ - if(pid) - kill(pid, SIGINT); -} - -int main(int argc, char *argv[]){ - struct sigaction new_action; - int status = -1; - - /* Set up the structure to specify the new action. */ - new_action.sa_handler = handle_sigint; - sigemptyset (&new_action.sa_mask); - new_action.sa_flags = 0; - - sigaction (SIGINT, &new_action, (void*)0); - - pid = fork(); - if(pid){ - wait(&status); - return WEXITSTATUS(status); - }else{ - status = execvp(argv[1], &argv[1]); - perror("exec"); - return status; - } -} diff --git a/third_party/rake-compiler-dock/build/strip_wrapper b/third_party/rake-compiler-dock/build/strip_wrapper deleted file mode 100755 index 7f8a1346a1..0000000000 --- a/third_party/rake-compiler-dock/build/strip_wrapper +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env ruby - -# Strip file on local folder instead of a Virtualbox shared folder -# to work around this bug: https://www.virtualbox.org/ticket/8463 - -require 'tempfile' -require 'fileutils' - -strip = "#{File.basename($0)}.bin" - -files = ARGV.reject{|f| f=~/^-/ }.map do |arg| - tmp = Tempfile.new 'strip' - tmp.close - FileUtils.cp arg, tmp.path - [tmp, arg] -end - -options = ARGV.select{|f| f=~/^-/ } + files.map{|t,o| t.path } - -unless system( strip, *options ) - exit 127 -end -code = $?.exitstatus - -files.each do |tmp, orig| - FileUtils.rm orig - FileUtils.cp tmp.path, orig -end - -exit code diff --git a/third_party/rake-compiler-dock/build/sudoers b/third_party/rake-compiler-dock/build/sudoers deleted file mode 100644 index f9f9b97c95..0000000000 --- a/third_party/rake-compiler-dock/build/sudoers +++ /dev/null @@ -1 +0,0 @@ -Defaults env_keep += "http_proxy https_proxy ftp_proxy RCD_HOST_RUBY_PLATFORM RCD_HOST_RUBY_VERSION RCD_IMAGE RUBY_CC_VERSION" |