crbelaus/bun

`:zip.unzip/2` now returns directory name too in Erlang 27.1

natrys opened this issue · 2 comments

The changelog only mentions this about :zip.list_dir/2, but I am seeing the effect for :zip.unzip/2 too.

So here:

bun/lib/bun.ex

Lines 208 to 212 in 75aa655

download_path =
case :zip.unzip(zip, cwd: to_charlist(tmp_dir)) do
{:ok, download_path} -> download_path
other -> raise "couldn't unpack archive: #{inspect(other)}"
end

Before download_path was say [~c"/tmp/bun-linux-x64/bun"], now its [~c"/tmp/bun-linux-x64/", ~c"/tmp/bun-linux-x64/bun"]. This is now failing in File.cp! later (as an aside, it's not because it got wrong type, but apparently for anything that expects chardata but is given something else, elixir attempts implicit conversion which for list means joining everything which produces nonsense path here, this just happened to be not a problem with one element list).

Another arm in the case pattern should fix it in backward compatible way I guess, lmk if you want me to create PR.

Thanks for the heads up @natrys. This should be fixed on #26

I've just released Bun 1.3.2 with support for OTP 27.1