Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 7zz if available #159

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/burrito.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ defmodule Burrito do
exit(1)
end

if Enum.any?(~w(7z), &(System.find_executable(&1) == nil)) do
if Enum.any?(~w(7z 7zz), &(System.find_executable(&1) == nil)) do
Log.warning(
:build,
"We couldn't find 7z in your PATH, 7z is required to build Windows releases. They will fail if you don't fix this!"
"We couldn't find 7z/7zz in your PATH, 7z/7zz is required to build Windows releases. They will fail if you don't fix this!"
)
end

Expand Down
8 changes: 7 additions & 1 deletion lib/util/default_erts_resolver.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@ defmodule Burrito.Util.DefaultERTSResolver do
extraction_path = System.tmp_dir!() |> Path.join(["unpacked_erts_#{random_id}"])
File.mkdir_p!(extraction_path)

seven_z =
with nil <- System.find_executable("7zz"),
nil <- System.find_executable("7z") do
raise "Couldn't find 7z/7zz"
end

# we use 7z to unpack windows setup files, otherwise we use tar
command =
case target.os do
:windows -> ~c"7z x #{tar_dest_path} -o#{extraction_path}/otp-windows/"
:windows -> ~c"#{seven_z} x #{tar_dest_path} -o#{extraction_path}/otp-windows/"
_ -> ~c"tar xzf #{tar_dest_path} -C #{extraction_path}"
end

Expand Down
Loading