forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 140
CMake build system for git #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
abb59f8
Merge branch 'hn/refs-cleanup' into jch
gitster 4cea3bf
Merge branch 'jk/diff-memuse-optim-with-stat-unmatch' into next
gitster 5a72620
Merge branch 'tb/t5318-cleanup' into next
gitster 2901ff9
Merge branch 'js/reflog-anonymize-for-clone-and-fetch' into next
gitster 697a10b
Merge branch 'en/sparse-checkout' into next
gitster 167a629
Merge branch 'js/msvc-build-fix' into next
gitster 2e63c8c
Merge branch 'en/do-match-pathspec-fix' into next
gitster 92944ed
Merge branch 'js/fuzz-commit-graph-leakfix' into next
gitster 60144a5
Merge branch 'dl/t-readme-spell-git-correctly' into next
gitster ad3269f
Merge branch 'dl/python-2.7-is-the-floor-version' into next
gitster c72c7da
Merge branch 'es/advertise-contribution-doc' into next
gitster ee63b70
Merge branch 'cc/upload-pack-data-2' into next
gitster 912c337
Merge branch 'jt/redact-all-cookies' into next
gitster 5f7c822
Merge branch 'es/worktree-duplicate-paths' into next
gitster bcb7351
Sync with master
gitster 3521be3
Merge branch 'en/sparse-with-submodule-doc' into next
gitster 5b31140
Merge branch 'jk/complete-git-switch' into next
gitster 2c4ec99
Merge branch 'en/clean-cleanups' into next
gitster e0b54a0
Merge branch 'ct/diff-with-merge-base-clarification' into next
gitster 393eff5
Merge branch 'cc/upload-pack-data-3' into next
gitster f2d1464
Sync with master
gitster 76e1513
Merge branch 'dl/branch-cleanup' into next
gitster 86b34a3
Merge branch 'ds/merge-base-is-ancestor-optim' into next
gitster 8880b35
Merge branch 'ss/submodule-set-branch-in-c' into next
gitster e8ba1cc
Merge branch 'jt/cdn-offload' into next
gitster 07ae9f0
Introduce CMake support for configuring Git
SibiSiddharthan 74358b3
cmake: generate the shell/perl/python scripts and templates, translat…
SibiSiddharthan a60e747
cmake: installation support for git
SibiSiddharthan fedda55
cmake: support for testing git with ctest
SibiSiddharthan 398a578
cmake: support for testing git when building out of the source tree
SibiSiddharthan 10acdbf
cmake: support for building git on windows with mingw
SibiSiddharthan 0b92154
cmake: support for building git on windows with msvc and clang.
SibiSiddharthan 3cdefab
ci: modification of main.yml to use cmake for vs-build job
SibiSiddharthan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,13 +145,6 @@ jobs: | |
## Unzip and remove the artifact | ||
unzip artifacts.zip | ||
rm artifacts.zip | ||
- name: generate Visual Studio solution | ||
shell: powershell | ||
run: | | ||
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc @" | ||
make NDEBUG=1 DEVELOPER=1 vcxproj | ||
"@ | ||
if (!$?) { exit(1) } | ||
- name: download vcpkg artifacts | ||
shell: powershell | ||
run: | | ||
|
@@ -163,6 +156,17 @@ jobs: | |
Remove-Item compat.zip | ||
- name: add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
- name: copy dlls to root | ||
shell: powershell | ||
run: | | ||
& compat\vcbuild\vcpkg_copy_dlls.bat release | ||
if (!$?) { exit(1) } | ||
- name: generate Visual Studio solution | ||
shell: bash | ||
run: | | ||
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \ | ||
-DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/include \ | ||
-DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON | ||
- name: MSBuild | ||
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142 | ||
- name: bundle artifact tar | ||
|
@@ -171,8 +175,6 @@ jobs: | |
MSVC: 1 | ||
VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg | ||
run: | | ||
& compat\vcbuild\vcpkg_copy_dlls.bat release | ||
if (!$?) { exit(1) } | ||
& git-sdk-64-minimal\usr\bin\bash.exe -lc @" | ||
mkdir -p artifacts && | ||
eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\" | ||
|
@@ -203,7 +205,7 @@ jobs: | |
- name: extract build artifacts | ||
shell: bash | ||
run: tar xf artifacts.tar.gz | ||
- name: test (parallel) | ||
- name: test | ||
shell: powershell | ||
env: | ||
MSYSTEM: MINGW64 | ||
|
@@ -214,12 +216,19 @@ jobs: | |
# Let Git ignore the SDK and the test-cache | ||
printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude | ||
|
||
cd t && | ||
PATH=\"`$PWD/helper:`$PATH\" && | ||
test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \ | ||
`$(test-tool.exe path-utils slice-tests \ | ||
${{matrix.nr}} 10 t[0-9]*.sh) | ||
ci/run-test-slice.sh ${{matrix.nr}} 10 | ||
"@ | ||
- name: ci/print-test-failures.sh | ||
if: failure() | ||
shell: powershell | ||
run: | | ||
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh | ||
- name: Upload failed tests' directories | ||
if: failure() && env.FAILED_TEST_ARTIFACTS != '' | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: failed-tests-windows | ||
path: ${{env.FAILED_TEST_ARTIFACTS}} | ||
regular: | ||
needs: ci-config | ||
if: needs.ci-config.outputs.enabled == 'yes' | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
Packfile URIs | ||
============= | ||
|
||
This feature allows servers to serve part of their packfile response as URIs. | ||
This allows server designs that improve scalability in bandwidth and CPU usage | ||
(for example, by serving some data through a CDN), and (in the future) provides | ||
some measure of resumability to clients. | ||
|
||
This feature is available only in protocol version 2. | ||
|
||
Protocol | ||
-------- | ||
|
||
The server advertises the `packfile-uris` capability. | ||
|
||
If the client then communicates which protocols (HTTPS, etc.) it supports with | ||
a `packfile-uris` argument, the server MAY send a `packfile-uris` section | ||
directly before the `packfile` section (right after `wanted-refs` if it is | ||
sent) containing URIs of any of the given protocols. The URIs point to | ||
packfiles that use only features that the client has declared that it supports | ||
(e.g. ofs-delta and thin-pack). See protocol-v2.txt for the documentation of | ||
this section. | ||
|
||
Clients should then download and index all the given URIs (in addition to | ||
downloading and indexing the packfile given in the `packfile` section of the | ||
response) before performing the connectivity check. | ||
|
||
Server design | ||
------------- | ||
|
||
The server can be trivially made compatible with the proposed protocol by | ||
having it advertise `packfile-uris`, tolerating the client sending | ||
`packfile-uris`, and never sending any `packfile-uris` section. But we should | ||
include some sort of non-trivial implementation in the Minimum Viable Product, | ||
at least so that we can test the client. | ||
|
||
This is the implementation: a feature, marked experimental, that allows the | ||
server to be configured by one or more `uploadpack.blobPackfileUri=<sha1> | ||
<uri>` entries. Whenever the list of objects to be sent is assembled, all such | ||
blobs are excluded, replaced with URIs. The client will download those URIs, | ||
expecting them to each point to packfiles containing single blobs. | ||
|
||
Client design | ||
------------- | ||
|
||
The client has a config variable `fetch.uriprotocols` that determines which | ||
protocols the end user is willing to use. By default, this is empty. | ||
|
||
When the client downloads the given URIs, it should store them with "keep" | ||
files, just like it does with the packfile in the `packfile` section. These | ||
additional "keep" files can only be removed after the refs have been updated - | ||
just like the "keep" file for the packfile in the `packfile` section. | ||
|
||
The division of work (initial fetch + additional URIs) introduces convenient | ||
points for resumption of an interrupted clone - such resumption can be done | ||
after the Minimum Viable Product (see "Future work"). | ||
|
||
Future work | ||
----------- | ||
|
||
The protocol design allows some evolution of the server and client without any | ||
need for protocol changes, so only a small-scoped design is included here to | ||
form the MVP. For example, the following can be done: | ||
|
||
* On the server, more sophisticated means of excluding objects (e.g. by | ||
specifying a commit to represent that commit and all objects that it | ||
references). | ||
* On the client, resumption of clone. If a clone is interrupted, information | ||
could be recorded in the repository's config and a "clone-resume" command | ||
can resume the clone in progress. (Resumption of subsequent fetches is more | ||
difficult because that must deal with the user wanting to use the repository | ||
even after the fetch was interrupted.) | ||
|
||
There are some possible features that will require a change in protocol: | ||
|
||
* Additional HTTP headers (e.g. authentication) | ||
* Byte range support | ||
* Different file formats referenced by URIs (e.g. raw object) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Đoàn Trần Công Danh wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Sibi Siddharthan wrote (reply to this):