-
Notifications
You must be signed in to change notification settings - Fork 8
!Fix :public_key loading in Mix tasks for macOS signing #16
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
Merged
dominicletz
merged 4 commits into
elixir-desktop:main
from
dominicletz:fix/ensure-public-key-for-mix-tasks
Jul 17, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3798ddb
!Fix :public_key loading in Mix tasks for macOS signing.
cursoragent d1822bd
Require Elixir 1.15+ and fix locate_uid test cleanup.
dominicletz 314bb94
Include Elixir version in asdf CI cache key.
dominicletz 088734f
Run locate_uid public_key regression test in CI.
dominicletz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| defmodule LocateUidTest do | ||
| use ExUnit.Case | ||
|
|
||
| alias Desktop.Deployment.Package.MacOS | ||
|
|
||
| # Regression for: | ||
| # UndefinedFunctionError: function :public_key.pem_decode/1 is undefined | ||
| # (module :public_key is not available) | ||
| # | ||
| # That failure happened in Mix task context when only Application.ensure_all_started/1 | ||
| # was used (and its error ignored). locate_uid/1 must load :public_key via | ||
| # Mix.ensure_application!/1 and then start it before calling pem_decode/1. | ||
| test "locate_uid/1 can decode a PEM after ensuring :public_key is available" do | ||
| dir = System.tmp_dir!() | ||
| key = Path.join(dir, "desktop-deployment-test-key.pem") | ||
| cert = Path.join(dir, "desktop-deployment-test-cert.pem") | ||
|
|
||
| try do | ||
| {_, 0} = | ||
| System.cmd("openssl", [ | ||
| "req", | ||
| "-x509", | ||
| "-newkey", | ||
| "rsa:2048", | ||
| "-keyout", | ||
| key, | ||
| "-out", | ||
| cert, | ||
| "-days", | ||
| "1", | ||
| "-nodes", | ||
| "-subj", | ||
| "/CN=Desktop Deployment Test (TESTUID)" | ||
| ]) | ||
|
|
||
| # Force ensure_public_key!/0 to re-start :public_key the way a Mix task would | ||
| # after the app is not already up. | ||
| _ = Application.stop(:public_key) | ||
|
|
||
| # Must not raise UndefinedFunctionError for :public_key.pem_decode/1 | ||
| uids = MacOS.locate_uid(cert) | ||
| assert is_list(uids) | ||
| assert "TESTUID" in uids | ||
| after | ||
| File.rm(key) | ||
| File.rm(cert) | ||
| end | ||
| end | ||
|
dominicletz marked this conversation as resolved.
|
||
| end | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.