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

Reinstate CodeQL on Mac if not signing the build #2569

Closed
wants to merge 12 commits into from

Conversation

softins
Copy link
Member

@softins softins commented Mar 31, 2022

Short description of changes

Moves the CodeQL from Mac Legacy back to Mac, and makes it conditional on not doing a signed build.

CHANGELOG: Mac: Make Github workflow skip CodeQL when doing a signed build, to avoid hanging.

Context: Fixes an issue?

Replaces #2564 and #2566, and solves the issues encountered when working on #2563.

Does this change need documentation? What needs to be documented and how?

Probably not

Status of this Pull Request

Ready for review

What is missing until this pull request can be merged?

Review

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@softins
Copy link
Member Author

softins commented Mar 31, 2022

After reviews, I will squash to a single commit before merging. I have left the original commits for review, to show the process of arriving at the solution.

Before the final commit, I pushed to both emlynmac and softins, to compare the runs:

@softins
Copy link
Member Author

softins commented Mar 31, 2022

@softins softins requested a review from hoffie March 31, 2022 11:13
@@ -73,6 +73,9 @@ pass_artifact_to_job() {
case "${1:-}" in
setup)
setup
# set up the macos_signed output if needed, but prevent
# a return status of 1 from propagating to the script exit status.
prepare_signing || true
Copy link
Member

@hoffie hoffie Apr 4, 2022

Choose a reason for hiding this comment

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

Hmm, so we would now be running those steps twice?
Maybe there's some nice way to save that state and skip the second run somehow. Either pass back the macos_signed output variable as an environment variable or touch some kind of file.

(Note: see next comment before doing investigating this... ;))

Copy link
Member Author

Choose a reason for hiding this comment

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

Well in fact, the only parts of prepare_signing that are needed in the setup phase are the initial tests and the setting of the output variable (so that it can be tested in the workflow). So we could make a different function check_signing that just does those parts, and maybe even call it from prepare_signing to reactor those parts out.

.github/workflows/autobuild.yml Show resolved Hide resolved
run: ${{ matrix.config.base_command }} setup
env:
JAMULUS_BUILD_VERSION: ${{ needs.create_release.outputs.build_version }}
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERT}}
Copy link
Member

Choose a reason for hiding this comment

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

If we need to keep this at all, the missing space should be added

Suggested change
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERT}}
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERT }}

Copy link
Member Author

Choose a reason for hiding this comment

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

I just copied and pasted from the Build step. I see the space is missing there too, but I didn't notice before.

@hoffie
Copy link
Member

hoffie commented Apr 6, 2022

Another thing to consider:
@ann0see already introduced a way to run CodeQL on the legacy build (downside: we have to take care of that when removing that, but there's an appropriate comment as a reminder now). If we make CodeQL conditional on the signing, this might block us from or need another reversal if we decide to sign all non-legacy Mac builds (maybe with temporary keys). While there is no concrete PR for that, I think it should be a goal in order to make the autobuild and release code paths as similar as possible. Additionally, Mac arm64/M1 builds seem to require workarounds as long as there is no signature at all.

@softins
Copy link
Member Author

softins commented Apr 7, 2022

Another thing to consider: @ann0see already introduced a way to run CodeQL on the legacy build (downside: we have to take care of that when removing that, but there's an appropriate comment as a reminder now).

This PR turns off the running of CodeQL on Legacy and removes the comment, as it would no longer be needed. I can't see any reason to run CodeQL on both Mac builds.

Also rename the output for disabling codeql explicitly.
@softins softins requested a review from hoffie April 7, 2022 14:54
@@ -73,6 +81,9 @@ pass_artifact_to_job() {
case "${1:-}" in
setup)
setup
# check whether signing will be used and prevent
# a return status of 1 from propagating to the script exit status.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# a return status of 1 from propagating to the script exit status.
# a return status of 1 from propagating to the script exit status.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure why the spacing didn't work...

@ann0see ann0see changed the base branch from master to main December 26, 2022 19:10
@ann0see
Copy link
Member

ann0see commented May 3, 2023

Is this still an issue? I believe so?

I wouldn't consider this a final fix, especially if #2944 is accepted and merged.

@ann0see ann0see marked this pull request as draft July 1, 2023 19:43
@pljones pljones added the tooling Changes to the automated build system label Aug 19, 2023
@softins
Copy link
Member Author

softins commented Jan 12, 2024

Closing this old PR, as the affected files have changed a lot since it was raised.

@softins softins closed this Jan 12, 2024
@softins softins deleted the autobuild/softins-signing branch January 12, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Changes to the automated build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants