Files
aevolution/tools/prepare-msquic.cmake
dingoandClaude Opus 5.5 3c421cd0cf
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m28s
Foundation / checks (network) (push) Successful in 8m16s
Foundation / checks (client) (push) Successful in 12m14s
Foundation / checks (tsan) (push) Successful in 7m50s
Foundation / checks (checks) (push) Successful in 31m45s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 25m13s
Select and pin the M10.2 QUIC transport (msquic with OpenSSL)
ADR-0090 records the maintainer's selection of msquic 2.6.2 with OpenSSL 3.5.9 LTS
built from pinned, checksum-verified sources on Windows and Linux (plus the
xdp-for-windows headers msquic needs on Windows), the trust, threading and
channel model, and the known gap that OpenSSL's verifier also trusts its default
paths. Adds the opt-in quic preset, explicit preparation, and a loopback smoke
test (datagram, stream, untrusted CA and wrong name refused) passing on MSVC and
GCC. windows-check picks up newly installed Perl/NASM and pins cl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:07:16 -04:00

42 lines
2.4 KiB
CMake

# Explicit preparation of msquic and its OpenSSL (ADR-0090):
# cmake -P tools/prepare-msquic.cmake
# Downloads both pinned archives (or uses MSQUIC_ARCHIVE / OPENSSL_ARCHIVE), verifies
# SHA-256 before extraction, places OpenSSL where msquic builds its submodule, and
# records the verified pair. Normal configure never downloads.
cmake_minimum_required(VERSION 3.28)
include("${CMAKE_CURRENT_LIST_DIR}/msquic-pin.cmake")
set(root "${CMAKE_CURRENT_LIST_DIR}/../build/external/msquic")
file(MAKE_DIRECTORY "${root}")
function(evo_fetch variable url sha name)
if(NOT DEFINED ${variable})
set(${variable} "${root}/${name}")
if(NOT EXISTS "${${variable}}")
file(DOWNLOAD "${url}" "${${variable}}" TLS_VERIFY ON EXPECTED_HASH "SHA256=${sha}" STATUS result)
list(GET result 0 code)
if(NOT code EQUAL 0)
message(FATAL_ERROR "${name} download failed: ${result}")
endif()
endif()
endif()
file(SHA256 "${${variable}}" actual)
if(NOT actual STREQUAL sha)
message(FATAL_ERROR "${name} checksum mismatch; refusing extraction")
endif()
set(${variable} "${${variable}}" PARENT_SCOPE)
endfunction()
evo_fetch(MSQUIC_ARCHIVE "${EVO_MSQUIC_URL}" "${EVO_MSQUIC_SHA256}" "msquic-${EVO_MSQUIC_VERSION}.tar.gz")
evo_fetch(OPENSSL_ARCHIVE "${EVO_OPENSSL_URL}" "${EVO_OPENSSL_SHA256}" "openssl-${EVO_OPENSSL_VERSION}.tar.gz")
evo_fetch(XDP_ARCHIVE "${EVO_XDP_URL}" "${EVO_XDP_SHA256}" "xdp-for-windows-${EVO_XDP_COMMIT}.tar.gz")
set(source "${root}/msquic-${EVO_MSQUIC_VERSION}")
file(REMOVE_RECURSE "${source}" "${root}/openssl-${EVO_OPENSSL_VERSION}" "${root}/xdp-for-windows-${EVO_XDP_COMMIT}")
file(ARCHIVE_EXTRACT INPUT "${MSQUIC_ARCHIVE}" DESTINATION "${root}")
file(ARCHIVE_EXTRACT INPUT "${OPENSSL_ARCHIVE}" DESTINATION "${root}")
file(ARCHIVE_EXTRACT INPUT "${XDP_ARCHIVE}" DESTINATION "${root}")
file(REMOVE_RECURSE "${source}/submodules/openssl")
file(RENAME "${root}/openssl-${EVO_OPENSSL_VERSION}" "${source}/submodules/openssl")
file(REMOVE_RECURSE "${source}/submodules/xdp-for-windows")
file(RENAME "${root}/xdp-for-windows-${EVO_XDP_COMMIT}" "${source}/submodules/xdp-for-windows")
file(WRITE "${source}/evo-verified.sha256" "${EVO_MSQUIC_SHA256} ${EVO_OPENSSL_SHA256} ${EVO_XDP_SHA256}\n")
message(STATUS "Prepared msquic ${EVO_MSQUIC_VERSION} (MIT) with OpenSSL ${EVO_OPENSSL_VERSION} (Apache-2.0) "
"and xdp-for-windows headers ${EVO_XDP_COMMIT} (MIT)")