Skip to content

Commit 71b77b6

Browse files
vdyedscho
authored andcommitted
Merge pull request #472 from vdye/ms/macos-build-options
Fixes for MacOS release build & build options
2 parents 82c5932 + c0d4794 commit 71b77b6

File tree

3 files changed

+76
-2
lines changed

3 files changed

+76
-2
lines changed

Diff for: .github/macos-installer/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GIT_PREFIX := $(PREFIX)/git
2121
BUILD_DIR := $(GITHUB_WORKSPACE)/payload
2222
DESTDIR := $(PWD)/stage/git-$(ARCH_UNIV)-$(VERSION)
2323
ARTIFACTDIR := build-artifacts
24-
SUBMAKE := $(MAKE) C_INCLUDE_PATH="$(C_INCLUDE_PATH)" CPLUS_INCLUDE_PATH="$(CPLUS_INCLUDE_PATH)" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" TARGET_FLAGS="$(TARGET_FLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" NO_GETTEXT=1 NO_DARWIN_PORTS=1 prefix=$(GIT_PREFIX) DESTDIR=$(DESTDIR)
24+
SUBMAKE := $(MAKE) C_INCLUDE_PATH="$(C_INCLUDE_PATH)" CPLUS_INCLUDE_PATH="$(CPLUS_INCLUDE_PATH)" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" TARGET_FLAGS="$(TARGET_FLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" NO_GETTEXT=1 NO_DARWIN_PORTS=1 prefix=$(GIT_PREFIX) GIT_BUILT_FROM_COMMIT="$(GIT_BUILT_FROM_COMMIT)" DESTDIR=$(DESTDIR)
2525
CORES := $(shell bash -c "sysctl hw.ncpu | awk '{print \$$2}'")
2626

2727
# Guard against environment variables

Diff for: .github/workflows/build-git-installers.yml

+74
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,9 @@ jobs:
447447
448448
make -C git -j$(sysctl -n hw.physicalcpu) GIT-VERSION-FILE dist dist-doc
449449
450+
export GIT_BUILT_FROM_COMMIT=$(gunzip -c git/git-$VERSION.tar.gz | git get-tar-commit-id) ||
451+
die "Could not determine commit for build"
452+
450453
# Extract tarballs
451454
mkdir payload manpages
452455
tar -xvf git/git-$VERSION.tar.gz -C payload
@@ -609,12 +612,83 @@ jobs:
609612
*.deb
610613
# End build and sign Debian package
611614

615+
# Validate installers
616+
validate-installers:
617+
name: Validate installers
618+
strategy:
619+
matrix:
620+
component:
621+
- os: ubuntu-latest
622+
artifact: linux-artifacts
623+
command: git
624+
- os: macos-latest-xl-arm64
625+
artifact: macos-artifacts
626+
command: git
627+
- os: macos-latest
628+
artifact: macos-artifacts
629+
command: git
630+
- os: windows-latest
631+
artifact: win-installer-x86_64
632+
command: $PROGRAMFILES\Git\cmd\git.exe
633+
- os: ['self-hosted', '1ES.Pool=github-arm64-pool']
634+
artifact: win-installer-aarch64
635+
command: $PROGRAMFILES\Git\cmd\git.exe
636+
runs-on: ${{ matrix.component.os }}
637+
needs: [prereqs, windows_artifacts, create-macos-artifacts, create-linux-artifacts]
638+
steps:
639+
- name: Download artifacts
640+
uses: actions/download-artifact@v4
641+
with:
642+
name: ${{ matrix.component.artifact }}
643+
644+
- name: Install Windows
645+
if: contains(matrix.component.artifact, 'win-installer')
646+
shell: pwsh
647+
run: |
648+
$exePath = Get-ChildItem -Path ./*.exe | %{$_.FullName}
649+
Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1"
650+
651+
- name: Install Linux
652+
if: contains(matrix.component.artifact, 'linux')
653+
run: |
654+
debpath=$(find ./*.deb)
655+
sudo apt install $debpath
656+
657+
- name: Install macOS
658+
if: contains(matrix.component.artifact, 'macos')
659+
run: |
660+
# avoid letting Homebrew's `git` in `/opt/homebrew/bin` override `/usr/local/bin/git`
661+
arch="$(uname -m)"
662+
test arm64 != "$arch" ||
663+
brew uninstall git
664+
665+
pkgpath=$(find ./*universal*.pkg)
666+
sudo installer -pkg $pkgpath -target /
667+
668+
- name: Validate
669+
shell: bash
670+
run: |
671+
"${{ matrix.component.command }}" --version | sed 's/git version //' >actual
672+
echo ${{ needs.prereqs.outputs.tag_version }} >expect
673+
cmp expect actual || exit 1
674+
675+
- name: Validate universal binary CPU architecture
676+
if: contains(matrix.component.os, 'macos')
677+
shell: bash
678+
run: |
679+
set -ex
680+
git version --build-options >actual
681+
cat actual
682+
grep "cpu: $(uname -m)" actual
683+
# End validate installers
684+
612685
create-github-release:
613686
runs-on: ubuntu-latest
614687
permissions:
615688
contents: write
616689
id-token: write # required for Azure login via OIDC
617690
needs:
691+
- validate-installers
618692
- create-linux-artifacts
619693
- create-macos-artifacts
620694
- windows_artifacts

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3706,7 +3706,7 @@ dist: git-archive$(X) configure
37063706
@$(MAKE) -C git-gui TARDIR=../.dist-tmp-dir/git-gui dist-version
37073707
./git-archive --format=tar \
37083708
$(GIT_ARCHIVE_EXTRA_FILES) \
3709-
--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
3709+
--prefix=$(GIT_TARNAME)/ HEAD > $(GIT_TARNAME).tar
37103710
@$(RM) -r .dist-tmp-dir
37113711
gzip -f -9 $(GIT_TARNAME).tar
37123712

0 commit comments

Comments
 (0)