Skip to content

Commit 0081615

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Merge branch 'ready-for-upstream'
This is the branch thicket of patches in Git for Windows that are considered ready for upstream. To keep them in a ready-to-submit shape, they are kept as close to the beginning of the branch thicket as possible.
2 parents e90ba5c + dd1e07f commit 0081615

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+15473
-213
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CLANG build ARM64
2+
3+
on:
4+
workflow_dispatch:
5+
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
jobs:
11+
clang-build:
12+
runs-on: [Windows, ARM64]
13+
env:
14+
NO_PERL: 1
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: git-for-windows/setup-git-for-windows-sdk@v1
18+
with:
19+
flavor: makepkg-git
20+
architecture: aarch64
21+
# This assumes that the job is running on a self-hosted runner,
22+
# in which case we need to cleanup SDK files.
23+
cleanup: true
24+
- name: Build Git CLANGARM64
25+
run: make -j`nproc`

.github/workflows/main.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ jobs:
152152
NO_PERL: 1
153153
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
154154
runs-on: windows-latest
155+
strategy:
156+
matrix:
157+
arch: [x64, arm64]
155158
concurrency:
156-
group: vs-build-${{ github.ref }}
159+
group: vs-build-${{ github.ref }}-${{ matrix.arch }}
157160
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
158161
steps:
159162
- uses: actions/checkout@v3
@@ -164,26 +167,22 @@ jobs:
164167
repository: 'microsoft/vcpkg'
165168
path: 'compat/vcbuild/vcpkg'
166169
- name: download vcpkg artifacts
167-
shell: powershell
168-
run: |
169-
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
170-
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
171-
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
172-
(New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
173-
Expand-Archive compat.zip -DestinationPath . -Force
174-
Remove-Item compat.zip
170+
uses: git-for-windows/get-azure-pipelines-artifact@v0
171+
with:
172+
repository: git/git
173+
definitionId: 9
175174
- name: add msbuild to PATH
176175
uses: microsoft/setup-msbuild@v1
177176
- name: copy dlls to root
178177
shell: cmd
179-
run: compat\vcbuild\vcpkg_copy_dlls.bat release
178+
run: compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
180179
- name: generate Visual Studio solution
181180
shell: bash
182181
run: |
183-
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
184-
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
182+
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
183+
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows -DHOST_CPU=${{ matrix.arch }}
185184
- name: MSBuild
186-
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
185+
run: msbuild git.sln -property:Configuration=Release -property:Platform=${{ matrix.arch }} -maxCpuCount:4 -property:PlatformToolset=v142
187186
- name: bundle artifact tar
188187
shell: bash
189188
env:
@@ -197,7 +196,7 @@ jobs:
197196
- name: upload tracked files and build artifacts
198197
uses: actions/upload-artifact@v3
199198
with:
200-
name: vs-artifacts
199+
name: vs-artifacts-${{ matrix.arch }}
201200
path: artifacts
202201
vs-test:
203202
name: win+VS test
@@ -215,7 +214,7 @@ jobs:
215214
- name: download tracked files and build artifacts
216215
uses: actions/download-artifact@v3
217216
with:
218-
name: vs-artifacts
217+
name: vs-artifacts-x64
219218
path: ${{github.workspace}}
220219
- name: extract tracked files and build artifacts
221220
shell: bash

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,4 @@ Release/
245245
/git.VC.db
246246
*.dSYM
247247
/contrib/buildsystems/out
248+
CMakeSettings.json

Documentation/config.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ include::config/safe.txt[]
507507

508508
include::config/sendemail.txt[]
509509

510+
include::config/sendpack.txt[]
511+
510512
include::config/sequencer.txt[]
511513

512514
include::config/showbranch.txt[]
@@ -543,4 +545,6 @@ include::config/versionsort.txt[]
543545

544546
include::config/web.txt[]
545547

548+
include::config/windows.txt[]
549+
546550
include::config/worktree.txt[]

Documentation/config/http.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,13 @@ http.sslBackend::
189189

190190
http.schannelCheckRevoke::
191191
Used to enforce or disable certificate revocation checks in cURL
192-
when http.sslBackend is set to "schannel". Defaults to `true` if
193-
unset. Only necessary to disable this if Git consistently errors
194-
and the message is about checking the revocation status of a
195-
certificate. This option is ignored if cURL lacks support for
196-
setting the relevant SSL option at runtime.
192+
when http.sslBackend is set to "schannel" via "true" and "false",
193+
respectively. Another accepted value is "best-effort" (the default)
194+
in which case revocation checks are performed, but errors due to
195+
revocation list distribution points that are offline are silently
196+
ignored, as well as errors due to certificates missing revocation
197+
list distribution points. This option is ignored if cURL lacks
198+
support for setting the relevant SSL option at runtime.
197199

198200
http.schannelUseSSLCAInfo::
199201
As of cURL v7.60.0, the Secure Channel backend can use the
@@ -203,6 +205,11 @@ http.schannelUseSSLCAInfo::
203205
when the `schannel` backend was configured via `http.sslBackend`,
204206
unless `http.schannelUseSSLCAInfo` overrides this behavior.
205207

208+
http.sslAutoClientCert::
209+
As of cURL v7.77.0, the Secure Channel backend won't automatically
210+
send client certificates from the Windows Certificate Store anymore.
211+
To opt in to the old behavior, http.sslAutoClientCert can be set.
212+
206213
http.pinnedPubkey::
207214
Public key of the https service. It may either be the filename of
208215
a PEM or DER encoded public key file or a string starting with

Documentation/config/sendpack.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sendpack.sideband::
2+
Allows to disable the side-band-64k capability for send-pack even
3+
when it is advertised by the server. Makes it possible to work
4+
around a limitation in the git for windows implementation together
5+
with the dump git protocol. Defaults to true.

Documentation/config/windows.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
windows.appendAtomically::
2+
By default, append atomic API is used on windows. But it works only with
3+
local disk files, if you're working on a network file system, you should
4+
set it false to turn it off.

Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,7 @@ BUILTIN_OBJS += builtin/write-tree.o
13241324
# upstream unnecessarily (making merging in future changes easier).
13251325
THIRD_PARTY_SOURCES += compat/inet_ntop.c
13261326
THIRD_PARTY_SOURCES += compat/inet_pton.c
1327+
THIRD_PARTY_SOURCES += compat/mimalloc/%
13271328
THIRD_PARTY_SOURCES += compat/nedmalloc/%
13281329
THIRD_PARTY_SOURCES += compat/obstack.%
13291330
THIRD_PARTY_SOURCES += compat/poll/%
@@ -2052,6 +2053,41 @@ ifdef USE_NED_ALLOCATOR
20522053
OVERRIDE_STRDUP = YesPlease
20532054
endif
20542055

2056+
ifdef USE_MIMALLOC
2057+
MIMALLOC_OBJS = \
2058+
compat/mimalloc/alloc-aligned.o \
2059+
compat/mimalloc/alloc.o \
2060+
compat/mimalloc/arena.o \
2061+
compat/mimalloc/bitmap.o \
2062+
compat/mimalloc/heap.o \
2063+
compat/mimalloc/init.o \
2064+
compat/mimalloc/options.o \
2065+
compat/mimalloc/os.o \
2066+
compat/mimalloc/page.o \
2067+
compat/mimalloc/random.o \
2068+
compat/mimalloc/segment.o \
2069+
compat/mimalloc/segment-cache.o \
2070+
compat/mimalloc/stats.o
2071+
2072+
COMPAT_CFLAGS += -Icompat/mimalloc -DMI_DEBUG=0 -DUSE_MIMALLOC --std=gnu11
2073+
COMPAT_OBJS += $(MIMALLOC_OBJS)
2074+
2075+
$(MIMALLOC_OBJS): COMPAT_CFLAGS += -DBANNED_H
2076+
2077+
$(MIMALLOC_OBJS): COMPAT_CFLAGS += \
2078+
-Wno-attributes \
2079+
-Wno-unknown-pragmas \
2080+
-Wno-array-bounds
2081+
2082+
ifdef DEVELOPER
2083+
$(MIMALLOC_OBJS): COMPAT_CFLAGS += \
2084+
-Wno-pedantic \
2085+
-Wno-declaration-after-statement \
2086+
-Wno-old-style-definition \
2087+
-Wno-missing-prototypes
2088+
endif
2089+
endif
2090+
20552091
ifdef OVERRIDE_STRDUP
20562092
COMPAT_CFLAGS += -DOVERRIDE_STRDUP
20572093
COMPAT_OBJS += compat/strdup.o
@@ -2778,6 +2814,13 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
27782814
compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
27792815
endif
27802816

2817+
headless-git.o: compat/win32/headless.c GIT-CFLAGS
2818+
$(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
2819+
-fno-stack-protector -o $@ -c -Wall -Wwrite-strings $<
2820+
2821+
headless-git$X: headless-git.o git.res GIT-LDFLAGS
2822+
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res
2823+
27812824
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
27822825
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
27832826

@@ -3651,6 +3694,7 @@ clean: profile-clean coverage-clean cocciclean
36513694
$(RM) po/git.pot po/git-core.pot
36523695
$(RM) git.res
36533696
$(RM) $(OBJECTS)
3697+
$(RM) headless-git.o
36543698
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
36553699
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
36563700
$(RM) $(TEST_PROGRAMS)
@@ -3679,13 +3723,17 @@ endif
36793723
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
36803724
ifdef MSVC
36813725
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
3726+
$(RM) headless-git.o.pdb
36823727
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
3728+
$(RM) $(patsubst %.exe,%.ilk,$(OTHER_PROGRAMS))
36833729
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
36843730
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
36853731
$(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS))
3732+
$(RM) $(patsubst %.exe,%.ilk,$(PROGRAMS))
36863733
$(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS))
36873734
$(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS))
36883735
$(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS))
3736+
$(RM) $(patsubst %.exe,%.ilk,$(TEST_PROGRAMS))
36893737
$(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS))
36903738
$(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS))
36913739
$(RM) compat/vcbuild/MSVC-DEFS-GEN

abspath.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static char *strbuf_realpath_1(struct strbuf *resolved, const char *path,
9191
goto error_out;
9292
}
9393

94+
if (platform_strbuf_realpath(resolved, path))
95+
return resolved->buf;
96+
9497
strbuf_addstr(&remaining, path);
9598
get_root_part(resolved, &remaining);
9699

0 commit comments

Comments
 (0)