Skip to content

Commit 3169491

Browse files
dschomjcheetham
authored andcommitted
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 654b610 + 68ae5cb commit 3169491

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

+15873
-216
lines changed
+25
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

+14-15
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

+1
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

+4
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

+12-5
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

+5
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

+4
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

+73-7
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,11 @@ include shared.mak
464464
#
465465
# CURL_LDFLAGS=-lcurl
466466
#
467+
# Define LAZYLOAD_LIBCURL to dynamically load the libcurl; This can be useful
468+
# if Multiple libcurl versions exist (with different file names) that link to
469+
# various SSL/TLS backends, to support the `http.sslBackend` runtime switch in
470+
# such a scenario.
471+
#
467472
# === Optional library: libpcre2 ===
468473
#
469474
# Define USE_LIBPCRE if you have and want to use libpcre. Various
@@ -1324,6 +1329,7 @@ BUILTIN_OBJS += builtin/write-tree.o
13241329
# upstream unnecessarily (making merging in future changes easier).
13251330
THIRD_PARTY_SOURCES += compat/inet_ntop.c
13261331
THIRD_PARTY_SOURCES += compat/inet_pton.c
1332+
THIRD_PARTY_SOURCES += compat/mimalloc/%
13271333
THIRD_PARTY_SOURCES += compat/nedmalloc/%
13281334
THIRD_PARTY_SOURCES += compat/obstack.%
13291335
THIRD_PARTY_SOURCES += compat/poll/%
@@ -1597,10 +1603,23 @@ else
15971603
CURL_LIBCURL =
15981604
endif
15991605

1600-
ifndef CURL_LDFLAGS
1601-
CURL_LDFLAGS = $(eval CURL_LDFLAGS := $$(shell $$(CURL_CONFIG) --libs))$(CURL_LDFLAGS)
1606+
ifdef LAZYLOAD_LIBCURL
1607+
LAZYLOAD_LIBCURL_OBJ = compat/lazyload-curl.o
1608+
OBJECTS += $(LAZYLOAD_LIBCURL_OBJ)
1609+
# The `CURL_STATICLIB` constant must be defined to avoid seeing the functions
1610+
# declared as DLL imports
1611+
CURL_CFLAGS = -DCURL_STATICLIB
1612+
ifneq ($(uname_S),MINGW)
1613+
ifneq ($(uname_S),Windows)
1614+
CURL_LIBCURL = -ldl
1615+
endif
1616+
endif
1617+
else
1618+
ifndef CURL_LDFLAGS
1619+
CURL_LDFLAGS = $(eval CURL_LDFLAGS := $$(shell $$(CURL_CONFIG) --libs))$(CURL_LDFLAGS)
1620+
endif
1621+
CURL_LIBCURL += $(CURL_LDFLAGS)
16021622
endif
1603-
CURL_LIBCURL += $(CURL_LDFLAGS)
16041623

16051624
ifndef CURL_CFLAGS
16061625
CURL_CFLAGS = $(eval CURL_CFLAGS := $$(shell $$(CURL_CONFIG) --cflags))$(CURL_CFLAGS)
@@ -1621,7 +1640,7 @@ else
16211640
endif
16221641
ifdef USE_CURL_FOR_IMAP_SEND
16231642
BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
1624-
IMAP_SEND_BUILDDEPS = http.o
1643+
IMAP_SEND_BUILDDEPS = http.o $(LAZYLOAD_LIBCURL_OBJ)
16251644
IMAP_SEND_LDFLAGS += $(CURL_LIBCURL)
16261645
endif
16271646
ifndef NO_EXPAT
@@ -2052,6 +2071,41 @@ ifdef USE_NED_ALLOCATOR
20522071
OVERRIDE_STRDUP = YesPlease
20532072
endif
20542073

