From 945b765c04f9aa7135fac8e90442f0cf3512b466 Mon Sep 17 00:00:00 2001 From: Lukasz Samson Date: Thu, 9 Jul 2026 23:28:05 +0200 Subject: [PATCH] Accept chardata paths in Mix.Release.make_boot_script/4 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. Co-Authored-By: Claude Fable 5 --- lib/mix/lib/mix/release.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/mix/lib/mix/release.ex b/lib/mix/lib/mix/release.ex index 9a399a04169..dc0906c38f8 100644 --- a/lib/mix/lib/mix/release.ex +++ b/lib/mix/lib/mix/release.ex @@ -609,6 +609,8 @@ defmodule Mix.Release do @spec make_boot_script(t, Path.t(), [{application(), mode()}], [String.t()]) :: :ok | {:error, String.t()} def make_boot_script(release, path, modes, prepend_paths \\ []) do + path = IO.chardata_to_string(path) + with {:ok, rel_spec} <- build_release_spec(release, modes) do File.write!(path <> ".rel", consultable(rel_spec))