Skip to content

Commit

Permalink
dump -V info after jobs, also include it in official release artifacts
Browse files Browse the repository at this point in the history
- dump `curl --version` and `trurl --version` at the end of each job.
- collect these version outputs in the project root.
- make sure empty files are deleted.
- insert `-version-` to the filenames.
- replace internal CPU identifier with standard ones in the filename.
- replace `echo` with `true` to avoid outputting the exe name itself
  into the version dumps.
- include the version dumps in the artifact uploaded for live releases.
  • Loading branch information
vszakats committed Sep 1, 2024
1 parent 69b4c02 commit 49fd047
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 29 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-glibc-debian-testing-llvm'
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-glibc-debian-testing-gcc'
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-glibc-debian-bookworm-llvm'
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-glibc-debian-bookworm-gcc'
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-musl-debian-testing-llvm'
Expand Down Expand Up @@ -242,7 +242,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-musl-debian-testing-gcc'
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-musl-debian-bookworm-llvm'
Expand Down Expand Up @@ -308,7 +308,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-musl-debian-bookworm-gcc'
Expand Down Expand Up @@ -339,7 +339,7 @@ jobs:
sh -c 'apk add --no-cache bash && ./_ci-linux-alpine.sh'
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-musl-alpine-llvm-x86_64'
Expand Down Expand Up @@ -370,7 +370,7 @@ jobs:
sh -c 'apk add --no-cache bash && ./_ci-linux-alpine.sh'
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-musl-alpine-gcc-x86_64'
Expand All @@ -395,7 +395,7 @@ jobs:
sh -c ./_ci-mac-homebrew.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-musl-from-mac'
Expand All @@ -422,7 +422,7 @@ jobs:
sh -c ./_ci-mac-homebrew.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-macos-universal-clang'
Expand All @@ -449,7 +449,7 @@ jobs:
sh -c ./_ci-mac-homebrew.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-macos-universal-llvm'
Expand Down Expand Up @@ -477,7 +477,7 @@ jobs:
sh -c ./_ci-mac-homebrew.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-macos-gcc-arm64'
Expand Down Expand Up @@ -506,7 +506,7 @@ jobs:
sh -c ./_ci-mac-homebrew.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-windows-llvm-from-mac'
Expand Down Expand Up @@ -540,7 +540,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-windows-llvm'
Expand Down Expand Up @@ -574,7 +574,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-windows-gcc-noarm64'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-glibc-daily-tool'
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-linux-musl-daily-tool'
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
sh -c ./_ci-mac-homebrew.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
- uses: actions/upload-artifact@v4
with:
name: 'curl-macos-universal-daily-tool'
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
sh -c ./_ci-linux-debian.sh
- name: 'list dependencies'
run: cat urls.txt
run: cat urls.txt *-version-*.txt || true
# https://github.com/actions/upload-artifact
- uses: actions/upload-artifact@v4
with:
Expand Down
10 changes: 6 additions & 4 deletions _build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,8 @@ build_single_target() {
[ "${_CPU}" = 'a64' ] && _machine='aarch64'
[ "${_CPU}" = 'r64' ] && _machine='riscv64'

export _CPUPUB="${_machine}"

if [ "${_OS}" = 'mac' ] && [ "${_machine}" = 'aarch64' ] && [ "${_CC}" = 'llvm' ]; then
# llvm-apple supports multiple archs separated by ';', e.g. 'arm64e;x86_64'
# It also understands arm64e (vs arm64)
Expand Down Expand Up @@ -631,7 +633,7 @@ build_single_target() {
fi
_MAKE='mingw32-make'

_RUN_BIN='echo'
_RUN_BIN='true'
# Skip ARM64 target on 64-bit Intel, run all targets on ARM64:
if [ "${unamem}" = 'x86_64' ] && \
[ "${_CPU}" != 'a64' ]; then
Expand Down Expand Up @@ -659,7 +661,7 @@ build_single_target() {
fi
fi

_RUN_BIN='echo'
_RUN_BIN='true'
if [ "${_HOST}" = 'linux' ] || \
[ "${_HOST}" = 'bsd' ]; then
# Run x64 targets on same CPU:
Expand Down Expand Up @@ -724,7 +726,7 @@ build_single_target() {
_CCPREFIX="${_TRIPLETSH}-"
fi

_RUN_BIN='echo'
_RUN_BIN='true'
if [ "${_HOST}" = 'linux' ] && [ "${_OS}" = 'linux' ]; then
# Skip running non-native builds
if [ "${unamem}" = "${_machine}" ]; then
Expand All @@ -736,7 +738,7 @@ build_single_target() {
elif [ "${_OS}" = 'mac' ]; then
_TRIPLET="${_machine}-apple-darwin"

_RUN_BIN='echo'
_RUN_BIN='true'
if [ "${_HOST}" = 'mac' ]; then
# Skip running arm64 on x86_64
if [ "${_CPU}" = 'x64' ] || \
Expand Down
2 changes: 1 addition & 1 deletion _ul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ mv -f hashes.txt.all hashes.txt
# Create an artifact that includes all packages
_ALL="all-${_PKGOS}-${CURL_VER_}${_REVSUFFIX}${_FLAV}.zip"
{
find . -maxdepth 1 -type f -name "*-*-${_PKGOS}*.*" | sort
find . -maxdepth 1 -type f \( -name "*-*-${_PKGOS}*.*" -o -name "*-version-*.txt" \) | sort
echo 'hashes.txt'
echo "${_BLD}"
echo "${_URLS}"
Expand Down
4 changes: 3 additions & 1 deletion curl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@ _VER="$1"
# directly from the binary as strings, but curl creates most of these
# strings dynamically at runtime, so this is not possible
# (as of curl 7.83.1).
${_RUN_BIN} "${bin}" --disable --version | tee "curl-${_CPU}.txt" || true
out="../curl-version-${_CPUPUB}.txt"
${_RUN_BIN} "${bin}" --disable --version | sed 's/\r//g' | tee "${out}" || true
[ -s "${out}" ] || rm -r -f "${out}"
fi
# Create package
Expand Down
6 changes: 4 additions & 2 deletions trurl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,15 @@ _VER="$1"
fi
# On macOS this picks up a system libcurl by default. Ours is picked up
# when running it from the unpacked release tarball.
out="../trurl-version-${_CPUPUB}.txt"
LD_LIBRARY_PATH="$(pwd)/../curl/${_PP}/lib" \
DYLD_LIBRARY_PATH="$(pwd)/../curl/${_PP}/lib" \
${_RUN_BIN} "${bin}" --version | tee "trurl-${_CPU}.txt" || true
${_RUN_BIN} "${bin}" --version | sed 's/\r//g' | tee "${out}" || true
unset LD_DEBUG
[ -s "${out}" ] || rm -r -f "${out}"

if [ "${CW_TURL_TEST:-}" = '1' ] && \
[ "${_RUN_BIN}" != 'echo' ]; then
[ "${_RUN_BIN}" != 'true' ]; then
python3 ./test.py "--runner=${_RUN_BIN}" "--trurl=${bin}"
fi

Expand Down

0 comments on commit 49fd047

Please sign in to comment.