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 732bb39 commit c0c6c47
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 @@ -135,6 +135,14 @@ def cmake_compile_flags(host)
]
end

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

#
# main
#
Expand Down Expand Up @@ -283,7 +291,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 c0c6c47

Please sign in to comment.