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 authored and mudge committed Jul 25, 2023
1 parent 7f64623 commit 21b5a0b
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 @@ -82,6 +82,14 @@ def target_host
host.gsub(/i386/, "i686")
end

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

#
# main
#
Expand Down Expand Up @@ -229,7 +237,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 21b5a0b

Please sign in to comment.