rake-compiler-dock 0.3.0 → 0.3.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 +5 -4
- data/History.md +7 -0
- data/README.md +9 -9
- data/bin/rake-compiler-dock +1 -1
- data/lib/rake_compiler_dock.rb +39 -30
- data/lib/rake_compiler_dock/version.rb +1 -1
- data/patches/ruby-1.8.7-p374/nop.patch +2 -0
- data/patches/ruby-1.9.3/no_sendfile.patch +13 -0
- data/patches/ruby-1.9.3/nop.patch +2 -0
- data/patches/ruby-2.2.2/no_sendfile.patch +12 -0
- metadata +6 -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: c26ea0c9a2f101595eacf69df6bd46dfb781da9e
|
4
|
+
data.tar.gz: eba33956622fdc4ebd756cfead1f91f58f9294f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 557cee7a6e0b484bb1b41f23ca4474db5383464722057cf7a33c21a8caa2e455b72782f11c61524bad843503c2274b4f0843d6ee40cb72ee9f349a11bd8cab1b
|
7
|
+
data.tar.gz: c0cae01e38a66d568a80fa7a11541782235bb10aca925da6ea0be4c0a071c23544c2c31b6b51fde8a5e0a1d518666cd7715e45ecd4720fef0be54a4604d99cc4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Dockerfile
CHANGED
@@ -4,12 +4,12 @@ RUN apt-get -y update && \
|
|
4
4
|
apt-get install -y curl git-core mingw32 xz-utils build-essential wget
|
5
5
|
|
6
6
|
RUN mkdir -p /opt/mingw && \
|
7
|
-
curl -SL http://
|
7
|
+
curl -SL http://downloads.sourceforge.net/mingw-w64/i686-w64-mingw32-gcc-4.7.2-release-linux64_rubenvb.tar.xz | \
|
8
8
|
tar -xJC /opt/mingw && \
|
9
9
|
echo "export PATH=\$PATH:/opt/mingw/mingw32/bin" >> /etc/rubybashrc
|
10
10
|
|
11
11
|
RUN mkdir -p /opt/mingw && \
|
12
|
-
curl -SL http://
|
12
|
+
curl -SL http://downloads.sourceforge.net/mingw-w64/x86_64-w64-mingw32-gcc-4.7.2-release-linux64_rubenvb.tar.xz | \
|
13
13
|
tar -xJC /opt/mingw && \
|
14
14
|
echo "export PATH=\$PATH:/opt/mingw/mingw64/bin" >> /etc/rubybashrc
|
15
15
|
|
@@ -25,13 +25,14 @@ RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 && \
|
|
25
25
|
source /etc/rubybashrc && \
|
26
26
|
rvmsudo rvm cleanup all "
|
27
27
|
|
28
|
+
ADD patches /home/rvm/patches
|
28
29
|
ENV BASH_ENV /etc/rubybashrc
|
29
30
|
|
30
31
|
# install rubies and fix permissions on
|
31
32
|
RUN bash -c " \
|
32
33
|
export CFLAGS='-s -O3 -fno-fast-math -fPIC' && \
|
33
34
|
for v in 1.8.7-p374 1.9.3 2.2.2 ; do \
|
34
|
-
rvm install \$v; \
|
35
|
+
rvm install \$v --patch \$(echo ~/patches/ruby-\$v/* | tr ' ' ','); \
|
35
36
|
done && \
|
36
37
|
rvm cleanup all && \
|
37
38
|
find /usr/local/rvm -type d | sudo xargs chmod g+sw "
|
@@ -63,7 +64,7 @@ RUN bash -c "rvm use 1.8.7-p374 && \
|
|
63
64
|
|
64
65
|
RUN bash -c "rvm use 1.9.3 && \
|
65
66
|
export CFLAGS='-s -O1 -fno-omit-frame-pointer -fno-fast-math' && \
|
66
|
-
rake-compiler cross-ruby VERSION=1.9.3-
|
67
|
+
rake-compiler cross-ruby VERSION=1.9.3-p551 HOST=i586-mingw32msvc && \
|
67
68
|
rm -rf ~/.rake-compiler/builds ~/.rake-compiler/sources"
|
68
69
|
|
69
70
|
RUN bash -c "rvm use 2.2.2 --default && \
|
data/History.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
0.3.1 / 2015-06-24
|
2
|
+
------------------
|
3
|
+
* Add :sigfw and :runas options.
|
4
|
+
* Don't stop the container on Ctrl-C when running interactively.
|
5
|
+
* Workaround an issue with sendfile() leading to broken files when using boot2docker on Windows.
|
6
|
+
|
7
|
+
|
1
8
|
0.3.0 / 2015-06-17
|
2
9
|
------------------
|
3
10
|
* Workaround an issue with broken DLLs when building on Windows.
|
data/README.md
CHANGED
@@ -28,16 +28,14 @@ Install rake-compiler-dock as a gem. The docker image is downloaded later on dem
|
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
31
|
-
`rake-compiler-dock`
|
32
|
-
|
31
|
+
Rake-compiler-dock offers the shell command `rake-compiler-dock` and a [ruby API for issuing commands within the docker image](http://www.rubydoc.info/gems/rake-compiler-dock/RakeCompilerDock).
|
32
|
+
Both mount the current working directory into the docker environment.
|
33
33
|
All commands are executed with the current user and group of the host.
|
34
|
+
This is done by copying account data into the container and sudo to it.
|
34
35
|
|
35
36
|
`rake-compiler-dock` without arguments starts an interactive shell session.
|
36
|
-
|
37
|
-
|
38
|
-
But note, that all other changes to the file system are dropped at the end of the session - the docker image is stateless.
|
39
|
-
|
40
|
-
`rake-compiler-dock` can also take the build command(s) from STDIN or as command arguments.
|
37
|
+
All changes below the current working directory are shared with the host.
|
38
|
+
But note, that all other changes to the file system of the contanier are dropped at the end of the session - the docker image is stateless. `rake-compiler-dock` can also take the build command(s) from STDIN or as command arguments.
|
41
39
|
|
42
40
|
To build x86- and x64 Windows (Mingw) binary gems, it is typically called like this:
|
43
41
|
|
@@ -48,12 +46,14 @@ The installed cross rubies can be listed like this:
|
|
48
46
|
|
49
47
|
$ rake-compiler-dock bash -c 'rvmsudo rake-compiler update-config'
|
50
48
|
|
51
|
-
The environment variable `RUBY_CC_VERSION` is predefined and includes all these versions:
|
49
|
+
The environment variable `RUBY_CC_VERSION` is predefined and includes all these cross ruby versions:
|
52
50
|
|
53
51
|
$ rake-compiler-dock bash -c 'echo $RUBY_CC_VERSION' # => 1.8.7:1.9.3:2.0.0:2.1.6:2.2.2
|
54
52
|
|
55
53
|
Overwrite `RUBY_CC_VERSION`, if your gem does not support all available versions.
|
56
54
|
|
55
|
+
You can also choose between different executable ruby versions by `rvm use <version>` . Current default is 2.2.
|
56
|
+
|
57
57
|
### Add to your Rakefile
|
58
58
|
|
59
59
|
Rake-compiler-dock can be easily integrated into your Rakefile like this:
|
@@ -63,7 +63,7 @@ Rake-compiler-dock can be easily integrated into your Rakefile like this:
|
|
63
63
|
RakeCompilerDock.sh "bundle && rake cross native gem"
|
64
64
|
end
|
65
65
|
|
66
|
-
See [the wiki](https://github.com/larskanis/rake-compiler-dock/wiki/Projects-using-rake-compiler) for projects which use rake-compiler-dock.
|
66
|
+
See [the wiki](https://github.com/larskanis/rake-compiler-dock/wiki/Projects-using-rake-compiler-dock) for projects which use rake-compiler-dock.
|
67
67
|
|
68
68
|
## Contributing
|
69
69
|
|
data/bin/rake-compiler-dock
CHANGED
data/lib/rake_compiler_dock.rb
CHANGED
@@ -11,14 +11,15 @@ module RakeCompilerDock
|
|
11
11
|
# Without a block a RuntimeError is raised when the command exits non-zero.
|
12
12
|
#
|
13
13
|
# Option +:verbose+ can be set to enable printing of the command line.
|
14
|
-
# If not set,
|
14
|
+
# If not set, rake's verbose flag is used.
|
15
15
|
#
|
16
16
|
# Examples:
|
17
17
|
#
|
18
18
|
# RakeCompilerDock.sh 'bundle && rake cross native gem'
|
19
19
|
#
|
20
|
-
#
|
21
|
-
#
|
20
|
+
# Check exit status after command runs:
|
21
|
+
#
|
22
|
+
# sh %{bundle && rake cross native gem}, verbose: false do |ok, res|
|
22
23
|
# if ! ok
|
23
24
|
# puts "windows cross build failed (status = #{res.exitstatus})"
|
24
25
|
# end
|
@@ -40,17 +41,22 @@ module RakeCompilerDock
|
|
40
41
|
# If a block is given, upon command completion the block is called with an OK flag (true on a zero exit status) and a Process::Status object.
|
41
42
|
# Without a block a RuntimeError is raised when the command exits non-zero.
|
42
43
|
#
|
43
|
-
# Option +:verbose+ can be set to enable printing of the command line.
|
44
|
-
#
|
45
|
-
# Option +:check_docker+ can be set to false to disable the docker check.
|
44
|
+
# * Option +:verbose+ can be set to enable printing of the command line.
|
45
|
+
# If not set, rake's verbose flag is used.
|
46
|
+
# * Option +:check_docker+ can be set to false to disable the docker check.
|
47
|
+
# * Option +:sigfw+ can be set to false to not stop the container on Ctrl-C.
|
48
|
+
# * Option +:runas+ can be set to false to execute the command as user root.
|
46
49
|
#
|
47
50
|
# Examples:
|
48
51
|
#
|
49
52
|
# RakeCompilerDock.exec 'bash', '-c', 'echo $RUBY_CC_VERSION'
|
50
53
|
def exec(*args)
|
51
54
|
options = (Hash === args.last) ? args.pop : {}
|
55
|
+
runargs = args.dup
|
52
56
|
|
53
57
|
check_docker if options.fetch(:check_docker){ true }
|
58
|
+
runargs.unshift("sigfw") if options.fetch(:sigfw){ true }
|
59
|
+
runargs.unshift("runas") if options.fetch(:runas){ true }
|
54
60
|
|
55
61
|
if RUBY_PLATFORM =~ /mingw|mswin/
|
56
62
|
# Change Path from "C:\Path" to "/c/Path" as used by boot2docker
|
@@ -76,7 +82,7 @@ module RakeCompilerDock
|
|
76
82
|
"-e", "https_proxy=#{ENV['https_proxy']}",
|
77
83
|
"-w", pwd,
|
78
84
|
image_name,
|
79
|
-
|
85
|
+
*runargs]
|
80
86
|
|
81
87
|
cmdline = Shellwords.join(cmd)
|
82
88
|
if verbose_flag(options) == true
|
@@ -107,30 +113,33 @@ module RakeCompilerDock
|
|
107
113
|
if $?.exitstatus == 0 && version_text.to_s =~ /version/
|
108
114
|
@@docker_checked = true
|
109
115
|
else
|
110
|
-
|
111
|
-
when /mingw|mswin/
|
112
|
-
$stderr.puts "Docker is not available. Please download and install boot2docker:"
|
113
|
-
$stderr.puts " https://github.com/boot2docker/windows-installer/releases"
|
114
|
-
$stderr.puts
|
115
|
-
$stderr.puts "Then execute 'boot2docker start' and follow the instuctions"
|
116
|
-
when /linux/
|
117
|
-
$stderr.puts "Docker is not available."
|
118
|
-
$stderr.puts
|
119
|
-
$stderr.puts "Install on Ubuntu/Debian:"
|
120
|
-
$stderr.puts " sudo apt-get install docker.io"
|
121
|
-
$stderr.puts
|
122
|
-
$stderr.puts "Install on Fedora/Centos/RHEL"
|
123
|
-
$stderr.puts " sudo yum install docker"
|
124
|
-
$stderr.puts " sudo systemctl start docker"
|
116
|
+
at_exit do
|
125
117
|
$stderr.puts
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
118
|
+
case RUBY_PLATFORM
|
119
|
+
when /mingw|mswin/
|
120
|
+
$stderr.puts "Docker is not available. Please download and install boot2docker:"
|
121
|
+
$stderr.puts " https://github.com/boot2docker/windows-installer/releases"
|
122
|
+
$stderr.puts
|
123
|
+
$stderr.puts "Then execute 'boot2docker start' and follow the instuctions"
|
124
|
+
when /linux/
|
125
|
+
$stderr.puts "Docker is not available."
|
126
|
+
$stderr.puts
|
127
|
+
$stderr.puts "Install on Ubuntu/Debian:"
|
128
|
+
$stderr.puts " sudo apt-get install docker.io"
|
129
|
+
$stderr.puts
|
130
|
+
$stderr.puts "Install on Fedora/Centos/RHEL"
|
131
|
+
$stderr.puts " sudo yum install docker"
|
132
|
+
$stderr.puts " sudo systemctl start docker"
|
133
|
+
$stderr.puts
|
134
|
+
$stderr.puts "Install on SuSE"
|
135
|
+
$stderr.puts " sudo zypper install docker"
|
136
|
+
$stderr.puts " sudo systemctl start docker"
|
137
|
+
when /darwin/
|
138
|
+
$stderr.puts "Docker is not available. Please download and install boot2docker:"
|
139
|
+
$stderr.puts " https://github.com/boot2docker/osx-installer/releases"
|
140
|
+
else
|
141
|
+
$stderr.puts "Docker is not available."
|
142
|
+
end
|
134
143
|
end
|
135
144
|
raise DockerIsNotAvailable, "Docker is not available"
|
136
145
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
diff --git a/configure b/configure
|
2
|
+
index 898730c..cfe6253 100755
|
3
|
+
--- a/configure
|
4
|
+
+++ b/configure
|
5
|
+
@@ -14695,7 +14695,7 @@ for ac_func in fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot ge
|
6
|
+
setsid telldir seekdir fchmod cosh sinh tanh log2 round\
|
7
|
+
setuid setgid daemon select_large_fdset setenv unsetenv\
|
8
|
+
mktime timegm gmtime_r clock_gettime gettimeofday poll ppoll\
|
9
|
+
- pread sendfile shutdown sigaltstack dl_iterate_phdr
|
10
|
+
+ pread shutdown sigaltstack dl_iterate_phdr
|
11
|
+
do :
|
12
|
+
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
13
|
+
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
diff --git a/configure b/configure
|
2
|
+
index 55157af..6630eba 100755
|
3
|
+
--- a/configure
|
4
|
+
+++ b/configure
|
5
|
+
@@ -18676,7 +18676,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
|
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Kanis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
1i6jssufMLmyDB9b1ss72d7xQQpCHH7oizgt84wKAcsV8b83kGbAhtoszY3TgGiJ
|
30
30
|
rww=
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2015-06-
|
32
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: bundler
|
@@ -79,6 +79,10 @@ files:
|
|
79
79
|
- bin/rake-compiler-dock
|
80
80
|
- lib/rake_compiler_dock.rb
|
81
81
|
- lib/rake_compiler_dock/version.rb
|
82
|
+
- patches/ruby-1.8.7-p374/nop.patch
|
83
|
+
- patches/ruby-1.9.3/no_sendfile.patch
|
84
|
+
- patches/ruby-1.9.3/nop.patch
|
85
|
+
- patches/ruby-2.2.2/no_sendfile.patch
|
82
86
|
- rake-compiler-dock.gemspec
|
83
87
|
- src/rake-compiler-without-exts.diff
|
84
88
|
- src/runas
|
metadata.gz.sig
CHANGED
Binary file
|