Skip to content

Commit

Permalink
Use a temporary directory for cooking recipe
Browse files Browse the repository at this point in the history
This reduces the filename lengths since Windows can hit a limit of 250
characters (CMAKE_OBJECT_PATH_MAX).
  • Loading branch information
stanhu committed Jul 18, 2023
1 parent 6fec511 commit 2cab7a7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ext/re2/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ def delete_cmake_generator_option!(options)
indices.reverse_each { |index| options.delete_at(index) }
end

def with_temp_dir
Dir.mktmpdir do |temp_dir|
Dir.chdir(temp_dir) do
yield
end
end
end

#
# main
#
Expand Down Expand Up @@ -307,7 +315,9 @@ def process_recipe(name, version)
end
end

recipe.cook
# Use a temporary base directory to reduce filename lengths since
# Windows can hit a limit of 250 characters (CMAKE_OBJECT_PATH_MAX).
with_temp_dir { recipe.cook }

FileUtils.touch(checkpoint)
end
Expand Down

0 comments on commit 2cab7a7

Please sign in to comment.