From b5598e2632be765e972f6a3b8a84a3c045426002 Mon Sep 17 00:00:00 2001 From: Jean Parpaillon Date: Fri, 11 Sep 2026 12:00:24 +0200 Subject: [PATCH 1/3] Ignore macos tests when not on macos --- lib/package/macos.ex | 4 +++- test/test_helper.exs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/package/macos.ex b/lib/package/macos.ex index 8eb5250..a2ce420 100644 --- a/lib/package/macos.ex +++ b/lib/package/macos.ex @@ -690,6 +690,8 @@ defmodule Desktop.Deployment.Package.MacOS do end defp uid_to_string(uid) when is_list(uid), do: List.to_string(uid) + # DirectoryString as decoded by :public_key, e.g. {:utf8String, "..."} + defp uid_to_string({_type, uid}), do: uid_to_string(uid) defp uid_to_string(uid), do: to_string(uid) def maybe_import_p12(file, password, uids, keychain_password \\ nil) do @@ -796,7 +798,7 @@ defmodule Desktop.Deployment.Package.MacOS do end defp scan({:AttributeTypeAndValue, @friendly_attribute, friendly}) do - case Regex.scan(~r/\(([^)]+)\)$/, friendly) do + case Regex.scan(~r/\(([^)]+)\)$/, uid_to_string(friendly)) do [[_full, uid]] -> [uid] _ -> [] end diff --git a/test/test_helper.exs b/test/test_helper.exs index 869559e..4397083 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1 +1,2 @@ -ExUnit.start() +exclude = if match?({:unix, :darwin}, :os.type()), do: [], else: [:macos] +ExUnit.start(exclude: exclude) From 866012964c1b636387e8402ddf1dffb1b0593de2 Mon Sep 17 00:00:00 2001 From: Jean Parpaillon Date: Fri, 11 Sep 2026 12:00:48 +0200 Subject: [PATCH 2/3] Bump httpoison and poison Fixes #23 --- mix.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index e53244d..faabf56 100644 --- a/mix.exs +++ b/mix.exs @@ -38,11 +38,11 @@ defmodule Desktop.Deployment.MixProject do defp deps do [ # Credo - {:httpoison, "~> 2.0", runtime: false}, + {:httpoison, "~> 3.0", runtime: false}, {:credo, "~> 1.5", only: [:dev, :test], runtime: false}, # 1.3.0+ (icon embedding) is on GitHub; switch to Hex once published. {:libpe, github: "elixir-desktop/libpe", branch: "master"}, - {:poison, "~> 3.0"} + {:poison, "~> 6.0"} ] end end From b1eb81a8124f2e558afdc2b197a99b69bfd04ed2 Mon Sep 17 00:00:00 2001 From: Jean Parpaillon Date: Fri, 11 Sep 2026 12:01:21 +0200 Subject: [PATCH 3/3] Fix PEM handling on MacOSX uid_to_string/1 now unwraps {_type, string} DirectoryString tuples, and macos.ex:801 runs the CN through it before the regex. --- test/codesign_test.exs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/codesign_test.exs b/test/codesign_test.exs index 2b3e9f9..8fd6c81 100644 --- a/test/codesign_test.exs +++ b/test/codesign_test.exs @@ -1,6 +1,8 @@ defmodule CodesignTest do use ExUnit.Case + @moduletag :macos + test "codesign a new binary" do {_, 0} = System.cmd("gcc", ["test/priv/main.c", "-o", "unsigned_main"]) Desktop.Deployment.Package.MacOS.codesign_executable("unsigned_main")