rake-compiler-dock 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Dockerfile +7 -7
- data/History.md +6 -0
- data/README.md +1 -1
- data/build/patches/rake-compiler-0.9.5/compat-with-bundler.diff +105 -0
- data/lib/rake_compiler_dock/docker_check.rb +43 -7
- data/lib/rake_compiler_dock/starter.rb +16 -17
- data/lib/rake_compiler_dock/version.rb +2 -2
- metadata +4 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d37fa0a52b14f6b5d7d571ba7f467a00ce4729e
|
4
|
+
data.tar.gz: 897c281b857e1555c0d5e22c4a04b4d8802a34ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe68d4b5392818af317189727912b71809b702467b12360421f63ef83ac012eb98c51b30ce1cd4fae5af659f33c4d7125483d5ce02c132f8e998ea54bea5f4a5
|
7
|
+
data.tar.gz: 06214c0597dace18fe9e3cb9bee4ad6bfa52623dc0d45cfc62d21585c8816bacc2001355049795627357c1bfea44b22be3b8f771f10b847b803d576ab08dc6cf
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Dockerfile
CHANGED
@@ -36,14 +36,14 @@ RUN bash -c " \
|
|
36
36
|
rvm install \$v --patch \$(echo ~/patches/ruby-\$v/* | tr ' ' ','); \
|
37
37
|
done && \
|
38
38
|
rvm cleanup all && \
|
39
|
-
find /usr/local/rvm -type d | sudo xargs chmod g+sw "
|
39
|
+
find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
|
40
40
|
|
41
41
|
# Install rake-compiler and typical gems in all Rubies
|
42
42
|
# do not generate documentation for gems
|
43
43
|
RUN echo "gem: --no-ri --no-rdoc" >> ~/.gemrc && \
|
44
44
|
bash -c " \
|
45
|
-
rvm all do gem install bundler rake-compiler hoe mini_portile rubygems-tasks && \
|
46
|
-
rvm 1.9.3,2.3.0 do gem install mini_portile2 && \
|
45
|
+
rvm all do gem install --no-document bundler rake-compiler hoe mini_portile rubygems-tasks && \
|
46
|
+
rvm 1.9.3,2.3.0 do gem install --no-document mini_portile2 && \
|
47
47
|
find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
|
48
48
|
|
49
49
|
# Install rake-compiler's cross rubies in global dir instead of /root
|
@@ -52,9 +52,9 @@ RUN sudo mkdir -p /usr/local/rake-compiler && \
|
|
52
52
|
ln -s /usr/local/rake-compiler ~/.rake-compiler
|
53
53
|
|
54
54
|
# Patch rake-compiler to avoid build of ruby extensions
|
55
|
-
RUN cd /usr/local/rvm/gems/ruby-1.8.7-p374/gems/rake-compiler-0.9.5 &&
|
56
|
-
cd /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-compiler-0.9.5 &&
|
57
|
-
cd /usr/local/rvm/gems/ruby-2.3.0/gems/rake-compiler-0.9.5 &&
|
55
|
+
RUN cd /usr/local/rvm/gems/ruby-1.8.7-p374/gems/rake-compiler-0.9.5 && git apply /home/rvm/patches/rake-compiler-0.9.5/*.diff ; \
|
56
|
+
cd /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-compiler-0.9.5 && git apply /home/rvm/patches/rake-compiler-0.9.5/*.diff ; \
|
57
|
+
cd /usr/local/rvm/gems/ruby-2.3.0/gems/rake-compiler-0.9.5 && git apply /home/rvm/patches/rake-compiler-0.9.5/*.diff ; \
|
58
58
|
true
|
59
59
|
|
60
60
|
RUN bash -c "rvm use 2.3.0 --default && \
|
@@ -68,7 +68,7 @@ RUN bash -c "rvm use 2.3.0 --default && \
|
|
68
68
|
rake-compiler cross-ruby VERSION=2.0.0-p645 HOST=i686-w64-mingw32 && \
|
69
69
|
rake-compiler cross-ruby VERSION=2.0.0-p645 HOST=x86_64-w64-mingw32 && \
|
70
70
|
rm -rf ~/.rake-compiler/builds ~/.rake-compiler/sources && \
|
71
|
-
find /usr/local/rvm -type d | sudo xargs chmod g+sw "
|
71
|
+
find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
|
72
72
|
|
73
73
|
RUN bash -c "rvm use 1.9.3 && \
|
74
74
|
export CFLAGS='-s -O1 -fno-omit-frame-pointer -fno-fast-math' && \
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -63,7 +63,7 @@ This is local to the running session, only:
|
|
63
63
|
sudo apt-get update && sudo apt-get install your-package
|
64
64
|
|
65
65
|
You can also choose between different executable ruby versions by `rvm use <version>` .
|
66
|
-
|
66
|
+
The current default is 2.3.
|
67
67
|
|
68
68
|
|
69
69
|
### Add to your Rakefile
|
@@ -0,0 +1,105 @@
|
|
1
|
+
From 41f834449fc4323b2f995e8715aa5842d9fd9334 Mon Sep 17 00:00:00 2001
|
2
|
+
From: Lars Kanis <lars@greiz-reinsdorf.de>
|
3
|
+
Date: Sat, 30 Jan 2016 08:08:07 +0100
|
4
|
+
Subject: [PATCH] Change the fake mechanism to be compatible with bundler.
|
5
|
+
|
6
|
+
The previous fake mechanism worked by hooking onto the
|
7
|
+
"require 'rbconfig'" call.
|
8
|
+
This is problematic because bundler internally requires rbconfig, but doesn't
|
9
|
+
work corretly in a faked environment.
|
10
|
+
It then fails to load gems that are also part of the standard library, like
|
11
|
+
json and rdoc.
|
12
|
+
This results in issues like https://github.com/rake-compiler/rake-compiler-dock/issues/8
|
13
|
+
|
14
|
+
The fake mechanism is now changed to hook onto the "require 'mkrb'" call,
|
15
|
+
which is typically part of the extconf file, and it is where the faked platform
|
16
|
+
values are actually needed.
|
17
|
+
That way it is loaded after bundler/setup, so that the library paths are
|
18
|
+
set according to the Gemfile.lock, to the native Linux libraries, before
|
19
|
+
the fake environment is active.
|
20
|
+
|
21
|
+
Please note, that the build directory of a given gem needs to be cleared,
|
22
|
+
in order to get updated fake files. So do a "rm tmp pkg -rf".
|
23
|
+
---
|
24
|
+
lib/rake/extensiontask.rb | 35 ++++++++++++++---------------------
|
25
|
+
1 file changed, 14 insertions(+), 21 deletions(-)
|
26
|
+
|
27
|
+
diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb
|
28
|
+
index 030af96..f914919 100644
|
29
|
+
--- a/lib/rake/extensiontask.rb
|
30
|
+
+++ b/lib/rake/extensiontask.rb
|
31
|
+
@@ -169,8 +169,8 @@ Java extension should be preferred.
|
32
|
+
# now add the extconf script
|
33
|
+
cmd << abs_extconf.relative_path_from(abs_tmp_path)
|
34
|
+
|
35
|
+
- # rbconfig.rb will be present if we are cross compiling
|
36
|
+
- if t.prerequisites.include?("#{tmp_path}/rbconfig.rb") then
|
37
|
+
+ # fake.rb will be present if we are cross compiling
|
38
|
+
+ if t.prerequisites.include?("#{tmp_path}/fake.rb") then
|
39
|
+
options.push(*cross_config_options(platf))
|
40
|
+
end
|
41
|
+
|
42
|
+
@@ -365,39 +365,30 @@ Java extension should be preferred.
|
43
|
+
# define compilation tasks for cross platform!
|
44
|
+
define_compile_tasks(for_platform, ruby_ver)
|
45
|
+
|
46
|
+
- # chain fake.rb, rbconfig.rb and mkmf.rb to Makefile generation
|
47
|
+
+ # chain fake.rb and mkmf.rb to Makefile generation
|
48
|
+
file "#{tmp_path}/Makefile" => ["#{tmp_path}/fake.rb",
|
49
|
+
- "#{tmp_path}/rbconfig.rb",
|
50
|
+
"#{tmp_path}/mkmf.rb"]
|
51
|
+
|
52
|
+
- # copy the file from the cross-ruby location
|
53
|
+
- file "#{tmp_path}/rbconfig.rb" => [rbconfig_file] do |t|
|
54
|
+
+ # copy the rbconfig from the cross-ruby location and
|
55
|
+
+ # genearte fake.rb for different ruby versions
|
56
|
+
+ file "#{tmp_path}/fake.rb" => [rbconfig_file] do |t|
|
57
|
+
File.open(t.name, 'w') do |f|
|
58
|
+
- f.write "require 'fake.rb'\n\n"
|
59
|
+
+ f.write fake_rb(for_platform, ruby_ver)
|
60
|
+
f.write File.read(t.prerequisites.first)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# copy mkmf from cross-ruby location
|
65
|
+
file "#{tmp_path}/mkmf.rb" => [mkmf_file] do |t|
|
66
|
+
- cp t.prerequisites.first, t.name
|
67
|
+
- if ruby_ver < "1.9" && "1.9" <= RUBY_VERSION
|
68
|
+
- File.open(t.name, 'r+t') do |f|
|
69
|
+
- content = f.read
|
70
|
+
+ File.open(t.name, 'w') do |f|
|
71
|
+
+ content = File.read(t.prerequisites.first)
|
72
|
+
+ content.sub!(/^(require ')rbconfig(')$/, '\\1fake\\2')
|
73
|
+
+ if ruby_ver < "1.9" && "1.9" <= RUBY_VERSION
|
74
|
+
content.sub!(/^( break )\*(defaults)$/, '\\1\\2.first')
|
75
|
+
content.sub!(/^( return )\*(defaults)$/, '\\1\\2.first')
|
76
|
+
content.sub!(/^( mfile\.)print( configuration\(srcprefix\))$/, '\\1puts\\2')
|
77
|
+
- f.rewind
|
78
|
+
- f.write content
|
79
|
+
- f.truncate(f.tell)
|
80
|
+
end
|
81
|
+
- end
|
82
|
+
- end
|
83
|
+
-
|
84
|
+
- # genearte fake.rb for different ruby versions
|
85
|
+
- file "#{tmp_path}/fake.rb" do |t|
|
86
|
+
- File.open(t.name, 'w') do |f|
|
87
|
+
- f.write fake_rb(for_platform, ruby_ver)
|
88
|
+
+ f.write content
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
@@ -495,8 +486,10 @@ Java extension should be preferred.
|
93
|
+
# "cannot load such file -- win32/resolv" when it is required later on.
|
94
|
+
# See also: https://github.com/tjschuck/rake-compiler-dev-box/issues/5
|
95
|
+
require 'resolv'
|
96
|
+
+ require 'rbconfig'
|
97
|
+
|
98
|
+
class Object
|
99
|
+
+ remove_const :RbConfig
|
100
|
+
remove_const :RUBY_PLATFORM
|
101
|
+
remove_const :RUBY_VERSION
|
102
|
+
remove_const :RUBY_DESCRIPTION if defined?(RUBY_DESCRIPTION)
|
103
|
+
--
|
104
|
+
2.5.0.windows.1
|
105
|
+
|
@@ -6,10 +6,12 @@ module RakeCompilerDock
|
|
6
6
|
include Colors
|
7
7
|
|
8
8
|
attr_reader :io
|
9
|
+
attr_reader :pwd
|
9
10
|
attr_accessor :machine_name
|
10
11
|
|
11
|
-
def initialize(io, machine_name="rake-compiler-dock")
|
12
|
+
def initialize(io, pwd, machine_name="rake-compiler-dock")
|
12
13
|
@io = io
|
14
|
+
@pwd = pwd
|
13
15
|
@machine_name = machine_name
|
14
16
|
|
15
17
|
if !io.tty? || (RUBY_PLATFORM=~/mingw|mswin/ && RUBY_VERSION[/^\d+/] < '2')
|
@@ -55,7 +57,7 @@ module RakeCompilerDock
|
|
55
57
|
end
|
56
58
|
|
57
59
|
def ok?
|
58
|
-
@docker_version_status == 0 && @docker_version_text =~ /version/
|
60
|
+
@docker_version_status == 0 && @docker_version_text =~ /version/ && doma_pwd_ok?
|
59
61
|
end
|
60
62
|
|
61
63
|
def docker_client_avail?
|
@@ -70,12 +72,17 @@ module RakeCompilerDock
|
|
70
72
|
@doma_version_status == 0 && @doma_version_text =~ /version/
|
71
73
|
end
|
72
74
|
|
75
|
+
def add_env_options(options, names)
|
76
|
+
names.each do |name|
|
77
|
+
if (v=ENV[name]) && !v.empty?
|
78
|
+
options << ["--engine-env", "#{name}=#{ENV[name]}"]
|
79
|
+
end
|
80
|
+
end
|
81
|
+
options
|
82
|
+
end
|
83
|
+
|
73
84
|
def doma_create
|
74
|
-
options = [
|
75
|
-
"--engine-env", "ftp_proxy=#{ENV['ftp_proxy']}",
|
76
|
-
"--engine-env", "http_proxy=#{ENV['http_proxy']}",
|
77
|
-
"--engine-env", "https_proxy=#{ENV['https_proxy']}",
|
78
|
-
]
|
85
|
+
options = add_env_options([], %w[ftp_proxy http_proxy https_proxy])
|
79
86
|
@doma_create_text, @doma_create_status = run("docker-machine create --driver virtualbox #{options.join(" ")} #{machine_name}", cmd: :visible, output: :visible)
|
80
87
|
end
|
81
88
|
|
@@ -151,6 +158,17 @@ module RakeCompilerDock
|
|
151
158
|
@b2d_start_envset
|
152
159
|
end
|
153
160
|
|
161
|
+
def doma_pwd_ok?
|
162
|
+
case RUBY_PLATFORM
|
163
|
+
when /mingw|mswin/
|
164
|
+
pwd =~ /^\/c\/users/i
|
165
|
+
when /linux/
|
166
|
+
true
|
167
|
+
when /darwin/
|
168
|
+
pwd =~ /^\/users/i
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
154
172
|
def set_env(text)
|
155
173
|
set = false
|
156
174
|
text.scan(/(unset |Remove-Item Env:\\)(.+?)$/) do |_, key|
|
@@ -237,6 +255,15 @@ module RakeCompilerDock
|
|
237
255
|
help << ""
|
238
256
|
help << yellow("You might try to regenerate TLS certificates with:")
|
239
257
|
help << " docker-machine regenerate-certs #{machine_name}"
|
258
|
+
elsif !ok? && !doma_pwd_ok?
|
259
|
+
help << red("docker-machine can not mount the current working directory.")
|
260
|
+
help << ""
|
261
|
+
case RUBY_PLATFORM
|
262
|
+
when /mingw|mswin/
|
263
|
+
help << yellow(" Please move to a diretory below C:\\Users")
|
264
|
+
when /darwin/
|
265
|
+
help << yellow(" Please move to a diretory below /Users")
|
266
|
+
end
|
240
267
|
elsif !ok?
|
241
268
|
help << red("docker-machine is installed and started, but 'docker version' failed.")
|
242
269
|
help << ""
|
@@ -262,6 +289,15 @@ module RakeCompilerDock
|
|
262
289
|
help << yellow(" Please check why '") + white("boot2docker start") + yellow("' fails.")
|
263
290
|
help << yellow(" You might need to re-init with '") + white("boot2docker delete") + yellow("'")
|
264
291
|
help << yellow(" or have a look at our FAQs: http://git.io/vm8Nr")
|
292
|
+
elsif !ok? && !doma_pwd_ok?
|
293
|
+
help << red("boot2docker can not mount the current working directory.")
|
294
|
+
help << ""
|
295
|
+
case RUBY_PLATFORM
|
296
|
+
when /mingw|mswin/
|
297
|
+
help << yellow(" Please move to a diretory below C:\\Users")
|
298
|
+
when /darwin/
|
299
|
+
help << yellow(" Please move to a diretory below /Users")
|
300
|
+
end
|
265
301
|
elsif !ok? && b2d_start_ok?
|
266
302
|
help << red("boot2docker is installed and started, but 'docker version' failed.")
|
267
303
|
help << ""
|
@@ -23,28 +23,18 @@ module RakeCompilerDock
|
|
23
23
|
options = (Hash === args.last) ? args.pop : {}
|
24
24
|
runargs = args.dup
|
25
25
|
|
26
|
-
|
27
|
-
runargs.unshift("sigfw") if options.fetch(:sigfw){ true }
|
28
|
-
runargs.unshift("runas") if options.fetch(:runas){ true }
|
29
|
-
docker_opts = options.fetch(:options) do
|
30
|
-
opts = ["--rm", "-i"]
|
31
|
-
opts << "-t" if $stdin.tty?
|
32
|
-
opts
|
33
|
-
end
|
34
|
-
|
26
|
+
pwd = Dir.pwd
|
35
27
|
case RUBY_PLATFORM
|
36
28
|
when /mingw|mswin/
|
37
29
|
# Change Path from "C:\Path" to "/c/Path" as used by boot2docker
|
38
|
-
pwd =
|
30
|
+
pwd = pwd.gsub(/^([a-z]):/i){ "/#{$1.downcase}" }
|
39
31
|
# Virtualbox shared folders don't care about file permissions, so we use generic ids.
|
40
32
|
uid = 1000
|
41
33
|
gid = 1000
|
42
34
|
when /darwin/
|
43
|
-
pwd = Dir.pwd
|
44
35
|
uid = 1000
|
45
36
|
gid = 1000
|
46
37
|
else
|
47
|
-
pwd = Dir.pwd
|
48
38
|
# Docker mounted volumes also share file uid/gid and permissions with the host.
|
49
39
|
# Therefore we use the same attributes inside and outside the container.
|
50
40
|
uid = Process.uid
|
@@ -53,6 +43,15 @@ module RakeCompilerDock
|
|
53
43
|
user = options.fetch(:username){ current_user }
|
54
44
|
group = options.fetch(:groupname){ current_group }
|
55
45
|
|
46
|
+
check_docker(pwd) if options.fetch(:check_docker){ true }
|
47
|
+
runargs.unshift("sigfw") if options.fetch(:sigfw){ true }
|
48
|
+
runargs.unshift("runas") if options.fetch(:runas){ true }
|
49
|
+
docker_opts = options.fetch(:options) do
|
50
|
+
opts = ["--rm", "-i"]
|
51
|
+
opts << "-t" if $stdin.tty?
|
52
|
+
opts
|
53
|
+
end
|
54
|
+
|
56
55
|
cmd = ["docker", "run",
|
57
56
|
"-v", "#{pwd}:#{make_valid_path(pwd)}",
|
58
57
|
"-e", "UID=#{uid}",
|
@@ -128,12 +127,12 @@ module RakeCompilerDock
|
|
128
127
|
name = name.gsub(/[ ]/i, "_")
|
129
128
|
end
|
130
129
|
|
131
|
-
@@docker_checked =
|
130
|
+
@@docker_checked = {}
|
132
131
|
|
133
|
-
def check_docker
|
134
|
-
return if @@docker_checked
|
132
|
+
def check_docker(pwd)
|
133
|
+
return if @@docker_checked[pwd]
|
135
134
|
|
136
|
-
check = DockerCheck.new($stderr)
|
135
|
+
check = DockerCheck.new($stderr, pwd)
|
137
136
|
unless check.ok?
|
138
137
|
at_exit do
|
139
138
|
check.print_help_text
|
@@ -141,7 +140,7 @@ module RakeCompilerDock
|
|
141
140
|
raise DockerIsNotAvailable, "Docker is not available"
|
142
141
|
end
|
143
142
|
|
144
|
-
@@docker_checked = check
|
143
|
+
@@docker_checked[pwd] = check
|
145
144
|
end
|
146
145
|
|
147
146
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-compiler-dock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Kanis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
6jkDey5mE3jQb893U6ihl55uLkVQwxZZTq/flNWjTIcbbvKKafEGdGv5uOlB+KRL
|
30
30
|
PRtgPFlA2jDgUr1EPAIH1Q==
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2016-01-30 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: bundler
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- README.md
|
92
92
|
- Rakefile
|
93
93
|
- bin/rake-compiler-dock
|
94
|
+
- build/patches/rake-compiler-0.9.5/compat-with-bundler.diff
|
94
95
|
- build/patches/rake-compiler-0.9.5/without-exts.diff
|
95
96
|
- build/patches/ruby-1.8.7-p374/nop.patch
|
96
97
|
- build/patches/ruby-1.9.3/no_sendfile.patch
|
@@ -137,3 +138,4 @@ summary: Easy to use and reliable cross compiler environment for building Window
|
|
137
138
|
test_files:
|
138
139
|
- test/test_environment_variables.rb
|
139
140
|
- test/test_starter.rb
|
141
|
+
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|