ruby-changes:43985
From: nobu <ko1@a...>
Date: Fri, 2 Sep 2016 00:55:19 +0900 (JST)
Subject: [ruby-changes:43985] nobu:r56057 (trunk): extmk.rb: fix conflict of timestamp files
nobu 2016-09-02 00:55:13 +0900 (Fri, 02 Sep 2016) New Revision: 56057 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56057 Log: extmk.rb: fix conflict of timestamp files * ext/extmk.rb (timestamp_file): move extmk.rb specific tricks from lib/mkmf.rb. keep RUBYCOMMONDIR prefix not to conflict with a timestamp file in the toplevel. Modified files: trunk/ChangeLog trunk/ext/extmk.rb trunk/lib/mkmf.rb Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 56056) +++ lib/mkmf.rb (revision 56057) @@ -2025,9 +2025,9 @@ preload = #{defined?($preload) && $prelo https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2025 pat[n] = $` if /\$\(target_prefix\)\z/ =~ d end name = name.gsub(/\$\((#{pat.keys.join("|")})\)/) {pat[$1]+target_prefix} - name.sub!(/\A\$\((?:extout|RUBYCOMMONDIR)\)\/*/, '') name.sub!(/(\$\((?:site)?arch\))\/*/, '') arch = $1 || '' + name.chomp!('/') name = name.gsub(/(\$[({]|[})])|(\/+)|[^-.\w]+/) {$1 ? "" : $2 ? ".-." : "_"} File.join("$(TIMESTAMP_DIR)", arch, "#{name.sub(/\A(?=.)/, '.')}.time") end Index: ext/extmk.rb =================================================================== --- ext/extmk.rb (revision 56056) +++ ext/extmk.rb (revision 56057) @@ -548,6 +548,12 @@ gems = Dir.glob(File.join(ext_prefix, ($ https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L548 with_config(ext, &cond) }.sort +extend Module.new { + def timestamp_file(name, target_prefix = nil) + super.sub(%r[/\.extout\.(?:-\.)?], '/.') + end +} + dir = Dir.pwd FileUtils::makedirs('ext') Dir::chdir('ext') @@ -570,7 +576,7 @@ Dir.chdir('gems') https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L576 extout = $extout unless gems.empty? def self.timestamp_file(name, target_prefix = nil) - name = @sodir if name == '$(TARGET_SO_DIR)' + name = "$(arch)/gems/#{@gemname}" if name == '$(TARGET_SO_DIR)' super end @@ -578,7 +584,7 @@ unless gems.empty? https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L584 super(*args) do |conf| conf.find do |s| s.sub!(/^(TARGET_SO_DIR *= *)\$\(RUBYARCHDIR\)/) { - $1 + @sodir + "#{$1}$(extout)/gems/$(arch)/#{@gemname}" } end conf << %{ @@ -598,7 +604,7 @@ $(build_complete): $(TARGET_SO) https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L604 end gems.each do |d| $extout = extout.dup - @sodir = "$(extout)/gems/$(arch)/#{d[%r{\A[^/]+}]}" + @gemname = d[%r{\A[^/]+}] extmake(d, 'gems') end $extout = extout Index: ChangeLog =================================================================== --- ChangeLog (revision 56056) +++ ChangeLog (revision 56057) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Sep 2 00:55:11 2016 Nobuyoshi Nakada <nobu@r...> + + * ext/extmk.rb (timestamp_file): move extmk.rb specific tricks + from lib/mkmf.rb. keep RUBYCOMMONDIR prefix not to conflict + with a timestamp file in the toplevel. + Thu Sep 1 14:24:16 2016 Nobuyoshi Nakada <nobu@r...> * ext/extmk.rb (gems): move dirty hacks for bundled gems from -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/