Skip to content
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

test: add test for code signing on macOS #52

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

RaisinTen
Copy link
Contributor

Signed-off-by: Darshan Sen [email protected]

test/cli.mjs Outdated
} else if (process.platform === "win32") {
let signtoolFound = false;
try {
execSync("where signtool");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, signtool isn't globally accessible on the Windows CI runner:
https://app.circleci.com/pipelines/github/postmanlabs/postject/177/workflows/cfb21c18-92b3-48db-b143-4f2f6d016ed8/jobs/1368/steps?invite=true#step-104-7

INFO: Could not find files for the given pattern(s).
Command failed: where signtool

I can think of 2 solutions:

  1. Use Talaria, that contains signtool (that's how I verified locally that codesigning works for the Node.js binary)
  2. Use circleci/[email protected] as described in https://circleci.com/blog/code-signing-with-runner and https://circleci.com/developer/orbs/orb/circleci/microsoft-msix

Preferences or better options anyone?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tool (and others from the Windows SDK) should be on the PATH by default when running on a Visual Studio Developer Prompt (which I believe CircleCI does by default).

Can you access it from outside of this script? i.e. as a standalone step in the CircleCI definition or by SSHing into the worker?

If so, the problem might be in the way you are running this test file or spawning the specific command (without inheriting the outer Visual Studio Developer Prompt environment or something like that).

Copy link
Contributor Author

@RaisinTen RaisinTen Oct 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jviotti

Can you access it from outside of this script? i.e. as a standalone step in the CircleCI definition or by SSHing into the worker?

Doesn't seem to be happening in the CircleCI SSH session:

Microsoft Windows [Version 10.0.17763.3287]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\circleci>signtool
'signtool' is not recognized as an internal or external command,
operable program or batch file.

FWIW, it isn't present globally on my Windows 10 either when I run the regular cmd prompt.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, it isn't present globally on my Windows 10 either when I run the regular cmd prompt.

Yeah, I don't think that will work. That's why I meant the Visual Studio Command Prompt rather than the default one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just find and use the full path to signtool.exe on CircleCI rather than rely on it being on the PATH?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's acceptable for now until we open-source Talaria and then make use of it on this public repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have turned this into a macOS specific change for now because this is an improvement already. We can add a code signing test for Windows in a separate PR. PTAL!

@RaisinTen RaisinTen force-pushed the test/add-test-for-code-signing branch from 323a4af to 9123103 Compare October 17, 2022 04:59
@RaisinTen RaisinTen force-pushed the test/add-test-for-code-signing branch from 9123103 to 38d8c12 Compare October 28, 2022 11:46
@RaisinTen RaisinTen changed the title test: add test for code signing test: add test for code signing on macOS Oct 28, 2022
@RaisinTen RaisinTen merged commit 0b89222 into main Oct 28, 2022
@RaisinTen RaisinTen deleted the test/add-test-for-code-signing branch October 28, 2022 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants