Artifactspublic-v0

curl

master
ply4 git calls62 ms290 KiB3 cachedprotocol v2
197 lines8.2 KiBRaw
1#!/usr/bin/env bash
2#***************************************************************************
3# _ _ ____ _
4# Project ___| | | | _ \| |
5# / __| | | | |_) | |
6# | (__| |_| | _ <| |___
7# \___|\___/|_| \_\_____|
8#
9# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11# This software is licensed as described in the file COPYING, which
12# you should have received as part of this distribution. The terms
13# are also available at https://curl.se/docs/copyright.html.
15# You may opt to use, copy, modify, merge, publish, distribute and/or sell
16# copies of the Software, and permit persons to whom the Software is
17# furnished to do so, under the terms of the COPYING file.
19# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20# KIND, either express or implied.
22# SPDX-License-Identifier: curl
24###########################################################################
26# shellcheck disable=SC3040,SC2039
27set -eux; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
29export CURL_CI=appveyor
30verbose=''
32# build
34if [ -n "${CMAKE_GENERATOR:-}" ]; then
36 PRJ_CFG='Debug'
37 [[ "${APPVEYOR_JOB_NAME}" = *'Release'* ]] && PRJ_CFG='Release'
38 [[ "${APPVEYOR_JOB_NAME}" = *'RelWithDebInfo'* ]] && PRJ_CFG='RelWithDebInfo'
40 # Configure OpenSSL
41 case "${CMAKE_GENERATE:-}" in
42 *Win32*) openssl_suffix='-Win32';;
43 *) openssl_suffix='-Win64';;
44 esac
46 if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2026' ]; then
47 openssl_root_win="C:/OpenSSL-v36${openssl_suffix}" # manually bumped
48 elif [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then
49 openssl_root_win="C:/OpenSSL-v35${openssl_suffix}" # manually bumped
50 elif [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2019' ]; then
51 openssl_root_win="C:/OpenSSL-v30${openssl_suffix}" # manually bumped
52 fi
53 [ -n "${openssl_root_win:-}" ] && openssl_root="$(cygpath "${openssl_root_win}")"
55 # Install custom cmake version
56 if [ -n "${CMAKE_VERSION:-}" ]; then
57 cmake_ver="$(printf '%02d%02d' \
58 "$(echo "${CMAKE_VERSION}" | cut -f1 -d.)" \
59 "$(echo "${CMAKE_VERSION}" | cut -f2 -d.)")"
60 if [ "${cmake_ver}" -ge '0320' ]; then
61 fn="cmake-${CMAKE_VERSION}-windows-x86_64"
62 else
63 fn="cmake-${CMAKE_VERSION}-win64-x64"
64 fi
65 curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
66 --location --proto-redir =https "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${fn}.zip" --output pkg.bin
67 sha256sum pkg.bin && sha256sum pkg.bin | grep -qwF -- "${CMAKE_SHA256}" && 7z x -y pkg.bin >/dev/null && rm -f pkg.bin
68 PATH="$(pwd)/${fn}/bin:$PATH"
69 fi
71 # Set env CHKPREFILL to the value '_chkprefill' to compare feature detection
72 # results with and without the pre-fill feature. They have to match.
73 for _chkprefill in '' ${CHKPREFILL:-}; do
74 options=''
75 [ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
76 [[ "${CMAKE_GENERATE:-}" = *'-A ARM64'* ]] && SKIP_RUN='ARM64 architecture'
77 [[ "${CMAKE_GENERATE:-}" = *'-DCURL_USE_OPENSSL=ON'* ]] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}"
78 # shellcheck disable=SC2086
79 time cmake -B "_bld${_chkprefill}" \
80 -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
81 -DCMAKE_VS_GLOBALS=TrackFileAccess=false \
82 -DCURL_STATIC_CRT=ON \
83 -DCURL_DROP_UNUSED=ON \
84 -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
85 -DCURL_DISABLE_HTTPSIG=OFF \
86 ${CMAKE_GENERATE:-} \
87 ${options} \
88 || { cat _bld/CMakeFiles/CMake* 2>/dev/null; false; }
89 done
90 if [ -d _bld_chkprefill ] && ! diff -u _bld/lib/curl_config.h _bld_chkprefill/lib/curl_config.h; then
91 cat _bld_chkprefill/CMakeFiles/CMake* 2>/dev/null || true
92 false
93 fi
94 echo 'curl_config.h'; grep -F '#define' _bld/lib/curl_config.h | sort || true
95 echo 'libcurl.pc'; grep -v '^#' '_bld/libcurl.pc' || true
96 [ -n "${verbose}" ] && { echo 'configurehelp.pm'; cat _bld/tests/configurehelp.pm || true; }
97 time cmake --build _bld --config "${PRJ_CFG}" --parallel 2
98 [[ "${CMAKE_GENERATE:-}" != *'-DBUILD_SHARED_LIBS=OFF'* ]] && PATH="$(pwd)/_bld/lib/${PRJ_CFG}:$PATH"
99 [[ "${CMAKE_GENERATE:-}" = *'-DCURL_USE_OPENSSL=ON'* ]] && { PATH="${openssl_root}:$PATH"; cp -p "${openssl_root}"/*.dll "_bld/src/${PRJ_CFG}"; }
100 curl="_bld/src/${PRJ_CFG}/curl.exe"
101else
102 (
103 cd projects/Windows
104 ./generate.bat "${VC_VERSION}"
105 msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "-property:Platform=${PLAT}" "${VC_VERSION}/curl-all.sln"
106 )
107 [ "${PLAT}" = 'x64' ] && platdir='Win64' || platdir='Win32'
108 [[ "${PRJ_CFG}" = *'Debug'* ]] && binsuffix='d' || binsuffix=''
109 curl="build/${platdir}/${VC_VERSION}/${PRJ_CFG}/curl${binsuffix}.exe"
110fi
112find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -print0 | grep -z curl | sort -z | xargs -0 file --
113find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -print0 | grep -z curl | sort -z | xargs -0 stat -c '%10s bytes: %n' --
115if [ -z "${SKIP_RUN:-}" ]; then
116 "${curl}" --disable --version
117 [ -n "${verbose}" ] && "${curl}" --dump-module-paths | sort -f
118else
119 echo "Skip running curl.exe. Reason: ${SKIP_RUN}"
120fi
122# create artifact
124if [[ "${CREATE_ARTIFACT:-}" = 'true' ]]; then
125 cp -p /usr/ssl/certs/ca-bundle.crt curl-ca-bundle.crt
126 echo 'Checking that https works'
127 "${curl}" --disable --verbose --fail --silent --show-error --retry 6 --retry-all-errors --cacert curl-ca-bundle.crt --out-null https://curl.se/
128 if [ -n "${APPVEYOR_PULL_REQUEST_NUMBER:-}" ]; then
129 archive="curl_pr${APPVEYOR_PULL_REQUEST_NUMBER}_${APPVEYOR_PULL_REQUEST_HEAD_COMMIT}.zip"
130 else
131 archive="curl_${APPVEYOR_REPO_COMMIT}.zip"
132 fi
133 {
134 echo 'WARNING: Do not run this build unless the download link was provided by staff.'
135 echo 'Anyone can submit a PR with possibly malicious code to generate a build.'
136 echo "${archive}"
137 } > WARNING.txt
138 echo 'Finding curl module dependencies'
139 "${curl}" --dump-module-paths | sort -f | grep -Fv 'C:\Windows' | tee > files.tmp
140 echo 'Creating artifact'
141 time 7z a "${archive}" -y -bb1 -bsp0 -tzip -i@files.tmp curl-ca-bundle.crt WARNING.txt
142 rm files.tmp
143 appveyor PushArtifact "${archive}" &
144fi
146# build tests
148if [ -n "${CMAKE_GENERATOR:-}" ] && [[ "${APPVEYOR_JOB_NAME}" = *'Build-tests'* ]]; then
149 time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target testdeps
151 if [ -z "${SKIP_RUN:-}" ]; then
152 if [[ "${CMAKE_GENERATE:-}" = *'-DCURL_USE_OPENSSL=ON'* ]]; then
153 cp -p "${openssl_root}"/*.dll "_bld/tests/libtest/${PRJ_CFG}"
154 cp -p "${openssl_root}"/*.dll "_bld/tests/tunit/${PRJ_CFG}"
155 cp -p "${openssl_root}"/*.dll "_bld/tests/unit/${PRJ_CFG}"
156 fi
158 if [ -n "${verbose}" ]; then
159 "_bld/tests/libtest/${PRJ_CFG}/libtests.exe" --dump-module-paths | sort -f
160 "_bld/tests/server/${PRJ_CFG}/servers.exe" --dump-module-paths | sort -f
161 "_bld/tests/tunit/${PRJ_CFG}/tunits.exe" --dump-module-paths | sort -f
162 "_bld/tests/unit/${PRJ_CFG}/units.exe" --dump-module-paths | sort -f
163 fi
165 # run unit tests
167 unset APPVEYOR_API_URL # disable updating the 'Tests' counter via the API to save CI time
168 if [ -n "${RUN_TESTS_VIA_CMAKE:-}" ]; then # just to document the differences
169 export TFLAGS="-j10 ${TFLAGS:-}"
170 time cmake --build _bld --config "${PRJ_CFG}" --target test-ci
171 else
172 export CURL_DIRSUFFIX="${PRJ_CFG}"
173 TFLAGS="!1119 !1167 ${TFLAGS:-}" # skip tests that need a configured cl.exe
174 (
175 cd _bld/tests
176 # This command must use the same Perl as detected in the CMake configuration step.
177 # shellcheck disable=SC2086
178 time ../../tests/runtests.pl -a -p ~flaky ~timing-dependent -r --retry=5 -j10 --buildinfo ${TFLAGS}
179 )
180 fi
181 else
182 echo "Skip running tests. Reason: ${SKIP_RUN}"
183 fi
184fi
186# build examples
188if [ -n "${CMAKE_GENERATOR:-}" ] && [[ "${APPVEYOR_JOB_NAME}" = *'examples'* ]]; then
189 time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target curl-examples-build
190fi
192# disk space used
194du -sh .; echo; du -sh -t 250KB ./*
195if [ -n "${CMAKE_GENERATOR:-}" ]; then
196 echo; du -h -t 250KB _bld
197fi
Diagnostics4 git calls · 62 ms
CallStatusSizeTime062 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit24 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=24
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2003.2 KiB · hit36 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=36
git.response.bytes=3311
git.response.cache=HIT
git.response.duration_ms=36
git.fetch.wants=ae9bfcfc52bf420ce7c519034fb873bd2ce7ed22
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=3311
git.pkt.payload.max=3290
git.sideband.band1.bytes=3289
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e2ee1d8b5e77be
Request
e09f8c53…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format