Skip to content

Commit 48c124a

Browse files
authored
Accept chardata paths in Mix.Release.make_boot_script/4 (#15573)
Found by re-running the type checker over function bodies with spec-derived argument domains (#15559): the path argument is spec'd Path.t() (chardata), but the body applies <> and String.to_charlist/1 to it, so a charlist path -- valid per the spec -- raised ArgumentError. Normalize with IO.chardata_to_string/1 first, as the Path module functions do.
1 parent b7a82bf commit 48c124a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/mix/lib/mix/release.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,8 @@ defmodule Mix.Release do
609609
@spec make_boot_script(t, Path.t(), [{application(), mode()}], [String.t()]) ::
610610
:ok | {:error, String.t()}
611611
def make_boot_script(release, path, modes, prepend_paths \\ []) do
612+
path = IO.chardata_to_string(path)
613+
612614
with {:ok, rel_spec} <- build_release_spec(release, modes) do
613615
File.write!(path <> ".rel", consultable(rel_spec))
614616

0 commit comments

Comments
 (0)