Skip to content

build(macos): quote SHOULD_SIGN env expansion in install script#5185

Merged
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
RESMP-DEV:fix/macos/packaging/quote-should-sign
May 25, 2026
Merged

build(macos): quote SHOULD_SIGN env expansion in install script#5185
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
RESMP-DEV:fix/macos/packaging/quote-should-sign

Conversation

@Nottlespike
Copy link
Copy Markdown
Contributor

Description

The macOS install(CODE ...) block in cmake/packaging/macos.cmake contains:

if($ENV{SHOULD_SIGN} STREQUAL "true")

When SHOULD_SIGN is unset (the common case for local manual builds — the env var is only set by CI on publish-release runs), the unquoted expansion collapses to nothing and CMake sees:

if( STREQUAL "true")

…which fails with Unknown arguments specified at install time. The bundle is fully assembled by that point (fixup_bundle runs first), but the error makes cmake --install exit non-zero and breaks scripts that chain install with cpack or downstream packaging steps.

Quote the expansion so the comparison is safe whether the env var is set, empty, or unset:

if("$ENV{SHOULD_SIGN}" STREQUAL "true")

CI builds (where SHOULD_SIGN=true) keep working identically because quoting a non-empty string is a no-op.

Screenshot

N/A — build script change.

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

The unquoted $ENV{SHOULD_SIGN} expansion in the install(CODE ...) block
collapses to nothing when the env var is unset, leaving the if() with
only "STREQUAL \"true\"" and failing with "Unknown arguments specified".
Quoting the expansion makes the comparison safe whether SHOULD_SIGN is
set, empty, or unset.
Copilot AI review requested due to automatic review settings May 25, 2026 11:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Improves robustness of macOS packaging/signing logic by safely comparing an environment variable even when it’s unset.

Changes:

  • Quote $ENV{SHOULD_SIGN} in the if() condition to avoid CMake parse/errors when the env var is empty/unset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

@ReenigneArcher ReenigneArcher changed the title fix(macos/packaging): quote SHOULD_SIGN env expansion in install script build(macos): quote SHOULD_SIGN env expansion in install script May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Bundle Report

Bundle size has no change ✅

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.80%. Comparing base (dbce229) to head (d070fcb).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5185      +/-   ##
==========================================
- Coverage   17.81%   17.80%   -0.01%     
==========================================
  Files         111      111              
  Lines       24143    24143              
  Branches    10687    10687              
==========================================
- Hits         4301     4299       -2     
- Misses      14681    16532    +1851     
+ Partials     5161     3312    -1849     
Flag Coverage Δ
Archlinux 11.19% <ø> (ø)
FreeBSD-aarch64 ?
FreeBSD-amd64 13.33% <ø> (+0.02%) ⬆️
Homebrew-ubuntu-22.04 13.53% <ø> (ø)
Linux-AppImage 12.11% <ø> (ø)
Windows-AMD64 14.85% <ø> (ø)
Windows-ARM64 13.20% <ø> (ø)
macOS-arm64 18.86% <ø> (ø)
macOS-x86_64 18.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 52 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbce229...d070fcb. Read the comment docs.

@ReenigneArcher ReenigneArcher merged commit d7e88da into LizardByte:master May 25, 2026
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants