Skip to content

Commit 5c3edb6

Browse files
committed
Put original versions of modified host Ruby files back
1 parent 8ec48af commit 5c3edb6

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

tasks/build.rake

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,20 @@ namespace :vox do
1616
cmd = "bundle exec build #{project} #{platform} --engine #{engine}"
1717

1818
FileUtils.rm_rf('C:/ProgramFiles64Folder/') if platform =~ /^windows-/
19-
20-
run_command(cmd, silent: false, print_command: true, report_status: true)
19+
libdir = `ruby -e "require 'rbconfig'; puts RbConfig::CONFIG['rubylibdir']"`.chomp
20+
begin
21+
run_command(cmd, silent: false, print_command: true, report_status: true)
22+
ensure
23+
# During the build process for macos-all-x86_64, we patch two files in the
24+
# host ruby installation. If we don't revert those changes, subsequent tasks
25+
# like uploading to S3 wil fail.
26+
if platform == 'macos-all-x86_64'
27+
puts 'Reverting changes to host ruby installation...'
28+
['rubygems/ext/builder.rb', 'rubygems/basic_specification.rb'].each do |f|
29+
FileUtils.rm_f("#{libdir}/#{f}")
30+
FileUtils.mv("#{libdir}/#{f}.orig", "#{libdir}/#{f}")
31+
end
32+
end
33+
end
2134
end
2235
end

0 commit comments

Comments
 (0)