Skip to content

Commit 11e37ec

Browse files
committed
fixup! azure-pipelines: build, sign, notarize and stage the macOS installer
Turns out that `make dist` _also_ builds Git. It's all a bit wasteful, still, even if a lot of wasteful bits have been removed since moving away from the original https://github.com/timcharper/git_osx_installer. So we need to build the universal ("fat") libgitcore.a _twice_, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 85db7c5 commit 11e37ec

1 file changed

Lines changed: 22 additions & 16 deletions

File tree

.azure-pipelines/release.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,26 @@ extends:
831831
# this build.
832832
export GIT_CONFIG_PARAMETERS="'maintenance.auto=false'"
833833
834+
# Build a universal (arm64 + x86_64) Rust static
835+
# library. The C code is compiled with
836+
# `-arch arm64 -arch x86_64` via config.mak, but
837+
# `cargo build` only targets the host architecture
838+
# by default, so we must build both targets
839+
# explicitly and lipo them together before `make`
840+
# tries to link the final binary.
841+
rustup target add x86_64-apple-darwin
842+
build_universal_libgitcore () {
843+
make GIT-PREFIX GIT-CFLAGS GIT-LDFLAGS
844+
cargo build --release --target aarch64-apple-darwin
845+
cargo build --release --target x86_64-apple-darwin
846+
mkdir -p target/release
847+
lipo -create \
848+
target/aarch64-apple-darwin/release/libgitcore.a \
849+
target/x86_64-apple-darwin/release/libgitcore.a \
850+
-output target/release/libgitcore.a
851+
}
852+
build_universal_libgitcore
853+
834854
make -j"$(sysctl -n hw.physicalcpu)" GIT-VERSION-FILE dist dist-doc
835855
836856
# Recover the source-tree commit OID from the dist
@@ -858,25 +878,11 @@ extends:
858878
# at the worktree root in the previous step.
859879
cp config.mak "payload/git-$BUILD_VERSION/config.mak"
860880
861-
# Build a universal (arm64 + x86_64) Rust static
862-
# library. The C code is compiled with
863-
# `-arch arm64 -arch x86_64` via config.mak, but
864-
# `cargo build` only targets the host architecture
865-
# by default, so we must build both targets
866-
# explicitly and lipo them together before `make`
867-
# tries to link the final binary.
868-
rustup target add x86_64-apple-darwin
881+
# Build the universal libgitcore.a also in `payload/git-*/`
869882
(
870883
set -x
871884
cd "payload/git-$BUILD_VERSION"
872-
make GIT-PREFIX GIT-CFLAGS GIT-LDFLAGS
873-
cargo build --release --target aarch64-apple-darwin
874-
cargo build --release --target x86_64-apple-darwin
875-
mkdir -p target/release
876-
lipo -create \
877-
target/aarch64-apple-darwin/release/libgitcore.a \
878-
target/x86_64-apple-darwin/release/libgitcore.a \
879-
-output target/release/libgitcore.a
885+
build_universal_libgitcore
880886
)
881887
882888
make -C .github/macos-installer V=1 payload

0 commit comments

Comments
 (0)