Skip to content

Conversation

@elsiehupp
Copy link

@elsiehupp elsiehupp commented Jan 19, 2026

(Sorry this got created as an empty PR by VS Code.)

This is a WIP for using WhiteBox Packages to create an installer package for the macOS versions of Beeper Bridge Manager.

I have the following todos:

  • Add WhiteBox Packages to CI environment?
  • Use sed to set package version in pkgproj XML
  • Add certificate for code signing

I don't know if or when I'll finish this, since there are some other things I would like to experiment with, so if I don't do anything with this PR feel free to close it.

(Also feel free to build on this... but also feel free not to.)

@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Added macOS installer packaging infrastructure with universal binary support for Intel and Apple Silicon architectures.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Introduces macOS package installer support by adding a PackageMaker project configuration file and updating the CI build script to generate a universal macOS binary and invoke the package build tool during the post-build phase.

Changes

Cohort / File(s) Summary
PackageMaker Configuration
bbctl.pkgproj
New XML plist file defining macOS package structure, installation paths, file hierarchy, directory permissions (GID/UID), excluded patterns (dot files, SCM metadata), and payload metadata including identifier com.beeper.BridgeManager, version 0.13.0, and compression flags. 990 lines added.
CI Build Packaging
ci-build-all.sh
Added post-build packaging sequence that creates a universal macOS binary from amd64/arm64 builds, invokes packagesbuild with reference folder and project parameters, and cleans up temporary directories. Includes TODO placeholders for version injection and code signing. 17 lines added.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Packaging' is vague and generic, using a non-descriptive term that doesn't convey meaningful information about the specific changes (macOS packaging setup, universal binary creation, and PackageMaker configuration). Use a more descriptive title that explains the main change, such as 'Add macOS packaging with universal binary support' or 'Set up PackageMaker project for Beeper Bridge Manager distribution'.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a description explaining the packaging implementation, including the purpose of the bbctl.pkgproj file and the CI build changes for creating universal binaries.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@elsiehupp elsiehupp changed the title WIP Packaging Jan 19, 2026
@elsiehupp elsiehupp marked this pull request as draft January 19, 2026 18:38
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ci-build-all.sh (1)

1-1: POSIX sh incompatibility: [[ ]] is undefined in /bin/sh.

The shebang declares POSIX sh, but line 11 uses [[ true ]] which is a Bash-specific construct. This will fail on systems where /bin/sh is not Bash (e.g., Dash on Ubuntu/Debian).

Either change the shebang to #!/bin/bash or use POSIX-compatible syntax.

🔧 Option 1: Use bash shebang
-#!/bin/sh
+#!/bin/bash
🔧 Option 2: Use POSIX-compatible test
-if [[ true ]]; then
+if true; then

Also applies to: 11-11

🧹 Nitpick comments (4)
ci-build-all.sh (2)

11-11: Placeholder condition if [[ true ]] should be replaced with meaningful logic.

This always-true condition appears to be a WIP placeholder. Consider gating this block on appropriate conditions such as:

  • Running on macOS ([[ "$OSTYPE" == "darwin"* ]])
  • The packagesbuild tool being available (command -v packagesbuild)
♻️ Suggested conditional
-if [[ true ]]; then
+if [[ "$OSTYPE" == darwin* ]] && command -v packagesbuild &>/dev/null; then

12-21: Consider adding error handling for CI reliability.

The packaging block lacks error handling. If lipo or packagesbuild fails, the script continues silently. For CI, consider:

  • Adding set -e at the top to fail fast
  • Using a trap to ensure cleanup on failure
♻️ Optional: Add error handling
 #!/bin/bash
+set -e
+
+cleanup() {
+    rm -rf ./ref
+}
+trap cleanup EXIT
+
 GOOS=linux GOARCH=amd64 ./build.sh -o bbctl-linux-amd64

Then remove the explicit rm -r ./ref at the end since the trap handles cleanup.

bbctl.pkgproj (2)

793-794: Hardcoded version 0.13.0 should be automated.

The TODO in ci-build-all.sh mentions using sed to inject the version. This hardcoded value will drift from actual releases if not automated.

Consider using sed or plutil in the CI script to update this value dynamically from a version source (e.g., git tag, version file).

♻️ Example version injection in ci-build-all.sh
# Before running packagesbuild, inject version:
VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")
sed -i.bak "s|<string>0.13.0</string><!-- VERSION -->|<string>${VERSION}</string><!-- VERSION -->|" ./bbctl.pkgproj

Or use plutil for safer XML manipulation:

plutil -replace PROJECT.PACKAGE_SETTINGS.VERSION -string "$VERSION" ./bbctl.pkgproj

13-726: Large template boilerplate in directory hierarchy.

This extensive hierarchy (Applications, Library subdirs, System, Users, etc.) appears to be default template content from Packages.app. For a CLI tool installed to /usr/local/bin, most of these empty directory definitions are unnecessary.

This is low priority—the package will function correctly—but trimming unused entries would improve maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant