rake-compiler-dock 0.7.0 → 1.1.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 +12 -8
- data/Dockerfile.mri.erb +231 -0
- data/History.md +56 -0
- data/README.md +86 -15
- data/Rakefile +44 -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.8}/no_sendfile.patch +1 -1
- data/build/patches/ruby-3.0.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.1/0001-Fix-determining-of-ruby-versions-in-rake-native-gem.patch +44 -0
- data/build/patches2/rake-compiler-1.1.1/0003-Allow-building-of-cross-rubies-in-parallel.patch +214 -0
- data/build/patches2/rake-compiler-1.1.1/0004-Enable-build-of-static-libruby.patch +29 -0
- data/build/patches2/rake-compiler-1.1.1/0005-Don-t-mask-out-build-env-vars-for-cross-ruby.patch +30 -0
- data/build/patches2/rake-compiler-1.1.1/0006-Use-RAKE_EXTENSION_TASK_NO_NATIVE-env-var-as-the-def.patch +26 -0
- data/build/patches2/ruby-2.7.0/ruby2_keywords.patch +15 -0
- data/build/patches2/ruby-3.0.0/ruby2_keywords.patch +15 -0
- data/build/runas +4 -1
- 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 +35 -25
- metadata.gz.sig +0 -0
- data/Dockerfile.mri +0 -122
- data/build/patches/rake-compiler-1.0.6/enable-static.diff +0 -13
@@ -0,0 +1,29 @@
|
|
1
|
+
diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
|
2
|
+
index 8edf5cd..5d25b82 100644
|
3
|
+
--- a/tasks/bin/cross-ruby.rake
|
4
|
+
+++ b/tasks/bin/cross-ruby.rake
|
5
|
+
@@ -116,11 +116,22 @@ RUBY_CC_VERSIONS.split(":").each do |ruby_cc_version|
|
6
|
+
"--host=#{mingw_host}",
|
7
|
+
"--target=#{mingw_target}",
|
8
|
+
"--build=#{RUBY_BUILD}",
|
9
|
+
- '--enable-shared',
|
10
|
+
+ '--enable-install-static-library',
|
11
|
+
+ '--disable-jit-support',
|
12
|
+
'--disable-install-doc',
|
13
|
+
'--with-ext=',
|
14
|
+
- 'LDFLAGS=-pipe -s',
|
15
|
+
]
|
16
|
+
+ if mingw_host=~/darwin/
|
17
|
+
+ options += [
|
18
|
+
+ '--enable-static',
|
19
|
+
+ '--disable-shared',
|
20
|
+
+ ]
|
21
|
+
+ else
|
22
|
+
+ options += [
|
23
|
+
+ '--enable-static',
|
24
|
+
+ '--enable-shared',
|
25
|
+
+ ]
|
26
|
+
+ end
|
27
|
+
|
28
|
+
# Force Winsock2 for Ruby 1.8, 1.9 defaults to it
|
29
|
+
options << "--with-winsock2" if major == "1.8"
|
data/build/patches2/rake-compiler-1.1.1/0005-Don-t-mask-out-build-env-vars-for-cross-ruby.patch
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
From 783d3d380e6abf107e0747d229da0f5e001c623f Mon Sep 17 00:00:00 2001
|
2
|
+
From: Lars Kanis <lars@greiz-reinsdorf.de>
|
3
|
+
Date: Sun, 20 Dec 2020 19:08:22 +0100
|
4
|
+
Subject: [PATCH] Don't mask out build env vars for cross-ruby
|
5
|
+
|
6
|
+
This was introduced in commit a7c113e580c1565000166f9967da82ff2ecdaeaa to avoid interference with host build.
|
7
|
+
However it prohibits setting important flags for cross-build.
|
8
|
+
|
9
|
+
Also don't force 'LDFLAGS=-pipe -s' in configure, which doesn't work with clang targeting MacOS.
|
10
|
+
It can now be set externally.
|
11
|
+
---
|
12
|
+
tasks/bin/cross-ruby.rake | 3 +--
|
13
|
+
1 file changed, 1 insertion(+), 2 deletions(-)
|
14
|
+
|
15
|
+
diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
|
16
|
+
index 8edf5cd..8317a2a 100644
|
17
|
+
--- a/tasks/bin/cross-ruby.rake
|
18
|
+
+++ b/tasks/bin/cross-ruby.rake
|
19
|
+
@@ -46,7 +46,7 @@ RUBY_SOURCE = ENV['SOURCE']
|
20
|
+
RUBY_BUILD = RbConfig::CONFIG["host"]
|
21
|
+
|
22
|
+
# Unset any possible variable that might affect compilation
|
23
|
+
-["CC", "CXX", "CPPFLAGS", "LDFLAGS", "RUBYOPT"].each do |var|
|
24
|
+
+["RUBYOPT"].each do |var|
|
25
|
+
ENV.delete(var)
|
26
|
+
end
|
27
|
+
|
28
|
+
--
|
29
|
+
2.27.0
|
30
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
From 15f630adc4325f9cafb762e15a051c2ec8bd21e2 Mon Sep 17 00:00:00 2001
|
2
|
+
From: Sutou Kouhei <kou@clear-code.com>
|
3
|
+
Date: Mon, 21 Dec 2020 04:30:44 +0900
|
4
|
+
Subject: [PATCH] Use RAKE_EXTENSION_TASK_NO_NATIVE env var as the default
|
5
|
+
value
|
6
|
+
|
7
|
+
---
|
8
|
+
lib/rake/extensiontask.rb | 2 +-
|
9
|
+
1 file changed, 1 insertion(+), 1 deletion(-)
|
10
|
+
|
11
|
+
diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb
|
12
|
+
index b0ab88e..49d59da 100644
|
13
|
+
--- a/lib/rake/extensiontask.rb
|
14
|
+
+++ b/lib/rake/extensiontask.rb
|
15
|
+
@@ -23,7 +23,7 @@ module Rake
|
16
|
+
@cross_compile = false
|
17
|
+
@cross_config_options = []
|
18
|
+
@cross_compiling = nil
|
19
|
+
- @no_native = false
|
20
|
+
+ @no_native = (ENV["RAKE_EXTENSION_TASK_NO_NATIVE"] == "true")
|
21
|
+
@config_includes = []
|
22
|
+
@ruby_versions_per_platform = {}
|
23
|
+
@make = nil
|
24
|
+
--
|
25
|
+
2.27.0
|
26
|
+
|
@@ -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
|
@@ -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
|
data/build/runas
CHANGED
@@ -6,7 +6,10 @@ useradd -o -g "$GID" -u "$UID" -G rvm,sudo -p "" -b /tmp/home -m "$USER"
|
|
6
6
|
|
7
7
|
HOME=$(bash <<< "echo ~$USER")
|
8
8
|
ln -s /usr/local/rake-compiler "$HOME"/.rake-compiler
|
9
|
+
mkdir -p "$HOME"/.gem
|
10
|
+
chown "$USER" "$HOME"/.gem
|
9
11
|
|
10
|
-
sudo -u "$USER"
|
12
|
+
/usr/bin/sudo -u "$USER" -H \
|
11
13
|
BASH_ENV=/etc/rubybashrc \
|
14
|
+
RAKE_EXTENSION_TASK_NO_NATIVE=true \
|
12
15
|
-- "$@"
|
data/build/sudoers
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Defaults env_keep += "http_proxy https_proxy ftp_proxy RCD_HOST_RUBY_PLATFORM RCD_HOST_RUBY_VERSION RCD_IMAGE RUBY_CC_VERSION"
|
1
|
+
Defaults env_keep += "http_proxy https_proxy ftp_proxy GEM_PRIVATE_KEY_PASSPHRASE RCD_HOST_RUBY_PLATFORM RCD_HOST_RUBY_VERSION RCD_IMAGE RUBY_CC_VERSION LD_LIBRARY_PATH DEVTOOLSET_ROOTPATH"
|
data/lib/rake_compiler_dock.rb
CHANGED
@@ -21,6 +21,16 @@ module RakeCompilerDock
|
|
21
21
|
# Option +:verbose+ can be set to enable printing of the command line.
|
22
22
|
# If not set, rake's verbose flag is used.
|
23
23
|
#
|
24
|
+
# Option +:rubyvm+ can be set to +:mri+ or +:jruby+ .
|
25
|
+
# It selects the docker image with an appropriate toolchain.
|
26
|
+
#
|
27
|
+
# Option +:platform+ can be set to a list of space separated values.
|
28
|
+
# It selects the docker image(s) with an appropriate toolchain.
|
29
|
+
# Allowed values are +:x86-mingw32+, +x64-mingw32+, +x86-linux+ or +x86_64-linux+.
|
30
|
+
# If the list contains multiple values, +cmd+ is consecutively executed in each of the docker images,
|
31
|
+
# Option +:platform+ is ignored when +:rubyvm+ is set to +:jruby+.
|
32
|
+
# Default is "x86-mingw32 x64-mingw32" .
|
33
|
+
#
|
24
34
|
# Examples:
|
25
35
|
#
|
26
36
|
# RakeCompilerDock.sh 'bundle && rake cross native gem'
|
@@ -8,6 +8,7 @@ module RakeCompilerDock
|
|
8
8
|
|
9
9
|
attr_reader :io
|
10
10
|
attr_reader :pwd
|
11
|
+
attr_reader :docker_command
|
11
12
|
attr_accessor :machine_name
|
12
13
|
|
13
14
|
def initialize(io, pwd, machine_name="rake-compiler-dock")
|
@@ -53,12 +54,17 @@ module RakeCompilerDock
|
|
53
54
|
end
|
54
55
|
end
|
55
56
|
|
57
|
+
COMMANDS = %w[docker podman]
|
56
58
|
def docker_version
|
57
|
-
|
59
|
+
COMMANDS.find do |command|
|
60
|
+
@docker_version_text, @docker_version_status = run("#{command} version")
|
61
|
+
@docker_command = command
|
62
|
+
@docker_version_status == 0
|
63
|
+
end
|
58
64
|
end
|
59
65
|
|
60
66
|
def ok?
|
61
|
-
@docker_version_status == 0 && @docker_version_text =~ /version/ && doma_pwd_ok?
|
67
|
+
@docker_version_status == 0 && @docker_version_text =~ /version/i && doma_pwd_ok?
|
62
68
|
end
|
63
69
|
|
64
70
|
def docker_client_avail?
|
@@ -216,16 +222,16 @@ module RakeCompilerDock
|
|
216
222
|
help << yellow("Please download and install the docker-toolbox:")
|
217
223
|
help << yellow(" https://www.docker.com/docker-toolbox")
|
218
224
|
when /linux/
|
219
|
-
help << red("Docker is
|
225
|
+
help << red("Neither Docker nor Podman is available.")
|
220
226
|
help << ""
|
221
|
-
help << yellow("Install on Ubuntu/Debian:")
|
227
|
+
help << yellow("Install Docker on Ubuntu/Debian:")
|
222
228
|
help << " sudo apt-get install docker.io"
|
223
229
|
help << ""
|
224
|
-
help << yellow("Install on Fedora/Centos/RHEL")
|
230
|
+
help << yellow("Install Docker on Fedora/Centos/RHEL")
|
225
231
|
help << " sudo yum install docker"
|
226
232
|
help << " sudo systemctl start docker"
|
227
233
|
help << ""
|
228
|
-
help << yellow("Install on SuSE")
|
234
|
+
help << yellow("Install Docker on SuSE")
|
229
235
|
help << " sudo zypper install docker"
|
230
236
|
help << " sudo systemctl start docker"
|
231
237
|
when /darwin/
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "shellwords"
|
2
2
|
require "etc"
|
3
|
+
require "io/console"
|
3
4
|
require "rake_compiler_dock/version"
|
4
5
|
|
5
6
|
module RakeCompilerDock
|
@@ -9,15 +10,15 @@ module RakeCompilerDock
|
|
9
10
|
class Starter
|
10
11
|
class << self
|
11
12
|
def sh(cmd, options={}, &block)
|
12
|
-
|
13
|
-
|
13
|
+
begin
|
14
|
+
exec('bash', '-c', cmd, options, &block)
|
15
|
+
ensure
|
16
|
+
STDIN.cooked! if STDIN.tty?
|
14
17
|
end
|
15
|
-
exec('bash', '-c', cmd, options, &block)
|
16
18
|
end
|
17
19
|
|
18
20
|
def exec(*args)
|
19
21
|
options = (Hash === args.last) ? args.pop : {}
|
20
|
-
runargs = args.dup
|
21
22
|
|
22
23
|
mountdir = options.fetch(:mountdir){ ENV['RCD_MOUNTDIR'] || Dir.pwd }
|
23
24
|
workdir = options.fetch(:workdir){ ENV['RCD_WORKDIR'] || Dir.pwd }
|
@@ -40,49 +41,61 @@ module RakeCompilerDock
|
|
40
41
|
user = options.fetch(:username){ current_user }
|
41
42
|
group = options.fetch(:groupname){ current_group }
|
42
43
|
rubyvm = options.fetch(:rubyvm){ ENV['RCD_RUBYVM'] } || "mri"
|
43
|
-
image_name = options.fetch(:image) do
|
44
|
-
ENV['RCD_IMAGE'] ||
|
45
|
-
ENV['RAKE_COMPILER_DOCK_IMAGE'] ||
|
46
|
-
"larskanis/rake-compiler-dock-#{rubyvm}:#{IMAGE_VERSION}"
|
47
|
-
end
|
48
44
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
45
|
+
platforms = options.fetch(:platform){ ENV['RCD_PLATFORM'] } || "x86-mingw32 x64-mingw32"
|
46
|
+
platforms.split(" ").each do |platform|
|
47
|
+
image_name = options.fetch(:image) do
|
48
|
+
platform_postfix = rubyvm.to_s == "jruby" ? "" : "-#{platform}"
|
49
|
+
ENV['RCD_IMAGE'] ||
|
50
|
+
ENV['RAKE_COMPILER_DOCK_IMAGE'] ||
|
51
|
+
"larskanis/rake-compiler-dock-#{rubyvm}#{platform_postfix}:#{IMAGE_VERSION}"
|
52
|
+
end
|
57
53
|
|
58
|
-
|
59
|
-
|
60
|
-
"
|
61
|
-
"-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
"-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
54
|
+
check = check_docker(mountdir) if options.fetch(:check_docker){ true }
|
55
|
+
docker_opts = options.fetch(:options) do
|
56
|
+
opts = ["--rm", "-i"]
|
57
|
+
opts << "-t" if $stdin.tty?
|
58
|
+
opts
|
59
|
+
end
|
60
|
+
|
61
|
+
if verbose_flag(options) && args.size == 3 && args[0] == "bash" && args[1] == "-c"
|
62
|
+
$stderr.puts "rake-compiler-dock bash -c #{ args[2].inspect }"
|
63
|
+
end
|
64
|
+
|
65
|
+
runargs = args.dup
|
66
|
+
runargs.unshift("sigfw") if options.fetch(:sigfw){ true }
|
67
|
+
runargs.unshift("runas") if options.fetch(:runas){ true }
|
68
|
+
|
69
|
+
cmd = [check.docker_command, "run",
|
70
|
+
"-v", "#{mountdir}:#{make_valid_path(mountdir)}",
|
71
|
+
"-e", "UID=#{uid}",
|
72
|
+
"-e", "GID=#{gid}",
|
73
|
+
"-e", "USER=#{user}",
|
74
|
+
"-e", "GROUP=#{group}",
|
75
|
+
"-e", "GEM_PRIVATE_KEY_PASSPHRASE",
|
76
|
+
"-e", "ftp_proxy",
|
77
|
+
"-e", "http_proxy",
|
78
|
+
"-e", "https_proxy",
|
79
|
+
"-e", "RCD_HOST_RUBY_PLATFORM=#{RUBY_PLATFORM}",
|
80
|
+
"-e", "RCD_HOST_RUBY_VERSION=#{RUBY_VERSION}",
|
81
|
+
"-e", "RCD_IMAGE=#{image_name}",
|
82
|
+
"-w", make_valid_path(workdir),
|
83
|
+
*docker_opts,
|
84
|
+
image_name,
|
85
|
+
*runargs]
|
86
|
+
|
87
|
+
cmdline = Shellwords.join(cmd)
|
88
|
+
if verbose_flag(options) == true
|
89
|
+
$stderr.puts cmdline
|
90
|
+
end
|
79
91
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
92
|
+
ok = system(*cmd)
|
93
|
+
if block_given?
|
94
|
+
yield(ok, $?)
|
95
|
+
elsif !ok
|
96
|
+
fail "Command failed with status (#{$?.exitstatus}): " +
|
97
|
+
"[#{cmdline}]"
|
98
|
+
end
|
86
99
|
end
|
87
100
|
end
|
88
101
|
|
@@ -130,20 +143,22 @@ module RakeCompilerDock
|
|
130
143
|
name = name.gsub(/[ ]/i, "_")
|
131
144
|
end
|
132
145
|
|
146
|
+
@@docker_checked_lock = Mutex.new
|
133
147
|
@@docker_checked = {}
|
134
148
|
|
135
149
|
def check_docker(pwd)
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
150
|
+
@@docker_checked_lock.synchronize do
|
151
|
+
@@docker_checked[pwd] ||= begin
|
152
|
+
check = DockerCheck.new($stderr, pwd)
|
153
|
+
unless check.ok?
|
154
|
+
at_exit do
|
155
|
+
check.print_help_text
|
156
|
+
end
|
157
|
+
raise DockerIsNotAvailable, "Docker is not available"
|
158
|
+
end
|
159
|
+
check
|
142
160
|
end
|
143
|
-
raise DockerIsNotAvailable, "Docker is not available"
|
144
161
|
end
|
145
|
-
|
146
|
-
@@docker_checked[pwd] = check
|
147
162
|
end
|
148
163
|
|
149
164
|
# Change Path from "C:\Path" to "/c/Path" as used by boot2docker
|
@@ -30,11 +30,11 @@ class TestEnvironmentVariables < Test::Unit::TestCase
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_IMAGE
|
33
|
-
assert_equal "larskanis/rake-compiler-dock-mri:#{RakeCompilerDock::IMAGE_VERSION}", rcd_env['RCD_IMAGE']
|
33
|
+
assert_equal "larskanis/rake-compiler-dock-mri-x86-mingw32:#{RakeCompilerDock::IMAGE_VERSION}", rcd_env['RCD_IMAGE']
|
34
34
|
end
|
35
35
|
|
36
36
|
def test_RUBY_CC_VERSION
|
37
|
-
df = File.read(File.expand_path("../../Dockerfile.mri", __FILE__))
|
37
|
+
df = File.read(File.expand_path("../../Dockerfile.mri.erb", __FILE__))
|
38
38
|
df =~ /^ENV RUBY_CC_VERSION\s+(.*)\s+$/
|
39
39
|
assert_equal $1, rcd_env['RUBY_CC_VERSION']
|
40
40
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require_relative "../build/parallel_docker_build"
|
3
|
+
|
4
|
+
class TestParallelDockerBuild < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
File.write "File0", <<-EOT
|
7
|
+
FROM a
|
8
|
+
RUN a
|
9
|
+
RUN d
|
10
|
+
EOT
|
11
|
+
File.write "File1", <<-EOT
|
12
|
+
FROM a
|
13
|
+
RUN a
|
14
|
+
RUN d
|
15
|
+
RUN f \\
|
16
|
+
g
|
17
|
+
EOT
|
18
|
+
File.write "File2", <<-EOT
|
19
|
+
FROM a
|
20
|
+
RUN b
|
21
|
+
RUN c
|
22
|
+
RUN d
|
23
|
+
EOT
|
24
|
+
File.write "File3", <<-EOT
|
25
|
+
FROM a
|
26
|
+
RUN b
|
27
|
+
RUN c
|
28
|
+
RUN d
|
29
|
+
EOT
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_tasks
|
33
|
+
RakeCompilerDock::ParallelDockerBuild.new(%w[ File0 File1 File2 File3 ], task_prefix: "y")
|
34
|
+
|
35
|
+
assert_operator Rake::Task["File0"].prerequisites, :include?, "yFile0File1"
|
36
|
+
assert_operator Rake::Task["File1"].prerequisites, :include?, "yFile1"
|
37
|
+
assert_operator Rake::Task["yFile1"].prerequisites, :include?, "yFile0File1"
|
38
|
+
assert_operator Rake::Task["yFile0File1"].prerequisites, :include?, "yFile0File1File2File3"
|
39
|
+
|
40
|
+
assert_operator Rake::Task["File2"].prerequisites, :include?, "yFile2File3"
|
41
|
+
assert_operator Rake::Task["File3"].prerequisites, :include?, "yFile2File3"
|
42
|
+
assert_operator Rake::Task["yFile2File3"].prerequisites, :include?, "yFile0File1File2File3"
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_common_files
|
46
|
+
RakeCompilerDock::ParallelDockerBuild.new(%w[ File0 File1 File2 File3 ], task_prefix: "y")
|
47
|
+
|
48
|
+
assert_equal "FROM a\nRUN a\nRUN d\nRUN f \\\ng\n", read_df("yFile1")
|
49
|
+
assert_equal "FROM a\nRUN a\nRUN d\n", read_df("yFile0File1")
|
50
|
+
assert_equal "FROM a\nRUN b\nRUN c\nRUN d\n", read_df("yFile2File3")
|
51
|
+
assert_equal "FROM a\n", read_df("yFile0File1File2File3")
|
52
|
+
end
|
53
|
+
|
54
|
+
def read_df(fn)
|
55
|
+
File.read("tmp/docker/#{fn}").each_line.map(&:lstrip).join
|
56
|
+
end
|
57
|
+
end
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-compiler-dock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Kanis
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDPDCCAiSgAwIBAgIBBTANBgkqhkiG9w0BAQsFADBEMQ0wCwYDVQQDDARsYXJz
|
14
14
|
MR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZImiZPyLGQB
|
15
|
-
|
15
|
+
GRYCZGUwHhcNMjAxMjI2MTgzMzUyWhcNMjExMjI2MTgzMzUyWjBEMQ0wCwYDVQQD
|
16
16
|
DARsYXJzMR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZIm
|
17
17
|
iZPyLGQBGRYCZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZb4Uv
|
18
18
|
RFJfRu/VEWiy3psh2jinETjiuBrL0NeRFGf8H7iU9+gx/DI/FFhfHGLrDeIskrJx
|
@@ -22,52 +22,52 @@ cert_chain:
|
|
22
22
|
LMO2vULHKKHDdX54K/sbVCj9pN9h1aotNzrEyo55zxn0G9PHg/G3P8nMvAXPkUTe
|
23
23
|
brhXrfCwWRvOXA4TAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0G
|
24
24
|
A1UdDgQWBBRAHK81igrXodaDj8a8/BIKsaZrETANBgkqhkiG9w0BAQsFAAOCAQEA
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
DT6QoI7WEM1wivGn5BBHv3hJa2vGgmAxSPy7QM5iQX7U2ROfOeXYIHIRxsIv/cQl
|
26
|
+
+F568J6v3GAcFePi4Is9S7b8KWQkm+IjrPjL863hds6WVG8KyJZ758oczbviXNEV
|
27
|
+
vzna4S8Ra0m7LqGYGZW9B8ZIVdfhzKAF6V6iVlQtEFP7GQp17SjpNPd/gCbictIw
|
28
|
+
+jwual4DCn3p1X+Vgyl/AXPwU1NBAuuYUijOr7dVIoW2QNUh2d7jCwGe2mNi7Dbu
|
29
|
+
CqyDIUe+OuWLEpvgupYpVKQKx4+pa0s2ccLokMXYGFp1Z36heaYApV92yDjks8Sq
|
30
|
+
XtSi3zpLl4JPGBoeuZj97Q==
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
|
+
name: bundler
|
35
36
|
requirement: !ruby/object:Gem::Requirement
|
36
37
|
requirements:
|
37
38
|
- - "~>"
|
38
39
|
- !ruby/object:Gem::Version
|
39
40
|
version: '1.7'
|
40
|
-
name: bundler
|
41
|
-
prerelease: false
|
42
41
|
type: :development
|
42
|
+
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.7'
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
|
+
name: rake
|
49
50
|
requirement: !ruby/object:Gem::Requirement
|
50
51
|
requirements:
|
51
52
|
- - "~>"
|
52
53
|
- !ruby/object:Gem::Version
|
53
54
|
version: '12.0'
|
54
|
-
name: rake
|
55
|
-
prerelease: false
|
56
55
|
type: :development
|
56
|
+
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '12.0'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
+
name: test-unit
|
63
64
|
requirement: !ruby/object:Gem::Requirement
|
64
65
|
requirements:
|
65
66
|
- - "~>"
|
66
67
|
- !ruby/object:Gem::Version
|
67
68
|
version: '3.0'
|
68
|
-
name: test-unit
|
69
|
-
prerelease: false
|
70
69
|
type: :development
|
70
|
+
prerelease: false
|
71
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
@@ -85,16 +85,26 @@ extra_rdoc_files: []
|
|
85
85
|
files:
|
86
86
|
- ".gitignore"
|
87
87
|
- Dockerfile.jruby
|
88
|
-
- Dockerfile.mri
|
88
|
+
- Dockerfile.mri.erb
|
89
89
|
- Gemfile
|
90
90
|
- History.md
|
91
91
|
- LICENSE.txt
|
92
92
|
- README.md
|
93
93
|
- Rakefile
|
94
94
|
- bin/rake-compiler-dock
|
95
|
+
- build/gem_helper.rb
|
95
96
|
- build/mk_i686.rb
|
96
|
-
- build/
|
97
|
-
- build/patches/ruby-2.5.
|
97
|
+
- build/parallel_docker_build.rb
|
98
|
+
- build/patches/ruby-2.5.8/no_sendfile.patch
|
99
|
+
- build/patches/ruby-3.0.0/no_sendfile.patch
|
100
|
+
- build/patches2/hoe-3.20.0/0001-Load-encrypted-private-key-using-ENV-GEM_PRIVATE_KEY.patch
|
101
|
+
- build/patches2/rake-compiler-1.1.1/0001-Fix-determining-of-ruby-versions-in-rake-native-gem.patch
|
102
|
+
- build/patches2/rake-compiler-1.1.1/0003-Allow-building-of-cross-rubies-in-parallel.patch
|
103
|
+
- build/patches2/rake-compiler-1.1.1/0004-Enable-build-of-static-libruby.patch
|
104
|
+
- build/patches2/rake-compiler-1.1.1/0005-Don-t-mask-out-build-env-vars-for-cross-ruby.patch
|
105
|
+
- build/patches2/rake-compiler-1.1.1/0006-Use-RAKE_EXTENSION_TASK_NO_NATIVE-env-var-as-the-def.patch
|
106
|
+
- build/patches2/ruby-2.7.0/ruby2_keywords.patch
|
107
|
+
- build/patches2/ruby-3.0.0/ruby2_keywords.patch
|
98
108
|
- build/runas
|
99
109
|
- build/sigfw.c
|
100
110
|
- build/strip_wrapper
|
@@ -102,18 +112,18 @@ files:
|
|
102
112
|
- lib/rake_compiler_dock.rb
|
103
113
|
- lib/rake_compiler_dock/colors.rb
|
104
114
|
- lib/rake_compiler_dock/docker_check.rb
|
105
|
-
- lib/rake_compiler_dock/gem_helper.rb
|
106
115
|
- lib/rake_compiler_dock/predefined_user_group.rb
|
107
116
|
- lib/rake_compiler_dock/starter.rb
|
108
117
|
- lib/rake_compiler_dock/version.rb
|
109
118
|
- rake-compiler-dock.gemspec
|
110
119
|
- test/test_environment_variables.rb
|
120
|
+
- test/test_parallel_docker_build.rb
|
111
121
|
- test/test_starter.rb
|
112
122
|
homepage: https://github.com/rake-compiler/rake-compiler-dock
|
113
123
|
licenses:
|
114
124
|
- MIT
|
115
125
|
metadata: {}
|
116
|
-
post_install_message:
|
126
|
+
post_install_message:
|
117
127
|
rdoc_options: []
|
118
128
|
require_paths:
|
119
129
|
- lib
|
@@ -128,12 +138,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
138
|
- !ruby/object:Gem::Version
|
129
139
|
version: '0'
|
130
140
|
requirements: []
|
131
|
-
|
132
|
-
|
133
|
-
signing_key:
|
141
|
+
rubygems_version: 3.1.4
|
142
|
+
signing_key:
|
134
143
|
specification_version: 4
|
135
144
|
summary: Easy to use and reliable cross compiler environment for building Windows
|
136
145
|
and Linux binary gems.
|
137
146
|
test_files:
|
138
147
|
- test/test_environment_variables.rb
|
148
|
+
- test/test_parallel_docker_build.rb
|
139
149
|
- test/test_starter.rb
|