Skip to content

Commit 54255c4

Browse files
authored
ci: update release script to embed Info.plists (runfinch#971)
Issue #, if available: *Description of changes:* Embed Info.plists into all of the executables that we vend. Requires stripping debug information from the go executable (see [this issue](golang/go#62577)). *Testing done:* Tested manually - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Justin Alvarez <[email protected]>
1 parent f774e2d commit 54255c4

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

Diff for: .github/workflows/build-pkg.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
cache: true
5050
- name: Build for macOS ${{ inputs.version }} (${{ inputs.output_arch }})
5151
run: |
52-
brew install lz4 automake autoconf libtool yq
52+
brew install lz4 automake autoconf libtool yq llvm
5353
git status
5454
git clean -f -d
5555
make clean

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CORE_VDE_PREFIX ?= $(OUTDIR)/dependencies/vde/opt/finch
2424
LICENSEDIR := $(OUTDIR)/license-files
2525
VERSION := $(shell git describe --match 'v[0-9]*' --dirty='.modified' --always --tags)
2626
GITCOMMIT := $(shell git rev-parse HEAD)$(shell test -z "$(git status --porcelain)" || echo .m)
27-
LDFLAGS := "-X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.GitCommit=$(GITCOMMIT)"
27+
LDFLAGS = "-w -X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.GitCommit=$(GITCOMMIT)"
2828
MIN_MACOS_VERSION ?= 11.0
2929

3030
GOOS ?= $(shell $(GO) env GOOS)

Diff for: installer-builder/tools/build-macos-pkg.sh

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ buildPkgInstaller() {
4444
mkdir -p $INSTALLER_FULL_PATH/unsigned/package/artifact
4545

4646
#build pkg
47+
# this identifier doens't match what's in the Info.plist for Finch, but changing it now
48+
# would break upgrades
4749
pkgbuild --identifier org.Finch."${VERSION}" \
4850
--version "$VERSION" \
4951
--scripts $INSTALLER_FULL_PATH/darwin/scripts \

Diff for: installer-builder/tools/extract-executables.sh

+9-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,15 @@ extractExecutables() {
5757
newname=${relativepath//\//__}
5858

5959
#copy executable to destination folder
60-
cp -a "$1/$file" ./installer-builder/output/executables/unsigned/package/artifact/EXECUTABLES_TO_SIGN/"$newname"
61-
codesign --remove-signature ./installer-builder/output/executables/unsigned/package/artifact/EXECUTABLES_TO_SIGN/"$newname"
62-
60+
newpath="./installer-builder/output/executables/unsigned/package/artifact/EXECUTABLES_TO_SIGN/$newname"
61+
cp -a "$1/$file" "$newpath"
62+
codesign --remove-signature "$newpath"
63+
"$(brew --prefix)"/opt/llvm/bin/llvm-objcopy \
64+
--keep-undefined \
65+
--add-section \
66+
__TEXT,__info_plist=./installer-builder/darwin/Info.plist \
67+
"$newpath" \
68+
"$newpath"
6369
#qemu needs specific entitlement, handle it separately
6470
if [[ $file == "qemu-system-x86_64" || $file == "qemu-system-aarch64" ]];
6571
then

0 commit comments

Comments
 (0)