2074+
ifdef USE_MIMALLOC
2075+
MIMALLOC_OBJS = \
2076+
compat/mimalloc/alloc-aligned.o \
2077+
compat/mimalloc/alloc.o \
2078+
compat/mimalloc/arena.o \
2079+
compat/mimalloc/bitmap.o \
2080+
compat/mimalloc/heap.o \
2081+
compat/mimalloc/init.o \
2082+
compat/mimalloc/options.o \
2083+
compat/mimalloc/os.o \
2084+
compat/mimalloc/page.o \
2085+
compat/mimalloc/random.o \
2086+
compat/mimalloc/segment.o \
2087+
compat/mimalloc/segment-cache.o \
2088+
compat/mimalloc/stats.o
2089+
2090+
COMPAT_CFLAGS += -Icompat/mimalloc -DMI_DEBUG=0 -DUSE_MIMALLOC --std=gnu11
2091+
COMPAT_OBJS += $(MIMALLOC_OBJS)
2092+
2093+
$(MIMALLOC_OBJS): COMPAT_CFLAGS += -DBANNED_H
2094+
2095+
$(MIMALLOC_OBJS): COMPAT_CFLAGS += \
2096+
-Wno-attributes \
2097+
-Wno-unknown-pragmas \
2098+
-Wno-array-bounds
2099+
2100+
ifdef DEVELOPER
2101+
$(MIMALLOC_OBJS): COMPAT_CFLAGS += \
2102+
-Wno-pedantic \
2103+
-Wno-declaration-after-statement \
2104+
-Wno-old-style-definition \
2105+
-Wno-missing-prototypes
2106+
endif
2107+
endif
2108+
20552109
ifdef OVERRIDE_STRDUP
20562110
COMPAT_CFLAGS += -DOVERRIDE_STRDUP
20572111
COMPAT_OBJS += compat/strdup.o
@@ -2778,17 +2832,24 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
27782832
compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
27792833
endif
27802834

2835+
headless-git.o: compat/win32/headless.c GIT-CFLAGS
2836+
$(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
2837+
-fno-stack-protector -o $@ -c -Wall -Wwrite-strings $<
2838+
2839+
headless-git$X: headless-git.o git.res GIT-LDFLAGS
2840+
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res
2841+
27812842
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
27822843
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
27832844

27842845
git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
27852846
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
27862847
$(IMAP_SEND_LDFLAGS) $(LIBS)
27872848

2788-
git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
2849+
git-http-fetch$X: http.o http-walker.o http-fetch.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
27892850
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
27902851
$(CURL_LIBCURL) $(LIBS)
2791-
git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)
2852+
git-http-push$X: http.o http-push.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
27922853
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
27932854
$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
27942855

@@ -2798,7 +2859,7 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
27982859
ln -s $< $@ 2>/dev/null || \
27992860
cp $< $@
28002861

2801-
$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)
2862+
$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
28022863
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
28032864
$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
28042865

@@ -3651,6 +3712,7 @@ clean: profile-clean coverage-clean cocciclean
36513712
$(RM) po/git.pot po/git-core.pot
36523713
$(RM) git.res
36533714
$(RM) $(OBJECTS)
3715+
$(RM) headless-git.o
36543716
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
36553717
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
36563718
$(RM) $(TEST_PROGRAMS)
@@ -3679,13 +3741,17 @@ endif
36793741
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
36803742
ifdef MSVC
36813743
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
3744+
$(RM) headless-git.o.pdb
36823745
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
3746+
$(RM) $(patsubst %.exe,%.ilk,$(OTHER_PROGRAMS))
36833747
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
36843748
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
36853749
$(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS))
3750+
$(RM) $(patsubst %.exe,%.ilk,$(PROGRAMS))
36863751
$(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS))
36873752
$(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS))
36883753
$(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS))
3754+
$(RM) $(patsubst %.exe,%.ilk,$(TEST_PROGRAMS))
36893755
$(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS))
36903756
$(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS))
36913757
$(RM) compat/vcbuild/MSVC-DEFS-GEN

abspath.c

+3
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ static char *strbuf_realpath_1(struct strbuf *resolved, const char *path,
9393
goto error_out;
9494
}
9595

96+
if (platform_strbuf_realpath(resolved, path))
97+
return resolved->buf;
98+
9699
strbuf_addstr(&remaining, path);
97100
get_root_part(resolved, &remaining);
98101

0 commit comments

Comments
 (0)