Skip to content

Commit e66545e

Browse files
committed
Merge remote-tracking branch 'origin/main' into multi-pack-index-write
2 parents 366115e + fabacb7 commit e66545e

File tree

121 files changed

+3704
-1052
lines changed

Some content is hidden

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

121 files changed

+3704
-1052
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
env:
1313
docker-registry: docker.pkg.github.com
14-
docker-config-path: ci/docker
14+
docker-config-path: source/ci/docker
1515

1616
jobs:
1717
# Build the docker container images that we will use for our Linux
@@ -43,19 +43,22 @@ jobs:
4343
dockerfile: bionic
4444
base: multiarch/ubuntu-core:arm64-bionic
4545
qemu: true
46+
- name: centos7
47+
- name: centos8
4648
runs-on: ubuntu-latest
4749
steps:
4850
- name: Check out repository
4951
uses: actions/checkout@v2
5052
with:
53+
path: source
5154
fetch-depth: 0
5255
if: github.event_name != 'pull_request'
5356
- name: Setup QEMU
5457
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
5558
if: matrix.container.qemu == true
5659
- name: Download existing container
5760
run: |
58-
"${{ github.workspace }}/ci/getcontainer.sh" "${{ matrix.container.name }}" "${{ matrix.container.dockerfile }}"
61+
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.container.name }}" "${{ matrix.container.dockerfile }}"
5962
env:
6063
DOCKER_REGISTRY: ${{ env.docker-registry }}
6164
GITHUB_TOKEN: ${{ secrets.github_token }}
@@ -67,7 +70,9 @@ jobs:
6770
BASE_ARG="--build-arg BASE=${{ matrix.container.base }}"
6871
fi
6972
docker build -t ${{ env.docker-registry-container-sha }} ${BASE_ARG} -f ${{ env.dockerfile }} .
73+
docker tag ${{ env.docker-registry-container-sha }} ${{ env.docker-registry-container-latest }}
7074
docker push ${{ env.docker-registry-container-sha }}
75+
docker push ${{ env.docker-registry-container-latest }}
7176
working-directory: ${{ env.docker-config-path }}
7277
if: github.event_name != 'pull_request' && env.docker-container-exists != 'true'
7378

@@ -86,7 +91,7 @@ jobs:
8691
env:
8792
CC: gcc
8893
CMAKE_GENERATOR: Ninja
89-
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DDEBUG_STRICT_ALLOC=ON
94+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DDEBUG_STRICT_ALLOC=ON -DDEBUG_STRICT_OPEN=ON
9095
os: ubuntu-latest
9196
- # Xenial, GCC, mbedTLS
9297
container:
@@ -206,17 +211,18 @@ jobs:
206211
- name: Check out repository
207212
uses: actions/checkout@v2
208213
with:
214+
path: source
209215
fetch-depth: 0
210216
- name: Set up build environment
211-
run: ci/setup-${{ matrix.platform.setup-script }}.sh
217+
run: source/ci/setup-${{ matrix.platform.setup-script }}.sh
212218
shell: bash
213219
if: matrix.platform.setup-script != ''
214220
- name: Setup QEMU
215221
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
216222
if: matrix.platform.container.qemu == true
217223
- name: Download container
218224
run: |
219-
"${{ github.workspace }}/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
225+
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
220226
env:
221227
DOCKER_REGISTRY: ${{ env.docker-registry }}
222228
GITHUB_TOKEN: ${{ secrets.github_token }}
@@ -233,8 +239,9 @@ jobs:
233239
if [ -n "${{ matrix.platform.container.name }}" ]; then
234240
docker run \
235241
--rm \
236-
-v "$(pwd):/home/libgit2/source" \
237-
-w /home/libgit2/source \
242+
--user libgit2:libgit2 \
243+
-v "$(pwd)/source:/home/libgit2/source" \
244+
-w /home/libgit2 \
238245
-e ASAN_SYMBOLIZER_PATH \
239246
-e CC \
240247
-e CFLAGS \
@@ -247,11 +254,11 @@ jobs:
247254
-e TSAN_OPTIONS \
248255
-e UBSAN_OPTIONS \
249256
${{ env.docker-registry-container-sha }} \
250-
/bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh"
257+
/bin/bash -c "mkdir build && cd build && ../source/ci/build.sh && ../source/ci/test.sh"
251258
else
252259
mkdir build && cd build
253-
../ci/build.sh
254-
../ci/test.sh
260+
../source/ci/build.sh
261+
../source/ci/test.sh
255262
fi
256263
shell: bash
257264

