rake-compiler-dock 1.3.0 → 1.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
- data/.dockerignore +2 -0
- data/Dockerfile.jruby +1 -1
- data/Dockerfile.mri.erb +13 -6
- data/History.md +8 -1
- data/Rakefile +2 -0
- data/build/mk_osxcross.sh +5 -0
- data/build/parallel_docker_build.rb +2 -1
- data/build/strip_wrapper_codesign +17 -0
- data/lib/rake_compiler_dock/version.rb +2 -2
- data/test/rcd_test/ext/mri/extconf.rb +14 -0
- data/test/test_parallel_docker_build.rb +15 -11
- metadata +7 -6
- data/build/patches2/rake-compiler-1.2.1/0005-make-miniruby.patch +0 -19
- /data/build/patches2/{rake-compiler-1.2.1 → rake-compiler-1.2.2}/0004-Enable-build-of-static-libruby.patch +0 -0
- /data/build/{strip_wrapper → strip_wrapper_vbox} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0330e7e3a9c83585df7ce3f77b4abfef615a7b86fbd9bf0da5a7f9bdf562acd3
|
4
|
+
data.tar.gz: c48c0b411ab4f3e6d52f475af134715976af211fbf5bd3379c5f4cadcc5af467
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31aa3a2b77ff3572270ee64dcad2c9a7606b26638103ef2b1879cafc5a9bf79aff43c1ea0a139020956b8256e16acd15388b068b3efe60acabe5d7ad1096e929
|
7
|
+
data.tar.gz: 9a7ed2d9d49fab243c038ff094d4781f10608fed2c0a99745e31277c2946f659672f059d43da4a2cb48057b76ddd15b89978530d7435409c6fcc03e2add6a595
|
data/.dockerignore
ADDED
data/Dockerfile.jruby
CHANGED
@@ -39,7 +39,7 @@ RUN bash -c " \
|
|
39
39
|
rvm all do gem update --system --no-document && \
|
40
40
|
rvm all do gem update --no-document && \
|
41
41
|
rvm all do gem install bundler --no-document && \
|
42
|
-
rvm all do gem install --no-document rake-compiler:1.2.
|
42
|
+
rvm all do gem install --no-document rake-compiler:1.2.2 && \
|
43
43
|
find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw \
|
44
44
|
"
|
45
45
|
|
data/Dockerfile.mri.erb
CHANGED
@@ -114,7 +114,7 @@ RUN /home/rvm/mk_osxcross.sh
|
|
114
114
|
##
|
115
115
|
USER rvm
|
116
116
|
|
117
|
-
RUN bash -c "rvm all do gem install --no-document rake-compiler:1.2.
|
117
|
+
RUN bash -c "rvm all do gem install --no-document rake-compiler:1.2.2"
|
118
118
|
|
119
119
|
# Install rake-compiler's cross rubies in global dir instead of /root
|
120
120
|
RUN sudo mkdir -p /usr/local/rake-compiler && \
|
@@ -125,9 +125,9 @@ RUN sudo mkdir -p /usr/local/rake-compiler && \
|
|
125
125
|
COPY build/patches2 /home/rvm/patches/
|
126
126
|
RUN bash -c " \
|
127
127
|
for v in ${RVM_RUBIES} ; do \
|
128
|
-
cd /usr/local/rvm/gems/ruby-\$v/gems/rake-compiler-1.2.
|
129
|
-
echo applying patches to ruby-\$v /home/rvm/patches/rake-compiler-1.2.
|
130
|
-
( git apply /home/rvm/patches/rake-compiler-1.2.
|
128
|
+
cd /usr/local/rvm/gems/ruby-\$v/gems/rake-compiler-1.2.2 && \
|
129
|
+
echo applying patches to ruby-\$v /home/rvm/patches/rake-compiler-1.2.2/*.patch && \
|
130
|
+
( git apply /home/rvm/patches/rake-compiler-1.2.2/*.patch || true ) \
|
131
131
|
done \
|
132
132
|
"
|
133
133
|
|
@@ -209,9 +209,9 @@ RUN sed -i -- "s:/root/.rake-compiler:/usr/local/rake-compiler:g" /usr/local/rak
|
|
209
209
|
|
210
210
|
<% if platform=~/mingw/ %>
|
211
211
|
# Install wrappers for strip commands as a workaround for "Protocol error" in boot2docker.
|
212
|
-
COPY build/
|
212
|
+
COPY build/strip_wrapper_vbox /root/
|
213
213
|
RUN mv /usr/bin/<%= target %>-strip /usr/bin/<%= target %>-strip.bin && \
|
214
|
-
ln /root/
|
214
|
+
ln /root/strip_wrapper_vbox /usr/bin/<%= target %>-strip
|
215
215
|
|
216
216
|
# Use posix pthread for mingw so that C++ standard library for thread could be
|
217
217
|
# available such as std::thread, std::mutex, so on.
|
@@ -220,6 +220,13 @@ RUN printf "1\n" | update-alternatives --config <%= target %>-gcc && \
|
|
220
220
|
printf "1\n" | update-alternatives --config <%= target %>-g++
|
221
221
|
<% end %>
|
222
222
|
|
223
|
+
<% if platform =~ /darwin/ %>
|
224
|
+
# Install wrapper around strip to re-sign binaries (ad-hoc signature)
|
225
|
+
COPY build/strip_wrapper_codesign /root/
|
226
|
+
RUN mv /opt/osxcross/target/bin/<%= target %>-strip /opt/osxcross/target/bin/<%= target %>-strip.bin && \
|
227
|
+
ln /root/strip_wrapper_codesign /opt/osxcross/target/bin/<%= target %>-strip
|
228
|
+
<% end %>
|
229
|
+
|
223
230
|
<% if manylinux %>
|
224
231
|
# Enable modern compiler toolset of manylinux image
|
225
232
|
RUN echo "export PATH=\$DEVTOOLSET_ROOTPATH/usr/bin:\$PATH" >> /etc/rubybashrc
|
data/History.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.1 / 2023-10-14
|
2
|
+
------------------
|
3
|
+
|
4
|
+
* In the container, `strip` will re-codesign binaries on darwin. #104 (@flavorjones)
|
5
|
+
* Update to rake-compiler 1.2.2. #101 (@flavorjones)
|
6
|
+
|
7
|
+
|
8
|
+
1.3.0 / 2023-01-11
|
2
9
|
------------------
|
3
10
|
|
4
11
|
* Add Ruby 3.2 cross-compilation support.
|
data/Rakefile
CHANGED
data/build/mk_osxcross.sh
CHANGED
@@ -36,3 +36,8 @@ find /opt/osxcross/target/bin/ -name '*-apple-darwin[0-9]*' | sort | while read
|
|
36
36
|
# There's no objdump in osxcross but we can use llvm's
|
37
37
|
ln -s /usr/lib/llvm-10/bin/llvm-objdump /opt/osxcross/target/bin/x86_64-apple-darwin-objdump
|
38
38
|
ln -s /usr/lib/llvm-10/bin/llvm-objdump /opt/osxcross/target/bin/aarch64-apple-darwin-objdump
|
39
|
+
|
40
|
+
# install /usr/bin/codesign and make a symlink for codesign_allocate (the architecture doesn't matter)
|
41
|
+
git clone -q --depth=1 https://github.com/flavorjones/sigtool --branch flavorjones-fix-link-line-library-order
|
42
|
+
make -C sigtool install
|
43
|
+
ln -s /opt/osxcross/target/bin/x86_64-apple-darwin[0-9]*-codesign_allocate /usr/bin/codesign_allocate
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "fileutils"
|
2
2
|
require "rake"
|
3
|
+
require "digest/sha1"
|
3
4
|
|
4
5
|
module RakeCompilerDock
|
5
6
|
class << self
|
@@ -92,7 +93,7 @@ module RakeCompilerDock
|
|
92
93
|
# This also adds dependant intermediate tasks as prerequisites.
|
93
94
|
def define_common_tasks(vcs, workdir, task_prefix, plines=[])
|
94
95
|
vcs.map do |files, (lines, nvcs)|
|
95
|
-
fn = "#{task_prefix}#{files.join}"
|
96
|
+
fn = "#{task_prefix}#{Digest::SHA1.hexdigest(files.join)}"
|
96
97
|
File.write(File.join(workdir, fn), (plines + lines).join)
|
97
98
|
task fn do
|
98
99
|
docker_build(fn, workdir)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Stripping a signed Mach-O binary will invalidate the signature. To mimic what strip does on native
|
4
|
+
# Darwin, we install this wrapper to re-sign the binary after stripping it.
|
5
|
+
|
6
|
+
files = ARGV.reject { |f| f=~/^-/ }
|
7
|
+
|
8
|
+
strip = "#{File.basename($0)}.bin"
|
9
|
+
strip_options = ARGV.select{|f| f=~/^-/ }
|
10
|
+
strip_arguments = [strip] + strip_options + files
|
11
|
+
|
12
|
+
codesign = "codesign" # installed into /usr/bin by mk_osxcross.sh
|
13
|
+
codesign_options = ["-f", "-s-"]
|
14
|
+
codesign_arguments = [codesign] + codesign_options + files
|
15
|
+
|
16
|
+
system(*strip_arguments, exception: true)
|
17
|
+
system(*codesign_arguments, exception: true)
|
@@ -92,4 +92,18 @@ else
|
|
92
92
|
end
|
93
93
|
|
94
94
|
create_makefile("rcd_test/rcd_test_ext")
|
95
|
+
|
96
|
+
# exercise the strip command - this approach borrowed from grpc
|
97
|
+
strip_tool = RbConfig::CONFIG['STRIP']
|
98
|
+
strip_tool += ' -x' if RUBY_PLATFORM =~ /darwin/
|
99
|
+
File.open('Makefile.new', 'w') do |o|
|
100
|
+
o.puts 'hijack: all strip'
|
101
|
+
o.puts
|
102
|
+
o.write(File.read('Makefile'))
|
103
|
+
o.puts
|
104
|
+
o.puts 'strip: $(DLLIB)'
|
105
|
+
o.puts "\t$(ECHO) Stripping $(DLLIB)"
|
106
|
+
o.puts "\t$(Q) #{strip_tool} $(DLLIB)"
|
107
|
+
end
|
108
|
+
File.rename('Makefile.new', 'Makefile')
|
95
109
|
end
|
@@ -38,19 +38,23 @@ class TestParallelDockerBuild < Test::Unit::TestCase
|
|
38
38
|
FileUtils.rm_rf @tmpdir
|
39
39
|
end
|
40
40
|
|
41
|
+
private def hd(str)
|
42
|
+
"y" + Digest::SHA1.hexdigest(str)
|
43
|
+
end
|
44
|
+
|
41
45
|
def test_tasks
|
42
46
|
Dir.chdir(@tmpdir) do
|
43
47
|
RakeCompilerDock::ParallelDockerBuild.new(%w[ File0 File1 File2 File3 ], task_prefix: "y")
|
44
48
|
end
|
45
49
|
|
46
|
-
assert_operator Rake::Task["File0"].prerequisites, :include?, "
|
47
|
-
assert_operator Rake::Task["File1"].prerequisites, :include?, "
|
48
|
-
assert_operator Rake::Task["
|
49
|
-
assert_operator Rake::Task["
|
50
|
+
assert_operator Rake::Task["File0"].prerequisites, :include?, hd("File0File1")
|
51
|
+
assert_operator Rake::Task["File1"].prerequisites, :include?, hd("File1")
|
52
|
+
assert_operator Rake::Task[hd "File1"].prerequisites, :include?, hd("File0File1")
|
53
|
+
assert_operator Rake::Task[hd "File0File1"].prerequisites, :include?, hd("File0File1File2File3")
|
50
54
|
|
51
|
-
assert_operator Rake::Task["File2"].prerequisites, :include?, "
|
52
|
-
assert_operator Rake::Task["File3"].prerequisites, :include?, "
|
53
|
-
assert_operator Rake::Task["
|
55
|
+
assert_operator Rake::Task["File2"].prerequisites, :include?, hd("File2File3")
|
56
|
+
assert_operator Rake::Task["File3"].prerequisites, :include?, hd("File2File3")
|
57
|
+
assert_operator Rake::Task[hd "File2File3"].prerequisites, :include?, hd("File0File1File2File3")
|
54
58
|
end
|
55
59
|
|
56
60
|
def test_common_files
|
@@ -58,10 +62,10 @@ class TestParallelDockerBuild < Test::Unit::TestCase
|
|
58
62
|
RakeCompilerDock::ParallelDockerBuild.new(%w[ File0 File1 File2 File3 ], task_prefix: "y")
|
59
63
|
end
|
60
64
|
|
61
|
-
assert_equal "FROM a\nRUN a\nRUN d\nRUN f \\\ng\n", read_df("
|
62
|
-
assert_equal "FROM a\nRUN a\nRUN d\n", read_df("
|
63
|
-
assert_equal "FROM a\nRUN b\nRUN c\nRUN d\n", read_df("
|
64
|
-
assert_equal "FROM a\n", read_df("
|
65
|
+
assert_equal "FROM a\nRUN a\nRUN d\nRUN f \\\ng\n", read_df(hd "File1")
|
66
|
+
assert_equal "FROM a\nRUN a\nRUN d\n", read_df(hd "File0File1")
|
67
|
+
assert_equal "FROM a\nRUN b\nRUN c\nRUN d\n", read_df(hd "File2File3")
|
68
|
+
assert_equal "FROM a\n", read_df(hd "File0File1File2File3")
|
65
69
|
end
|
66
70
|
|
67
71
|
def read_df(fn)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-compiler-dock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Kanis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,6 +68,7 @@ executables:
|
|
68
68
|
extensions: []
|
69
69
|
extra_rdoc_files: []
|
70
70
|
files:
|
71
|
+
- ".dockerignore"
|
71
72
|
- ".github/workflows/ci.yml"
|
72
73
|
- ".github/workflows/publish-images.yml"
|
73
74
|
- ".gitignore"
|
@@ -87,12 +88,12 @@ files:
|
|
87
88
|
- build/parallel_docker_build.rb
|
88
89
|
- build/patches/ruby-2.5.9/no_sendfile.patch
|
89
90
|
- build/patches/ruby-3.1.3/no_sendfile.patch
|
90
|
-
- build/patches2/rake-compiler-1.2.
|
91
|
-
- build/patches2/rake-compiler-1.2.1/0005-make-miniruby.patch
|
91
|
+
- build/patches2/rake-compiler-1.2.2/0004-Enable-build-of-static-libruby.patch
|
92
92
|
- build/rcd-env.sh
|
93
93
|
- build/runas
|
94
94
|
- build/sigfw.c
|
95
|
-
- build/
|
95
|
+
- build/strip_wrapper_codesign
|
96
|
+
- build/strip_wrapper_vbox
|
96
97
|
- build/sudoers
|
97
98
|
- lib/rake_compiler_dock.rb
|
98
99
|
- lib/rake_compiler_dock/colors.rb
|
@@ -140,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
141
|
- !ruby/object:Gem::Version
|
141
142
|
version: '0'
|
142
143
|
requirements: []
|
143
|
-
rubygems_version: 3.4.
|
144
|
+
rubygems_version: 3.4.19
|
144
145
|
signing_key:
|
145
146
|
specification_version: 4
|
146
147
|
summary: Easy to use and reliable cross compiler environment for building Windows
|
@@ -1,19 +0,0 @@
|
|
1
|
-
fix(temp): rake-compiler explicitly builds miniruby first
|
2
|
-
|
3
|
-
See https://bugs.ruby-lang.org/issues/19239 for the upstream bug
|
4
|
-
report.
|
5
|
-
|
6
|
-
TODO: This patch can be removed if that's fixed in a 3.2.0 final release.
|
7
|
-
|
8
|
-
diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
|
9
|
-
index 8317a2a..d9bfe4c 100644
|
10
|
-
--- a/tasks/bin/cross-ruby.rake
|
11
|
-
+++ b/tasks/bin/cross-ruby.rake
|
12
|
-
@@ -129,6 +129,7 @@
|
13
|
-
|
14
|
-
# make
|
15
|
-
file "#{build_dir}/ruby.exe" => ["#{build_dir}/Makefile"] do |t|
|
16
|
-
+ sh "#{MAKE} miniruby", chdir: File.dirname(t.prerequisites.first)
|
17
|
-
sh MAKE, chdir: File.dirname(t.prerequisites.first)
|
18
|
-
end
|
19
|
-
|
File without changes
|
File without changes
|