rake-compiler 1.1.4 → 1.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2df6d32ecd0f965fa8cc4bcf0e9f759bfe8e73ec5bf63f87999c1eef85bbb5b9
4
- data.tar.gz: 3d2667098cfec7225cdb964a3a583057cde8e4b4567bf0f55fa3ea536274c1ae
3
+ metadata.gz: 56dcf0e1f328862dc1b7b48d04288ee04cc36faab9d1a598b1bafa242673314c
4
+ data.tar.gz: 8283eec481c7d7adb3589de86a205c9747f4a428e3a2a8d9485c930f1ac58d17
5
5
  SHA512:
6
- metadata.gz: f43f6999c6303f0b7bae2557aed5491c3d075a85708fc03df61012c345f7bfdc5388c85570d23d30a50d43d21243704f0b4d0041e251920e73471ff8a62d810c
7
- data.tar.gz: 826c274c9cf1a6d5bb4a7e8c46e933e0aa144c18a02f8c5fe42b7f845ee346d150cfd6111a6073d5d98bcd18d645f2632a6dd640d4bb882d7153a5fee9073f00
6
+ metadata.gz: '08f90e5666ece41d70892f20cbc06ff42d8d2ef3f46ad1669ed1e75d3b6e96f2867c4072481a20656b8aaa90208df2a34cfc14e16a9510bba320829aa683b2c3'
7
+ data.tar.gz: 69426e3024fcb826bed92b86a9a63ad4b6b1203dd202758decb2e93a73f76cb7d7724492f56be61bb33dfb18b11cdbae796da87e1b02557c9bc32b59412a70f1
data/History.md CHANGED
@@ -1,3 +1,26 @@
1
+ ### 1.1.8 / 2022-01-18
2
+
3
+ * Fixes:
4
+ * Fix wrong `required_ruby_version` when some `RUBY_CC_VERSION`s are missing.
5
+ [#198](https://github.com/rake-compiler/rake-compiler/issues/198) [Patch by Lars Kanis]
6
+
7
+ ### 1.1.7 / 2022-01-04
8
+
9
+ * Fixes:
10
+ * Fix binary paths for staging and clobber.
11
+ [#197](https://github.com/rake-compiler/rake-compiler/issues/197) [Patch by konsolebox]
12
+
13
+ ### 1.1.6 / 2021-12-12
14
+
15
+ * Fixes:
16
+ * Fix a regression bug that `Symbol` can't be used for `name` of `Rake::ExtensionTask.new`.
17
+
18
+ ### 1.1.5 / 2021-12-12
19
+
20
+ * Fixes:
21
+ * Fix a regression bug that wrong install location is used when name that includes `/` is specified to `Rake::ExtensionTask.new`.
22
+ [#196](https://github.com/rake-compiler/rake-compiler/issues/196) [Reported by konsolebox]
23
+
1
24
  ### 1.1.4 / 2021-12-11
2
25
 
3
26
  * Fixes:
@@ -40,6 +40,9 @@ module Rake
40
40
  @tmp_dir = 'tmp'
41
41
  @ext_dir = "ext/#{@name}"
42
42
  @lib_dir = 'lib'
43
+ if @name and File.dirname(@name.to_s) != "."
44
+ @lib_dir += "/#{File.dirname(@name.to_s)}"
45
+ end
43
46
  @config_options = []
44
47
  @extra_options = ARGV.select { |i| i =~ /\A--?/ }
45
48
  end
@@ -82,9 +82,12 @@ module Rake
82
82
  private
83
83
  # copy other gem files to staging directory
84
84
  def define_staging_file_tasks(files, lib_path, stage_path, platf, ruby_ver)
85
+ # lib_binary_path
86
+ lib_binary_path = "#{lib_path}/#{File.basename(binary(platf))}"
87
+
85
88
  files.each do |gem_file|
86
89
  # ignore directories and the binary extension
87
- next if File.directory?(gem_file) || gem_file == "#{lib_path}/#{binary(platf)}"
90
+ next if File.directory?(gem_file) || gem_file == lib_binary_path
88
91
  stage_file = "#{stage_path}/#{gem_file}"
89
92
 
90
93
  # copy each file from base to stage directory
@@ -105,12 +108,13 @@ module Rake
105
108
  platf = for_platform || platform
106
109
 
107
110
  binary_path = binary(platf)
111
+ binary_base_name = File.basename(binary_path)
108
112
 
109
113
  # lib_path
110
114
  lib_path = lib_dir
111
115
 
112
- lib_binary_path = "#{lib_path}/#{binary_path}"
113
- lib_binary_dir_path = File.dirname(lib_binary_path)
116
+ # lib_binary_path
117
+ lib_binary_path = "#{lib_path}/#{binary_base_name}"
114
118
 
115
119
  # tmp_path
116
120
  tmp_path = "#{@tmp_dir}/#{platf}/#{@name}/#{ruby_ver}"
@@ -119,19 +123,19 @@ module Rake
119
123
  siteconf_path = "#{tmp_path}/.rake-compiler-siteconf.rb"
120
124
  tmp_binary_path = "#{tmp_path}/#{binary_path}"
121
125
  tmp_binary_dir_path = File.dirname(tmp_binary_path)
122
- stage_binary_path = "#{stage_path}/#{lib_path}/#{binary_path}"
126
+ stage_binary_path = "#{stage_path}/#{lib_binary_path}"
123
127
  stage_binary_dir_path = File.dirname(stage_binary_path)
124
128
 
125
129
  # cleanup and clobbering
126
130
  CLEAN.include(tmp_path)
127
131
  CLEAN.include(stage_path)
128
- CLOBBER.include("#{lib_path}/#{binary(platf)}")
132
+ CLOBBER.include(lib_binary_path)
129
133
  CLOBBER.include("#{@tmp_dir}")
130
134
 
131
135
  # directories we need
132
136
  directory tmp_path
133
137
  directory tmp_binary_dir_path
134
- directory lib_binary_dir_path
138
+ directory lib_path
135
139
  directory stage_binary_dir_path
136
140
 
137
141
  directory File.dirname(siteconf_path)
@@ -150,7 +154,7 @@ module Rake
150
154
 
151
155
  # copy binary from temporary location to final lib
152
156
  # tmp/extension_name/extension_name.{so,bundle} => lib/
153
- task "copy:#{@name}:#{platf}:#{ruby_ver}" => [lib_binary_dir_path, tmp_binary_path, "#{tmp_path}/Makefile"] do
157
+ task "copy:#{@name}:#{platf}:#{ruby_ver}" => [lib_path, tmp_binary_path, "#{tmp_path}/Makefile"] do
154
158
  # install in lib for native platform only
155
159
  unless for_platform
156
160
  sh "#{make} install target_prefix=", chdir: tmp_path
@@ -175,8 +179,8 @@ Java extension should be preferred.
175
179
 
176
180
  chdir tmp_path do
177
181
  sh make
178
- if binary_path != File.basename(binary_path)
179
- cp File.basename(binary_path), binary_path
182
+ if binary_path != binary_base_name
183
+ cp binary_base_name, binary_path
180
184
  end
181
185
  end
182
186
  end
@@ -237,7 +241,7 @@ Java extension should be preferred.
237
241
  # platform matches the indicated one.
238
242
  if platf == RUBY_PLATFORM then
239
243
  # ensure file is always copied
240
- file "#{lib_path}/#{binary_path}" => ["copy:#{name}:#{platf}:#{ruby_ver}"]
244
+ file lib_binary_path => ["copy:#{name}:#{platf}:#{ruby_ver}"]
241
245
 
242
246
  task "compile:#{@name}" => ["compile:#{@name}:#{platf}"]
243
247
  task "compile" => ["compile:#{platf}"]
@@ -253,6 +257,9 @@ Java extension should be preferred.
253
257
  # lib_path
254
258
  lib_path = lib_dir
255
259
 
260
+ # lib_binary_path
261
+ lib_binary_path = "#{lib_path}/#{File.basename(binary(platf))}"
262
+
256
263
  # Update compiled platform/version combinations
257
264
  @ruby_versions_per_platform[platf] << ruby_ver
258
265
 
@@ -332,13 +339,13 @@ Java extension should be preferred.
332
339
  end
333
340
 
334
341
  # add binaries to the dependency chain
335
- task "native:#{@gem_spec.name}:#{platf}" => ["#{stage_path}/#{lib_path}/#{binary(platf)}"]
342
+ task "native:#{@gem_spec.name}:#{platf}" => ["#{stage_path}/#{lib_binary_path}"]
336
343
 
337
344
  # ensure the extension get copied
338
- unless Rake::Task.task_defined?("#{lib_path}/#{binary(platf)}") then
339
- file "#{lib_path}/#{binary(platf)}" => ["copy:#{@name}:#{platf}:#{ruby_ver}"]
345
+ unless Rake::Task.task_defined?(lib_binary_path) then
346
+ file lib_binary_path => ["copy:#{@name}:#{platf}:#{ruby_ver}"]
340
347
  end
341
- file "#{stage_path}/#{lib_dir}/#{binary(platf)}" => ["copy:#{@name}:#{platf}:#{ruby_ver}"]
348
+ file "#{stage_path}/#{lib_binary_path}" => ["copy:#{@name}:#{platf}:#{ruby_ver}"]
342
349
 
343
350
  # Allow segmented packaging by platform (open door for 'cross compile')
344
351
  task "native:#{platf}" => ["native:#{@gem_spec.name}:#{platf}"]
@@ -370,9 +377,6 @@ Java extension should be preferred.
370
377
  @lib_dir = "#{@lib_dir}/#{$1}"
371
378
  end
372
379
 
373
- # Update cross compiled platform/version combinations
374
- @ruby_versions_per_platform[for_platform] << version
375
-
376
380
  define_cross_platform_tasks_with_version(for_platform, version)
377
381
 
378
382
  # restore lib_dir
@@ -397,6 +401,9 @@ Java extension should be preferred.
397
401
  # lib_path
398
402
  lib_path = lib_dir
399
403
 
404
+ # lib_binary_path
405
+ lib_binary_path = "#{lib_path}/#{File.basename(binary(for_platform))}"
406
+
400
407
  unless rbconfig_file = config_file["rbconfig-#{for_platform}-#{ruby_ver}"] then
401
408
  warn "no configuration section for specified version of Ruby (rbconfig-#{for_platform}-#{ruby_ver})"
402
409
  return
@@ -463,12 +470,12 @@ Java extension should be preferred.
463
470
 
464
471
  # clear lib/binary dependencies and trigger cross platform ones
465
472
  # check if lib/binary is defined (damn bundle versus so versus dll)
466
- if Rake::Task.task_defined?("#{lib_path}/#{binary(for_platform)}") then
467
- Rake::Task["#{lib_path}/#{binary(for_platform)}"].prerequisites.clear
473
+ if Rake::Task.task_defined?(lib_binary_path) then
474
+ Rake::Task[lib_binary_path].prerequisites.clear
468
475
  end
469
476
 
470
477
  # FIXME: targeting multiple platforms copies the file twice
471
- file "#{lib_path}/#{binary(for_platform)}" => ["copy:#{@name}:#{for_platform}:#{ruby_ver}"]
478
+ file lib_binary_path => ["copy:#{@name}:#{for_platform}:#{ruby_ver}"]
472
479
 
473
480
  # if everything for native task is in place
474
481
  if @gem_spec && @gem_spec.platform == 'ruby' then
@@ -53,15 +53,20 @@ module Rake
53
53
  # platform usage
54
54
  platf = for_platform || platform
55
55
 
56
+ binary_path = binary(platf)
57
+
56
58
  # lib_path
57
59
  lib_path = lib_dir
58
60
 
61
+ # lib_binary_path
62
+ lib_binary_path = "#{lib_path}/#{File.basename(binary_path)}"
63
+
59
64
  # tmp_path
60
65
  tmp_path = "#{@tmp_dir}/#{platf}/#{@name}"
61
66
 
62
67
  # cleanup and clobbering
63
68
  CLEAN.include(tmp_path)
64
- CLOBBER.include("#{lib_path}/#{binary(platf)}")
69
+ CLOBBER.include(lib_binary_path)
65
70
  CLOBBER.include("#{@tmp_dir}")
66
71
 
67
72
  # directories we need
@@ -70,11 +75,11 @@ module Rake
70
75
 
71
76
  # copy binary from temporary location to final lib
72
77
  # tmp/extension_name/extension_name.{so,bundle} => lib/
73
- task "copy:#{@name}:#{platf}" => [lib_path, "#{tmp_path}/#{binary(platf)}"] do
74
- install "#{tmp_path}/#{binary(platf)}", "#{lib_path}/#{binary(platf)}"
78
+ task "copy:#{@name}:#{platf}" => [lib_path, "#{tmp_path}/#{binary_path}"] do
79
+ install "#{tmp_path}/#{binary_path}", lib_binary_path
75
80
  end
76
81
 
77
- file "#{tmp_path}/#{binary(platf)}" => "#{tmp_path}/.build" do
82
+ file "#{tmp_path}/#{binary_path}" => "#{tmp_path}/.build" do
78
83
 
79
84
  class_files = FileList["#{tmp_path}/**/*.class"].
80
85
  gsub("#{tmp_path}/", '')
@@ -86,7 +91,7 @@ module Rake
86
91
  ["-C #{tmp_path}", path]
87
92
  }.flatten
88
93
 
89
- sh "jar cf #{tmp_path}/#{binary(platf)} #{args.join(' ')}"
94
+ sh "jar cf #{tmp_path}/#{binary_path} #{args.join(' ')}"
90
95
  end
91
96
 
92
97
  file "#{tmp_path}/.build" => [tmp_path] + source_files do
@@ -137,7 +142,7 @@ execute the Rake compilation task using the JRuby interpreter.
137
142
  # platform matches the indicated one.
138
143
  if platf == RUBY_PLATFORM then
139
144
  # ensure file is always copied
140
- file "#{lib_path}/#{binary(platf)}" => ["copy:#{name}:#{platf}"]
145
+ file lib_binary_path => ["copy:#{name}:#{platf}"]
141
146
 
142
147
  task "compile:#{@name}" => ["compile:#{@name}:#{platf}"]
143
148
  task "compile" => ["compile:#{platf}"]
@@ -184,12 +189,15 @@ execute the Rake compilation task using the JRuby interpreter.
184
189
  end
185
190
  end
186
191
 
192
+ # lib_binary_path
193
+ lib_binary_path = "#{lib_path}/#{File.basename(binary(platform))}"
194
+
187
195
  # add binaries to the dependency chain
188
- task "java:#{@gem_spec.name}" => ["#{lib_path}/#{binary(platform)}"]
196
+ task "java:#{@gem_spec.name}" => [lib_binary_path]
189
197
 
190
198
  # ensure the extension get copied
191
- unless Rake::Task.task_defined?("#{lib_path}/#{binary(platform)}") then
192
- file "#{lib_path}/#{binary(platform)}" => ["copy:#{name}:#{platform}"]
199
+ unless Rake::Task.task_defined?(lib_binary_path) then
200
+ file lib_binary_path => ["copy:#{name}:#{platform}"]
193
201
  end
194
202
 
195
203
  task 'java' => ["java:#{@gem_spec.name}"]
@@ -456,14 +456,17 @@ describe Rake::ExtensionTask do
456
456
 
457
457
  it "should set required_ruby_version from RUBY_CC_VERSION, set platform, clear extensions but keep metadata" do
458
458
  platforms = ["x86-mingw32", "x64-mingw32"]
459
- ruby_cc_versions = ["1.8.6", "2.1.10", "2.2.6", "2.3.3", "2.10.1"]
459
+ ruby_cc_versions = ["1.8.6", "2.1.10", "2.2.6", "2.3.3", "2.10.1", "2.11.0"]
460
460
  ENV["RUBY_CC_VERSION"] = ruby_cc_versions.join(":")
461
461
  config = Hash.new
462
462
  ruby_cc_versions.each do |ruby_cc_version|
463
463
  platforms.each do |platform|
464
+ unless platform == "x64-mingw32" && ruby_cc_version == "2.11.0"
465
+ rbconf = "/rubies/#{ruby_cc_version}/rbconfig.rb"
466
+ end
464
467
  allow(config).to receive(:[]).
465
468
  with("rbconfig-#{platform}-#{ruby_cc_version}").
466
- and_return("/rubies/#{ruby_cc_version}/rbconfig.rb")
469
+ and_return(rbconf)
467
470
  end
468
471
  end
469
472
  allow(YAML).to receive(:load_file).and_return(config)
@@ -490,7 +493,7 @@ describe Rake::ExtensionTask do
490
493
  end
491
494
 
492
495
  expected_required_ruby_versions = [
493
- Gem::Requirement.new([">= 1.8", "< 2.11.dev"]),
496
+ Gem::Requirement.new([">= 1.8", "< 2.12.dev"]),
494
497
  Gem::Requirement.new([">= 1.8", "< 2.11.dev"]),
495
498
  ]
496
499
  cross_specs.collect(&:required_ruby_version).should == expected_required_ruby_versions
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-12-11 00:00:00.000000000 Z
12
+ date: 2022-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: 1.8.23
147
147
  requirements: []
148
- rubygems_version: 3.3.0.dev
148
+ rubygems_version: 3.4.0.dev
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Rake-based Ruby Extension (C, Java) task generator.