@@ -265,27 +272,22 @@ jobs:
265272
needs: [build_containers]
266273
runs-on: ubuntu-latest
267274
steps:
268-
- name: Setup defaults
269-
run: |
270-
if [ "${{ matrix.container.dockerfile }}" = "" ]; then
271-
echo "dockerfile=${{ matrix.container.dockerfile }}" >> $GITHUB_ENV
272-
else
273-
echo "dockerfile=${{ matrix.container.dockerfile }}" >> $GITHUB_ENV
274-
fi
275275
- name: Check out repository
276276
uses: actions/checkout@v2
277277
with:
278+
path: source
278279
fetch-depth: 0
279280
- name: Generate documentation
281+
working-directory: source
280282
run: |
281283
git config user.name 'Documentation Generation'
282284
git config user.email 'libgit2@users.noreply.github.com'
283285
git branch gh-pages origin/gh-pages
284286
docker login https://${{ env.docker-registry }} -u ${{ github.actor }} -p ${{ github.token }}
285287
docker run \
286288
--rm \
287-
-v "$(pwd):/home/libgit2/source" \
288-
-w /home/libgit2/source \
289+
-v "$(pwd):/home/libgit2" \
290+
-w /home/libgit2 \
289291
${{ env.docker-registry }}/${{ github.repository }}/docurium:latest \
290292
cm doc api.docurium
291293
git checkout gh-pages
@@ -294,7 +296,8 @@ jobs:
294296
name: Upload artifact
295297
with:
296298
name: api-documentation
297-
path: api-documentation.zip
299+
path: source/api-documentation.zip
298300
- name: Push documentation branch
301+
working-directory: source
299302
run: git push origin gh-pages
300303
if: github.event_name != 'pull_request' && github.repository == 'libgit2/libgit2'

.github/workflows/nightly.yml

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
docker-registry: docker.pkg.github.com
11-
docker-config-path: ci/docker
11+
docker-config-path: source/ci/docker
1212

1313
jobs:
1414
# Run our nightly builds. We build a matrix with the various build
@@ -59,6 +59,14 @@ jobs:
5959
CMAKE_OPTIONS: -DTHREADSAFE=OFF -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
6060
CMAKE_GENERATOR: Ninja
6161
os: ubuntu-latest
62+
- # Xenial, Clang, OpenSSL (dynamically loaded)
63+
container:
64+
name: xenial
65+
env:
66+
CC: clang
67+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
68+
CMAKE_GENERATOR: Ninja
69+
os: ubuntu-latest
6270
- # Focal, Clang 10, mbedTLS, MemorySanitizer
6371
container:
6472
name: focal
@@ -107,6 +115,40 @@ jobs:
107115
SKIP_SSH_TESTS: true
108116
SKIP_NEGOTIATE_TESTS: true
109117
os: ubuntu-latest
118+
- # CentOS 7
119+
container:
120+
name: centos7
121+
env:
122+
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
123+
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
124+
SKIP_NEGOTIATE_TESTS: true
125+
os: ubuntu-latest
126+
- # CentOS 7, OpenSSL (dynamically loaded)
127+
container:
128+
name: centos7
129+
env:
130+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
131+
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
132+
SKIP_NEGOTIATE_TESTS: true
133+
os: ubuntu-latest
134+
- # CentOS 8
135+
container:
136+
name: centos8
137+
env:
138+
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
139+
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
140+
SKIP_NEGOTIATE_TESTS: true
141+
SKIP_SSH_TESTS: true
142+
os: ubuntu-latest
143+
- # CentOS 8, OpenSSL (dynamically loaded)
144+
container:
145+
name: centos8
146+
env:
147+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
148+
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
149+
SKIP_NEGOTIATE_TESTS: true
150+
SKIP_SSH_TESTS: true
151+
os: ubuntu-latest
110152
- # macOS
111153
os: macos-10.15
112154
env:
@@ -163,6 +205,16 @@ jobs:
163205
BUILD_PATH: D:\Temp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
164206
SKIP_SSH_TESTS: true
165207
SKIP_NEGOTIATE_TESTS: true
208+
- # Bionic, GCC, OpenSSL (dynamically loaded)
209+
container:
210+
name: bionic
211+
dockerfile: bionic
212+
env:
213+
CC: gcc
214+
CMAKE_GENERATOR: Ninja
215+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
216+
RUN_INVASIVE_TESTS: true
217+
os: ubuntu-latest
166218
- # Bionic, x86, Clang, OpenSSL
167219
container:
168220
name: bionic-x86
@@ -215,17 +267,18 @@ jobs:
215267
- name: Check out repository
216268
uses: actions/checkout@v2
217269
with:
270+
path: source
218271
fetch-depth: 0
219272
- name: Set up build environment
220-
run: ci/setup-${{ matrix.platform.setup-script }}.sh
273+
run: source/ci/setup-${{ matrix.platform.setup-script }}.sh
221274
shell: bash
222275
if: matrix.platform.setup-script != ''
223276
- name: Setup QEMU
224277
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
225278
if: matrix.platform.container.qemu == true
226279
- name: Download container
227280
run: |
228-
"${{ github.workspace }}/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
281+
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
229282
env:
230283
DOCKER_REGISTRY: ${{ env.docker-registry }}
231284
GITHUB_TOKEN: ${{ secrets.github_token }}
@@ -242,8 +295,9 @@ jobs:
242295
if [ -n "${{ matrix.platform.container.name }}" ]; then
243296
docker run \
244297
--rm \
245-
-v "$(pwd):/home/libgit2/source" \
246-
-w /home/libgit2/source \
298+
--user libgit2:libgit2 \
299+
-v "$(pwd)/source:/home/libgit2/source" \
300+
-w /home/libgit2 \
247301
-e ASAN_SYMBOLIZER_PATH \
248302
-e CC \
249303
-e CFLAGS \
@@ -255,11 +309,11 @@ jobs:
255309
-e SKIP_SSH_TESTS \
256310
-e TSAN_OPTIONS \
257311
${{ env.docker-registry-container-sha }} \
258-
/bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh"
312+
/bin/bash -c "mkdir build && cd build && ../source/ci/build.sh && ../source/ci/test.sh"
259313
else
260314
mkdir build && cd build
261-
../ci/build.sh
262-
../ci/test.sh
315+
../source/ci/build.sh
316+
../source/ci/test.sh
263317
fi
264318
shell: bash
265319

