rake-compiler-dock 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0c53a8e4fde2b4ad57875b1e8ca11037cb9d9f101b451aaea52cdcef60dc56c
4
- data.tar.gz: 9be653f556704bc9725aeec603c45a83491f62dd71b7e5b5e4eccd1635864a4a
3
+ metadata.gz: 0330e7e3a9c83585df7ce3f77b4abfef615a7b86fbd9bf0da5a7f9bdf562acd3
4
+ data.tar.gz: c48c0b411ab4f3e6d52f475af134715976af211fbf5bd3379c5f4cadcc5af467
5
5
  SHA512:
6
- metadata.gz: 0c56bc4e310a1b5eb278ceb1da8b06a6bdbea9be2ddd6acf3be2c509afe60f542b8171e1c88cdcc6df9e21087028d91df1b46763f15c571d8ca71d4be6fdddc7
7
- data.tar.gz: 2b2a2504d952cfe709cf0dece45d8ef7c83ac768af42eac27ec888a36c913c9e5d2b07f0e90bdb839945d3d4570b6ada0abb01b797e1e6a5249a521c83d59a88
6
+ metadata.gz: 31aa3a2b77ff3572270ee64dcad2c9a7606b26638103ef2b1879cafc5a9bf79aff43c1ea0a139020956b8256e16acd15388b068b3efe60acabe5d7ad1096e929
7
+ data.tar.gz: 9a7ed2d9d49fab243c038ff094d4781f10608fed2c0a99745e31277c2946f659672f059d43da4a2cb48057b76ddd15b89978530d7435409c6fcc03e2add6a595
data/.dockerignore ADDED
@@ -0,0 +1,2 @@
1
+ cache/
2
+ cache*.tar
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.1 && \
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.1"
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.1 && \
129
- echo applying patches to ruby-\$v /home/rvm/patches/rake-compiler-1.2.1/*.patch && \
130
- ( git apply /home/rvm/patches/rake-compiler-1.2.1/*.patch || true ) \
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/strip_wrapper /root/
212
+ COPY build/strip_wrapper_vbox /root/
213
213
  RUN mv /usr/bin/<%= target %>-strip /usr/bin/<%= target %>-strip.bin && \
214
- ln /root/strip_wrapper /usr/bin/<%= target %>-strip
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.0 / 2022-01-11
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
@@ -4,6 +4,8 @@ require "rake_compiler_dock"
4
4
  require_relative "build/gem_helper"
5
5
  require_relative "build/parallel_docker_build"
6
6
 
7
+ CLEAN.include("tmp")
8
+
7
9
  RakeCompilerDock::GemHelper.install_tasks
8
10
 
9
11
  platforms = [
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)
@@ -1,4 +1,4 @@
1
1
  module RakeCompilerDock
2
- VERSION = "1.3.0"
3
- IMAGE_VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
+ IMAGE_VERSION = "1.3.1"
4
4
  end
@@ -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?, "yFile0File1"
47
- assert_operator Rake::Task["File1"].prerequisites, :include?, "yFile1"
48
- assert_operator Rake::Task["yFile1"].prerequisites, :include?, "yFile0File1"
49
- assert_operator Rake::Task["yFile0File1"].prerequisites, :include?, "yFile0File1File2File3"
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?, "yFile2File3"
52
- assert_operator Rake::Task["File3"].prerequisites, :include?, "yFile2File3"
53
- assert_operator Rake::Task["yFile2File3"].prerequisites, :include?, "yFile0File1File2File3"
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("yFile1")
62
- assert_equal "FROM a\nRUN a\nRUN d\n", read_df("yFile0File1")
63
- assert_equal "FROM a\nRUN b\nRUN c\nRUN d\n", read_df("yFile2File3")
64
- assert_equal "FROM a\n", read_df("yFile0File1File2File3")
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.0
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-01-12 00:00:00.000000000 Z
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.1/0004-Enable-build-of-static-libruby.patch
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/strip_wrapper
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.2
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