fix(embedding): embedding GCC fails when paths do not require sanitizing

It seems homebrew bottle of GCC for macOS Monterey (12.0) have changed their
directory structure slightly, which caused an issue were we were trying
to rename a specific directory to the same name it already had.

This behavior is still required as it looks like GCC on macOS
Catalina (10.15), the GCC homebrew bottle still uses the old directory
structure.
This commit is contained in:
2021-11-24 21:39:03 +00:00
parent 9c29f721b4
commit 8a467b0d43

View File

@@ -966,7 +966,9 @@ class GccLibEmbedder < AbstractEmbedder
FileUtils.cp_r(source_dir, target_dir)
FileUtils.rm(Dir[File.join(target_dir, '**', '.DS_Store')], force: true)
FileUtils.chmod_R('u+w', target_dir)
FileUtils.mv(source_darwin_dir, target_darwin_dir)
if source_darwin_dir != target_darwin_dir
FileUtils.mv(source_darwin_dir, target_darwin_dir)
end
env_setup = ERB.new(NATIVE_COMP_ENV_VAR_TPL).result(gcc_info.get_binding)
return if File.exist?(site_start_el_file) &&