rake-compiler-dock 0.7.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +4 -0
- data/Dockerfile.jruby +9 -5
- data/{Dockerfile.mri → Dockerfile.mri.erb} +81 -23
- data/History.md +23 -0
- data/README.md +62 -10
- data/Rakefile +36 -4
- data/{lib/rake_compiler_dock → build}/gem_helper.rb +0 -15
- data/build/parallel_docker_build.rb +102 -0
- data/build/patches/{ruby-2.5.3 → ruby-2.5.7}/no_sendfile.patch +1 -1
- data/build/patches/ruby-2.7.0/no_sendfile.patch +24 -0
- data/build/patches2/hoe-3.20.0/0001-Load-encrypted-private-key-using-ENV-GEM_PRIVATE_KEY.patch +32 -0
- data/build/patches2/rake-compiler-1.1.0/0001-Allow-parallel-builds-of-cross-rubies.patch +119 -0
- data/build/patches2/rake-compiler-1.1.0/0001-Enable-build-of-static-libruby.patch +28 -0
- data/build/patches2/rake-compiler-1.1.0/0001-Fix-determining-of-ruby-versions-in-rake-native-gem.patch +44 -0
- data/build/patches2/rake-compiler-1.1.0/0002-Extend-mingw-search-pattern-to-find-x86_64-gcc.patch +26 -0
- data/build/patches2/rake-compiler-1.1.0/0002-Strip-cross-built-shared-library-files-while-linking.patch +29 -0
- data/build/patches2/ruby-2.7.0/ruby2_keywords.patch +15 -0
- data/build/runas +2 -0
- data/build/sudoers +1 -1
- data/lib/rake_compiler_dock.rb +10 -0
- data/lib/rake_compiler_dock/docker_check.rb +12 -6
- data/lib/rake_compiler_dock/starter.rb +68 -53
- data/lib/rake_compiler_dock/version.rb +2 -2
- data/test/test_environment_variables.rb +2 -2
- data/test/test_parallel_docker_build.rb +57 -0
- metadata +39 -8
- metadata.gz.sig +2 -0
- data/build/patches/rake-compiler-1.0.7/enable-static.diff +0 -13
@@ -1,18 +1,3 @@
|
|
1
|
-
# This file is part of Libusb for Ruby.
|
2
|
-
#
|
3
|
-
# Libusb for Ruby is free software: you can redistribute it and/or modify
|
4
|
-
# it under the terms of the GNU Lesser General Public License as published by
|
5
|
-
# the Free Software Foundation, either version 3 of the License, or
|
6
|
-
# (at your option) any later version.
|
7
|
-
#
|
8
|
-
# Libusb for Ruby is distributed in the hope that it will be useful,
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU Lesser General Public License for more details.
|
12
|
-
#
|
13
|
-
# You should have received a copy of the GNU Lesser General Public License
|
14
|
-
# along with Libusb for Ruby. If not, see <http://www.gnu.org/licenses/>.
|
15
|
-
|
16
1
|
require "bundler/gem_helper"
|
17
2
|
|
18
3
|
module RakeCompilerDock
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require "fileutils"
|
2
|
+
require "rake"
|
3
|
+
|
4
|
+
module RakeCompilerDock
|
5
|
+
# Run docker builds in parallel, but ensure that common docker layers are reused
|
6
|
+
class ParallelDockerBuild
|
7
|
+
include Rake::DSL
|
8
|
+
|
9
|
+
def initialize(dockerfiles, workdir: "tmp/docker", inputdir: ".", task_prefix: "common-")
|
10
|
+
FileUtils.mkdir_p(workdir)
|
11
|
+
|
12
|
+
files = parse_dockerfiles(dockerfiles, inputdir)
|
13
|
+
# pp files
|
14
|
+
|
15
|
+
vcs = find_commons(files)
|
16
|
+
# pp vcs
|
17
|
+
|
18
|
+
define_common_tasks(vcs, workdir, task_prefix)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Read given dockerfiles from inputdir and split into a list of commands.
|
22
|
+
#
|
23
|
+
# Returns:
|
24
|
+
# {"File0"=>[" FROM a\n", " RUN a\n", " RUN d\n"],
|
25
|
+
# "File1"=>[" FROM a\n",
|
26
|
+
# ...
|
27
|
+
def parse_dockerfiles(dockerfiles, inputdir)
|
28
|
+
files = dockerfiles.map do |fn|
|
29
|
+
[fn, File.read(File.join(inputdir, fn))]
|
30
|
+
end.map do |fn, f|
|
31
|
+
# Split file contant in lines unless line ends with backslash
|
32
|
+
fc = f.each_line.with_object([]) do |line, lines|
|
33
|
+
if lines.last=~/\\\n\z/
|
34
|
+
lines.last << line
|
35
|
+
else
|
36
|
+
lines << line
|
37
|
+
end
|
38
|
+
end
|
39
|
+
[fn, fc]
|
40
|
+
end.to_h
|
41
|
+
end
|
42
|
+
|
43
|
+
# Build a tree of common parts of given files.
|
44
|
+
#
|
45
|
+
# Returns:
|
46
|
+
# {["File0", "File1", "File2", "File3"]=>
|
47
|
+
# [[" FROM a\n"],
|
48
|
+
# {["File0", "File1"]=>
|
49
|
+
# [[" RUN a\n", " RUN d\n"], {["File1"]=>[[" RUN f\n"], {}]}],
|
50
|
+
# ["File2", "File3"]=>[[" RUN b\n", " RUN c\n", " RUN d\n"], {}]}]}
|
51
|
+
def find_commons(files, vmask=nil, li=0)
|
52
|
+
vmask ||= files.keys
|
53
|
+
vcs = Hash.new { [] }
|
54
|
+
files.each do |fn, lines|
|
55
|
+
next unless vmask.include?(fn)
|
56
|
+
vcs[lines[li]] += [fn]
|
57
|
+
end
|
58
|
+
|
59
|
+
vcs.map do |line, vc|
|
60
|
+
next unless line
|
61
|
+
nvcs = find_commons(files, vc, li+1)
|
62
|
+
if nvcs.first && nvcs.first[0] == vc
|
63
|
+
# Append lines that are equal between file(s)
|
64
|
+
nl = [[line] + nvcs.first[1][0], nvcs.first[1][1]]
|
65
|
+
else
|
66
|
+
nl = [[line], nvcs]
|
67
|
+
end
|
68
|
+
[vc, nl]
|
69
|
+
end.compact.to_h
|
70
|
+
end
|
71
|
+
|
72
|
+
# Write intermediate dockerfiles to workdir and define rake tasks
|
73
|
+
#
|
74
|
+
# The rake tasks are named after the dockerfiles given to #new .
|
75
|
+
# This also adds dependant intermediate tasks as prerequisites.
|
76
|
+
def define_common_tasks(vcs, workdir, task_prefix, plines=[])
|
77
|
+
vcs.map do |files, (lines, nvcs)|
|
78
|
+
fn = "#{task_prefix}#{files.join}"
|
79
|
+
File.write(File.join(workdir, fn), (plines + lines).join)
|
80
|
+
task fn do
|
81
|
+
docker_build(fn, workdir)
|
82
|
+
end
|
83
|
+
|
84
|
+
nfn = define_common_tasks(nvcs, workdir, task_prefix, plines + lines)
|
85
|
+
nfn.each do |file|
|
86
|
+
task file => fn
|
87
|
+
end
|
88
|
+
files.each do |file|
|
89
|
+
task file => fn
|
90
|
+
end
|
91
|
+
fn
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Run an intermediate dockerfile without tag
|
96
|
+
#
|
97
|
+
# The layers will be reused in subsequent builds, even if they run in parallel.
|
98
|
+
def docker_build(filename, workdir)
|
99
|
+
sh "docker", "build", "-f", File.join(workdir, filename), "."
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -17,7 +17,7 @@ index 82c5940538..a8d3661ec8 100644
|
|
17
17
|
@@ -10721,7 +10721,6 @@ nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
|
18
18
|
}
|
19
19
|
|
20
|
-
#if defined __linux__ && defined __NR_copy_file_range
|
20
|
+
#if defined HAVE_COPY_FILE_RANGE || (defined __linux__ && defined __NR_copy_file_range)
|
21
21
|
-# define USE_COPY_FILE_RANGE
|
22
22
|
#endif
|
23
23
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
diff --git a/configure b/configure
|
2
|
+
index ebe3d8c..a336b73 100755
|
3
|
+
--- a/configure
|
4
|
+
+++ b/configure
|
5
|
+
@@ -18943,7 +18943,6 @@ do :
|
6
|
+
ac_fn_c_check_func "$LINENO" "sendfile" "ac_cv_func_sendfile"
|
7
|
+
if test "x$ac_cv_func_sendfile" = xyes; then :
|
8
|
+
cat >>confdefs.h <<_ACEOF
|
9
|
+
-#define HAVE_SENDFILE 1
|
10
|
+
_ACEOF
|
11
|
+
|
12
|
+
fi
|
13
|
+
diff --git a/io.c b/io.c
|
14
|
+
index 82c5940538..a8d3661ec8 100644
|
15
|
+
--- a/io.c
|
16
|
+
+++ b/io.c
|
17
|
+
@@ -10721,7 +10721,6 @@ nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
|
18
|
+
}
|
19
|
+
|
20
|
+
#if defined HAVE_COPY_FILE_RANGE || (defined __linux__ && defined __NR_copy_file_range)
|
21
|
+
-# define USE_COPY_FILE_RANGE
|
22
|
+
#endif
|
23
|
+
|
24
|
+
#ifdef USE_COPY_FILE_RANGE
|
data/build/patches2/hoe-3.20.0/0001-Load-encrypted-private-key-using-ENV-GEM_PRIVATE_KEY.patch
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
From ecc5669223457ceaba6bd94c2947ae99ddfa8f10 Mon Sep 17 00:00:00 2001
|
2
|
+
From: Lars Kanis <lars@greiz-reinsdorf.de>
|
3
|
+
Date: Fri, 27 Dec 2019 15:57:07 +0100
|
4
|
+
Subject: [PATCH] Load encrypted private key using
|
5
|
+
ENV['GEM_PRIVATE_KEY_PASSPHRASE'] as passphrase.
|
6
|
+
|
7
|
+
This way the password can be avoided to be entered several times when building multiple gems.
|
8
|
+
It also allows parallel builds which are incompatible to interactive password prompts.
|
9
|
+
|
10
|
+
The same feature has been implemented in rubygems:
|
11
|
+
https://github.com/rubygems/rubygems/commit/c1a114396fcec124d3feabf74708b4bdec02eac3
|
12
|
+
---
|
13
|
+
lib/hoe/signing.rb | 3 ++-
|
14
|
+
1 file changed, 2 insertions(+), 1 deletion(-)
|
15
|
+
|
16
|
+
diff --git a/lib/hoe/signing.rb b/lib/hoe/signing.rb
|
17
|
+
index 4833c55..11c8c2f 100644
|
18
|
+
--- a/lib/hoe/signing.rb
|
19
|
+
+++ b/lib/hoe/signing.rb
|
20
|
+
@@ -70,7 +70,8 @@ module Hoe::Signing
|
21
|
+
end
|
22
|
+
|
23
|
+
if signing_key and cert_chain then
|
24
|
+
- spec.signing_key = OpenSSL::PKey::RSA.new File.read signing_key
|
25
|
+
+ passphrase = ENV['GEM_PRIVATE_KEY_PASSPHRASE']
|
26
|
+
+ spec.signing_key = OpenSSL::PKey::RSA.new(File.read(signing_key), passphrase)
|
27
|
+
spec.cert_chain = cert_chain
|
28
|
+
end
|
29
|
+
end
|
30
|
+
--
|
31
|
+
2.20.1
|
32
|
+
|
@@ -0,0 +1,119 @@
|
|
1
|
+
From e0be66410b32a41591d27c34e2163ed587ae427b Mon Sep 17 00:00:00 2001
|
2
|
+
From: Lars Kanis <lars@greiz-reinsdorf.de>
|
3
|
+
Date: Sun, 22 Dec 2019 21:37:07 +0100
|
4
|
+
Subject: [PATCH] Allow parallel builds of cross rubies
|
5
|
+
|
6
|
+
Download and extraction of sources can not run in parallel, since the sources are used for multiple targets.
|
7
|
+
Therefore this part can now be separately executed by
|
8
|
+
rake-compiler prepare-sources RUBY_CC_VERSION=...
|
9
|
+
|
10
|
+
Afterwards multiple cross rubies can be built in parallel by
|
11
|
+
rake-compiler cross-ruby RUBY_CC_VERSION=... HOST=...
|
12
|
+
|
13
|
+
Access to config.yml must be synchronized, when running in parallel, which is done per File#flock .
|
14
|
+
---
|
15
|
+
lib/rake/extensiontask.rb | 5 +++-
|
16
|
+
tasks/bin/cross-ruby.rake | 56 +++++++++++++++++++++------------------
|
17
|
+
2 files changed, 34 insertions(+), 27 deletions(-)
|
18
|
+
|
19
|
+
diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb
|
20
|
+
index d85b1a3..89f2198 100644
|
21
|
+
--- a/lib/rake/extensiontask.rb
|
22
|
+
+++ b/lib/rake/extensiontask.rb
|
23
|
+
@@ -376,7 +376,10 @@ Java extension should be preferred.
|
24
|
+
return
|
25
|
+
end
|
26
|
+
|
27
|
+
- config_file = YAML.load_file(config_path)
|
28
|
+
+ config_file = File.open(config_path) do |fd|
|
29
|
+
+ fd.flock(File::LOCK_SH)
|
30
|
+
+ YAML.load(fd.read)
|
31
|
+
+ end
|
32
|
+
|
33
|
+
# tmp_path
|
34
|
+
tmp_path = "#{@tmp_dir}/#{for_platform}/#{@name}/#{ruby_ver}"
|
35
|
+
diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
|
36
|
+
index 37dd220..3fcfe1d 100644
|
37
|
+
--- a/tasks/bin/cross-ruby.rake
|
38
|
+
+++ b/tasks/bin/cross-ruby.rake
|
39
|
+
@@ -126,6 +126,8 @@ file makefile_in => [makefile_in_bak] do |t|
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
+task "prepare-sources" => makefile_in
|
44
|
+
+
|
45
|
+
task :mingw32 do
|
46
|
+
unless MINGW_HOST then
|
47
|
+
warn "You need to install mingw32 cross compile functionality to be able to continue."
|
48
|
+
@@ -174,40 +176,42 @@ task :install => ["#{USER_HOME}/ruby/#{MINGW_HOST}/#{RUBY_CC_VERSION}/bin/ruby.e
|
49
|
+
desc "Update rake-compiler list of installed Ruby versions"
|
50
|
+
task 'update-config' do
|
51
|
+
config_file = "#{USER_HOME}/config.yml"
|
52
|
+
- if File.exist?(config_file) then
|
53
|
+
- puts "Updating #{config_file}"
|
54
|
+
- config = YAML.load_file(config_file)
|
55
|
+
- else
|
56
|
+
- puts "Generating #{config_file}"
|
57
|
+
- config = {}
|
58
|
+
- end
|
59
|
+
+ File.open(config_file, File::RDWR|File::CREAT) do |config_fd|
|
60
|
+
+ config_fd.flock(File::LOCK_EX)
|
61
|
+
+ config = YAML.load(config_fd.read)
|
62
|
+
+ if config
|
63
|
+
+ puts "Updating #{config_file}"
|
64
|
+
+ else
|
65
|
+
+ puts "Generating #{config_file}"
|
66
|
+
+ config = {}
|
67
|
+
+ end
|
68
|
+
|
69
|
+
- files = Dir.glob("#{USER_HOME}/ruby/*/*/**/rbconfig.rb").sort
|
70
|
+
+ files = Dir.glob("#{USER_HOME}/ruby/*/*/**/rbconfig.rb").sort
|
71
|
+
|
72
|
+
- files.each do |rbconfig|
|
73
|
+
- version, platform = rbconfig.match(/.*-(\d.\d.\d).*\/([-\w]+)\/rbconfig/)[1,2]
|
74
|
+
- platforms = [platform]
|
75
|
+
+ files.each do |rbconfig|
|
76
|
+
+ version, platform = rbconfig.match(/.*-(\d.\d.\d).*\/([-\w]+)\/rbconfig/)[1,2]
|
77
|
+
+ platforms = [platform]
|
78
|
+
|
79
|
+
- # fake alternate (binary compatible) i386-mswin32-60 platform
|
80
|
+
- platform == "i386-mingw32" and
|
81
|
+
- platforms.push "i386-mswin32-60"
|
82
|
+
+ # fake alternate (binary compatible) i386-mswin32-60 platform
|
83
|
+
+ platform == "i386-mingw32" and
|
84
|
+
+ platforms.push "i386-mswin32-60"
|
85
|
+
|
86
|
+
- platforms.each do |plat|
|
87
|
+
- config["rbconfig-#{plat}-#{version}"] = rbconfig
|
88
|
+
+ platforms.each do |plat|
|
89
|
+
+ config["rbconfig-#{plat}-#{version}"] = rbconfig
|
90
|
+
|
91
|
+
- # also store RubyGems-compatible version
|
92
|
+
- gem_platform = Gem::Platform.new(plat)
|
93
|
+
- config["rbconfig-#{gem_platform}-#{version}"] = rbconfig
|
94
|
+
+ # also store RubyGems-compatible version
|
95
|
+
+ gem_platform = Gem::Platform.new(plat)
|
96
|
+
+ config["rbconfig-#{gem_platform}-#{version}"] = rbconfig
|
97
|
+
+ end
|
98
|
+
+
|
99
|
+
+ puts "Found Ruby version #{version} for platform #{platform} (#{rbconfig})"
|
100
|
+
end
|
101
|
+
|
102
|
+
- puts "Found Ruby version #{version} for platform #{platform} (#{rbconfig})"
|
103
|
+
+ when_writing("Saving changes into #{config_file}") {
|
104
|
+
+ config_fd.rewind
|
105
|
+
+ config_fd.puts config.to_yaml
|
106
|
+
+ }
|
107
|
+
end
|
108
|
+
-
|
109
|
+
- when_writing("Saving changes into #{config_file}") {
|
110
|
+
- File.open(config_file, 'w') do |f|
|
111
|
+
- f.puts config.to_yaml
|
112
|
+
- end
|
113
|
+
- }
|
114
|
+
end
|
115
|
+
|
116
|
+
task :default do
|
117
|
+
--
|
118
|
+
2.20.1
|
119
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
From 0b929b7027eb592c0971a400184f1dfa5a0bce7c Mon Sep 17 00:00:00 2001
|
2
|
+
From: Lars Kanis <lars@greiz-reinsdorf.de>
|
3
|
+
Date: Thu, 26 Dec 2019 19:13:48 +0100
|
4
|
+
Subject: [PATCH 1/2] Enable build of static libruby
|
5
|
+
|
6
|
+
This is used in rake-compiler-dock for linux targets.
|
7
|
+
The static libruby is postprocessed in a special way.
|
8
|
+
See rake-compiler-dock's Dockerfile.
|
9
|
+
---
|
10
|
+
tasks/bin/cross-ruby.rake | 2 ++
|
11
|
+
1 file changed, 2 insertions(+)
|
12
|
+
|
13
|
+
diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
|
14
|
+
index c9b0bbb..2a73be7 100644
|
15
|
+
--- a/tasks/bin/cross-ruby.rake
|
16
|
+
+++ b/tasks/bin/cross-ruby.rake
|
17
|
+
@@ -108,6 +108,8 @@ end
|
18
|
+
file "#{build_dir}/Makefile" => [build_dir, makefile_in] do |t|
|
19
|
+
|
20
|
+
options = [
|
21
|
+
+ '--enable-static',
|
22
|
+
+ '--enable-install-static-library',
|
23
|
+
"--host=#{MINGW_HOST}",
|
24
|
+
"--target=#{MINGW_TARGET}",
|
25
|
+
"--build=#{RUBY_BUILD}",
|
26
|
+
--
|
27
|
+
2.20.1
|
28
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
From 365843bfe0bfc3f1c1b11e81e24ac7b6c7942bdf Mon Sep 17 00:00:00 2001
|
2
|
+
From: Lars Kanis <lars@greiz-reinsdorf.de>
|
3
|
+
Date: Fri, 27 Dec 2019 18:18:59 +0100
|
4
|
+
Subject: [PATCH] Fix determining of ruby versions in "rake native gem"
|
5
|
+
|
6
|
+
"rake native gem" without "cross" didn't set the ruby version constraint.
|
7
|
+
Instead it failed with NoMethodError like so:
|
8
|
+
|
9
|
+
/ffi $ rake native gem
|
10
|
+
no configuration section for specified version of Ruby (rbconfig-i386-mingw32-2.6.3)
|
11
|
+
no configuration section for specified version of Ruby (rbconfig-x64-mingw32-2.6.3)
|
12
|
+
install -c build/x86_64-linux/ffi_c/2.6.3/ffi_c.so lib/ffi_c.so
|
13
|
+
cp build/x86_64-linux/ffi_c/2.6.3/ffi_c.so build/x86_64-linux/stage/lib/ffi_c.so
|
14
|
+
rake aborted!
|
15
|
+
NoMethodError: undefined method `split' for nil:NilClass
|
16
|
+
/home/lars/.rvm/gems/ruby-2.6.3/gems/rake-compiler-1.0.9/lib/rake/extensiontask.rb:515:in `ruby_api_version'
|
17
|
+
/home/lars/.rvm/gems/ruby-2.6.3/gems/rake-compiler-1.0.9/lib/rake/extensiontask.rb:262:in `block in define_native_tasks'
|
18
|
+
/home/lars/.rvm/gems/ruby-2.6.3/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
|
19
|
+
/home/lars/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
|
20
|
+
/home/lars/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
|
21
|
+
Tasks: TOP => native => native:x86_64-linux => native:ffi:x86_64-linux
|
22
|
+
(See full trace by running task with --trace)
|
23
|
+
---
|
24
|
+
lib/rake/extensiontask.rb | 4 ++++
|
25
|
+
1 file changed, 4 insertions(+)
|
26
|
+
|
27
|
+
diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb
|
28
|
+
index d85b1a3..cb1ea12 100644
|
29
|
+
--- a/lib/rake/extensiontask.rb
|
30
|
+
+++ b/lib/rake/extensiontask.rb
|
31
|
+
@@ -242,6 +242,10 @@ Java extension should be preferred.
|
32
|
+
# lib_path
|
33
|
+
lib_path = lib_dir
|
34
|
+
|
35
|
+
+ # Update compiled platform/version combinations
|
36
|
+
+ ruby_versions = (@ruby_versions_per_platform[platf] ||= [])
|
37
|
+
+ ruby_versions << ruby_ver
|
38
|
+
+
|
39
|
+
# create 'native:gem_name' and chain it to 'native' task
|
40
|
+
unless Rake::Task.task_defined?("native:#{@gem_spec.name}:#{platf}")
|
41
|
+
task "native:#{@gem_spec.name}:#{platf}" do |t|
|
42
|
+
--
|
43
|
+
2.20.1
|
44
|
+
|
data/build/patches2/rake-compiler-1.1.0/0002-Extend-mingw-search-pattern-to-find-x86_64-gcc.patch
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
From 07b1a4909fa59324d309bb8a46867cacba97cafd Mon Sep 17 00:00:00 2001
|
2
|
+
From: Lars Kanis <lars@greiz-reinsdorf.de>
|
3
|
+
Date: Thu, 26 Dec 2019 18:31:25 +0100
|
4
|
+
Subject: [PATCH] Extend mingw search pattern to find x86_64 gcc
|
5
|
+
|
6
|
+
The previous pattern only recognized 32 bit compiler versions.
|
7
|
+
---
|
8
|
+
lib/rake/extensioncompiler.rb | 2 +-
|
9
|
+
1 file changed, 1 insertion(+), 1 deletion(-)
|
10
|
+
|
11
|
+
diff --git a/lib/rake/extensioncompiler.rb b/lib/rake/extensioncompiler.rb
|
12
|
+
index b3d336b..75f4694 100644
|
13
|
+
--- a/lib/rake/extensioncompiler.rb
|
14
|
+
+++ b/lib/rake/extensioncompiler.rb
|
15
|
+
@@ -37,7 +37,7 @@ module Rake
|
16
|
+
paths = ENV['PATH'].split(File::PATH_SEPARATOR)
|
17
|
+
|
18
|
+
# the pattern to look into (captures *nix and windows executables)
|
19
|
+
- pattern = "{mingw32-,i?86*mingw*}gcc{,.*}"
|
20
|
+
+ pattern = "{mingw32-,i?86*mingw*,x86*mingw*}gcc{,.*}"
|
21
|
+
|
22
|
+
@mingw_gcc_executable = paths.find do |path|
|
23
|
+
# cleanup paths before globbing
|
24
|
+
--
|
25
|
+
2.20.1
|
26
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
From 13e33405d4e51a52402e1e37e7e2df7f1f32892d Mon Sep 17 00:00:00 2001
|
2
|
+
From: Lars Kanis <lars@greiz-reinsdorf.de>
|
3
|
+
Date: Thu, 26 Dec 2019 19:18:02 +0100
|
4
|
+
Subject: [PATCH 2/2] Strip cross built shared library files while linking
|
5
|
+
|
6
|
+
The .so files of extensions are often stripped after compilation per task in a Rakefile.
|
7
|
+
However this can be omitted, if the cross ruby version is built with stripping enabled.
|
8
|
+
Stripping the files a second time doesn't make a difference then.
|
9
|
+
---
|
10
|
+
tasks/bin/cross-ruby.rake | 3 ++-
|
11
|
+
1 file changed, 2 insertions(+), 1 deletion(-)
|
12
|
+
|
13
|
+
diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
|
14
|
+
index 2a73be7..a9eb16b 100644
|
15
|
+
--- a/tasks/bin/cross-ruby.rake
|
16
|
+
+++ b/tasks/bin/cross-ruby.rake
|
17
|
+
@@ -115,7 +115,8 @@ file "#{build_dir}/Makefile" => [build_dir, source_dir] do |t|
|
18
|
+
"--build=#{RUBY_BUILD}",
|
19
|
+
'--enable-shared',
|
20
|
+
'--disable-install-doc',
|
21
|
+
- '--with-ext='
|
22
|
+
+ '--with-ext=',
|
23
|
+
+ 'LDFLAGS=-pipe -s',
|
24
|
+
]
|
25
|
+
|
26
|
+
# Force Winsock2 for Ruby 1.8, 1.9 defaults to it
|
27
|
+
--
|
28
|
+
2.20.1
|
29
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
diff --git a/template/fake.rb.in b/template/fake.rb.in
|
2
|
+
index f1da719ecb..e0b649fb28 100644
|
3
|
+
--- a/template/fake.rb.in
|
4
|
+
+++ b/template/fake.rb.in
|
5
|
+
@@ -27,6 +27,10 @@ case "$0" in /*) r=-r"$0";; *) r=-r"./$0";; esac
|
6
|
+
exec $ruby "$r" "$@"
|
7
|
+
=end
|
8
|
+
=baseruby
|
9
|
+
+<% if RUBY_VERSION < "2.7" %>
|
10
|
+
+def ruby2_keywords(*)
|
11
|
+
+end
|
12
|
+
+<% end %>
|
13
|
+
class Object
|
14
|
+
remove_const :CROSS_COMPILING if defined?(CROSS_COMPILING)
|
15
|
+
CROSS_COMPILING = RUBY_PLATFORM
|