@@ -270,15 +324,16 @@ jobs:
270324
- name: Check out repository
271325
uses: actions/checkout@v2
272326
with:
327+
path: source
273328
fetch-depth: 0
274329
- name: Download container
275330
run: |
276-
"${{ github.workspace }}/ci/getcontainer.sh" xenial
331+
"${{ github.workspace }}/source/ci/getcontainer.sh" xenial
277332
env:
278333
DOCKER_REGISTRY: ${{ env.docker-registry }}
279334
GITHUB_TOKEN: ${{ secrets.github_token }}
280335
working-directory: ${{ env.docker-config-path }}
281336
- name: Run Coverity
282-
run: ci/coverity.sh
337+
run: source/ci/coverity.sh
283338
env:
284339
COVERITY_TOKEN: ${{ secrets.coverity_token }}

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ INCLUDE(AddCFlagIfSupported)
2727
INCLUDE(FindPkgLibraries)
2828
INCLUDE(FindThreads)
2929
INCLUDE(FindStatNsec)
30+
INCLUDE(Findfutimens)
3031
INCLUDE(GNUInstallDirs)
3132
INCLUDE(IdeSplitSources)
3233
INCLUDE(FeatureSummary)
@@ -50,6 +51,7 @@ OPTION(USE_STANDALONE_FUZZERS "Enable standalone fuzzers (compatible with gcc)"
5051
OPTION(USE_LEAK_CHECKER "Run tests with leak checker" OFF)
5152
OPTION(DEBUG_POOL "Enable debug pool allocator" OFF)
5253
OPTION(DEBUG_STRICT_ALLOC "Enable strict allocator behavior" OFF)
54+
OPTION(DEBUG_STRICT_OPEN "Enable path validation in open" OFF)
5355
OPTION(ENABLE_WERROR "Enable compilation with -Werror" OFF)
5456
OPTION(USE_BUNDLED_ZLIB "Use the bundled version of zlib. Can be set to one of Bundled(ON)/Chromium. The Chromium option requires a x86_64 processor with SSE4.2 and CLMUL" OFF)
5557
SET(USE_HTTP_PARSER "" CACHE STRING "Specifies the HTTP Parser implementation; either system or builtin.")
@@ -232,6 +234,8 @@ ELSE ()
232234
enable_warnings(unused-const-variable)
233235
enable_warnings(unused-function)
234236
enable_warnings(int-conversion)
237+
enable_warnings(c11-extensions)
238+
enable_warnings(c99-c11-compat)
235239

236240
# MinGW uses gcc, which expects POSIX formatting for printf, but
237241
# uses the Windows C library, which uses its own format specifiers.

0 commit comments

Comments
 (0)