Embed Info.plist into the binary on macOS#1039
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7c0fb4601
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ldflags: | ||
| - -X github.com/cirruslabs/cirrus-cli/internal/version.Version={{.Version}} | ||
| - -X github.com/cirruslabs/cirrus-cli/internal/version.Commit={{.ShortCommit}} | ||
| - '{{- if eq .Os "darwin" }}-extldflags "-sectcreate __TEXT __info_plist Info.generated.plist"{{ end }}' |
There was a problem hiding this comment.
Force external link mode when adding __info_plist section
go doc cmd/link states that -extldflags are passed to the external linker and that -linkmode controls internal/external/auto behavior; this change adds only -extldflags for darwin without forcing external mode. I checked this repo’s sources with rg 'import "C"|#cgo' and found no cgo files, so auto mode can remain internal and skip -sectcreate, which means Info.generated.plist is not embedded and the bundle identifier requirement from this commit is not reliably met.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Interesting detail.
Improved in ec9dd3c.
This should hopefully allow us to add TCC.db entries based on a bundle identifier (
com.github.cirruslabs.cirrus-cli), which is useful for long-term AMI baking.Currently only absolute paths are possible (
/opt/homebrew/Cellar/cirrus/0.165.1/bin/cirrus), which change on each newly released version.