From df5acf72fd8aefb41161081e91ee7cc854bd9b59 Mon Sep 17 00:00:00 2001 From: Ashcon Partovi Date: Fri, 6 Dec 2024 16:19:02 -0800 Subject: [PATCH] Testing --- .buildkite/ci.mjs | 90 +++++++++++++++++---------------- cmake/tools/SetupCodesign.cmake | 33 ++++++------ 2 files changed, 64 insertions(+), 59 deletions(-) diff --git a/.buildkite/ci.mjs b/.buildkite/ci.mjs index 771c8dfd67..eb776143f5 100755 --- a/.buildkite/ci.mjs +++ b/.buildkite/ci.mjs @@ -104,15 +104,15 @@ function getTargetLabel(target) { */ const buildPlatforms = [ { os: "darwin", arch: "aarch64", release: "14" }, - { os: "darwin", arch: "x64", release: "14" }, - { os: "linux", arch: "aarch64", distro: "debian", release: "11" }, - { os: "linux", arch: "x64", distro: "debian", release: "11" }, - { os: "linux", arch: "x64", baseline: true, distro: "debian", release: "11" }, - { os: "linux", arch: "aarch64", abi: "musl", distro: "alpine", release: "3.20" }, - { os: "linux", arch: "x64", abi: "musl", distro: "alpine", release: "3.20" }, - { os: "linux", arch: "x64", abi: "musl", baseline: true, distro: "alpine", release: "3.20" }, - { os: "windows", arch: "x64", release: "2019" }, - { os: "windows", arch: "x64", baseline: true, release: "2019" }, + // { os: "darwin", arch: "x64", release: "14" }, + // { os: "linux", arch: "aarch64", distro: "debian", release: "11" }, + // { os: "linux", arch: "x64", distro: "debian", release: "11" }, + // { os: "linux", arch: "x64", baseline: true, distro: "debian", release: "11" }, + // { os: "linux", arch: "aarch64", abi: "musl", distro: "alpine", release: "3.20" }, + // { os: "linux", arch: "x64", abi: "musl", distro: "alpine", release: "3.20" }, + // { os: "linux", arch: "x64", abi: "musl", baseline: true, distro: "alpine", release: "3.20" }, + // { os: "windows", arch: "x64", release: "2019" }, + // { os: "windows", arch: "x64", baseline: true, release: "2019" }, ]; /** @@ -120,33 +120,33 @@ const buildPlatforms = [ */ const testPlatforms = [ { os: "darwin", arch: "aarch64", release: "14", tier: "latest" }, - { os: "darwin", arch: "aarch64", release: "13", tier: "previous" }, - { os: "darwin", arch: "x64", release: "14", tier: "latest" }, - { os: "darwin", arch: "x64", release: "13", tier: "previous" }, - { os: "linux", arch: "aarch64", distro: "debian", release: "12", tier: "latest" }, - { os: "linux", arch: "aarch64", distro: "debian", release: "11", tier: "previous" }, - { os: "linux", arch: "x64", distro: "debian", release: "12", tier: "latest" }, - { os: "linux", arch: "x64", distro: "debian", release: "11", tier: "previous" }, - { os: "linux", arch: "x64", baseline: true, distro: "debian", release: "12", tier: "latest" }, - { os: "linux", arch: "x64", baseline: true, distro: "debian", release: "11", tier: "previous" }, - { os: "linux", arch: "aarch64", distro: "ubuntu", release: "24.04", tier: "latest" }, - { os: "linux", arch: "aarch64", distro: "ubuntu", release: "22.04", tier: "previous" }, - { os: "linux", arch: "aarch64", distro: "ubuntu", release: "20.04", tier: "oldest" }, - { os: "linux", arch: "x64", distro: "ubuntu", release: "24.04", tier: "latest" }, - { os: "linux", arch: "x64", distro: "ubuntu", release: "22.04", tier: "previous" }, - { os: "linux", arch: "x64", distro: "ubuntu", release: "20.04", tier: "oldest" }, - { os: "linux", arch: "x64", baseline: true, distro: "ubuntu", release: "24.04", tier: "latest" }, - { os: "linux", arch: "x64", baseline: true, distro: "ubuntu", release: "22.04", tier: "previous" }, - { os: "linux", arch: "x64", baseline: true, distro: "ubuntu", release: "20.04", tier: "oldest" }, - { os: "linux", arch: "aarch64", abi: "musl", distro: "alpine", release: "3.20", tier: "latest" }, - { os: "linux", arch: "x64", abi: "musl", distro: "alpine", release: "3.20", tier: "latest" }, - { os: "linux", arch: "x64", abi: "musl", baseline: true, distro: "alpine", release: "3.20", tier: "latest" }, - { os: "windows", arch: "x64", release: "2025", tier: "latest" }, - { os: "windows", arch: "x64", release: "2022", tier: "previous" }, - { os: "windows", arch: "x64", release: "2019", tier: "oldest" }, - { os: "windows", arch: "x64", release: "2025", baseline: true, tier: "latest" }, - { os: "windows", arch: "x64", release: "2022", baseline: true, tier: "previous" }, - { os: "windows", arch: "x64", release: "2019", baseline: true, tier: "oldest" }, + // { os: "darwin", arch: "aarch64", release: "13", tier: "previous" }, + // { os: "darwin", arch: "x64", release: "14", tier: "latest" }, + // { os: "darwin", arch: "x64", release: "13", tier: "previous" }, + // { os: "linux", arch: "aarch64", distro: "debian", release: "12", tier: "latest" }, + // { os: "linux", arch: "aarch64", distro: "debian", release: "11", tier: "previous" }, + // { os: "linux", arch: "x64", distro: "debian", release: "12", tier: "latest" }, + // { os: "linux", arch: "x64", distro: "debian", release: "11", tier: "previous" }, + // { os: "linux", arch: "x64", baseline: true, distro: "debian", release: "12", tier: "latest" }, + // { os: "linux", arch: "x64", baseline: true, distro: "debian", release: "11", tier: "previous" }, + // { os: "linux", arch: "aarch64", distro: "ubuntu", release: "24.04", tier: "latest" }, + // { os: "linux", arch: "aarch64", distro: "ubuntu", release: "22.04", tier: "previous" }, + // { os: "linux", arch: "aarch64", distro: "ubuntu", release: "20.04", tier: "oldest" }, + // { os: "linux", arch: "x64", distro: "ubuntu", release: "24.04", tier: "latest" }, + // { os: "linux", arch: "x64", distro: "ubuntu", release: "22.04", tier: "previous" }, + // { os: "linux", arch: "x64", distro: "ubuntu", release: "20.04", tier: "oldest" }, + // { os: "linux", arch: "x64", baseline: true, distro: "ubuntu", release: "24.04", tier: "latest" }, + // { os: "linux", arch: "x64", baseline: true, distro: "ubuntu", release: "22.04", tier: "previous" }, + // { os: "linux", arch: "x64", baseline: true, distro: "ubuntu", release: "20.04", tier: "oldest" }, + // { os: "linux", arch: "aarch64", abi: "musl", distro: "alpine", release: "3.20", tier: "latest" }, + // { os: "linux", arch: "x64", abi: "musl", distro: "alpine", release: "3.20", tier: "latest" }, + // { os: "linux", arch: "x64", abi: "musl", baseline: true, distro: "alpine", release: "3.20", tier: "latest" }, + // { os: "windows", arch: "x64", release: "2025", tier: "latest" }, + // { os: "windows", arch: "x64", release: "2022", tier: "previous" }, + // { os: "windows", arch: "x64", release: "2019", tier: "oldest" }, + // { os: "windows", arch: "x64", release: "2025", baseline: true, tier: "latest" }, + // { os: "windows", arch: "x64", release: "2022", baseline: true, tier: "previous" }, + // { os: "windows", arch: "x64", release: "2019", baseline: true, tier: "oldest" }, ]; /** @@ -397,6 +397,8 @@ function getBuildEnv(target) { ENABLE_ASSERTIONS: release ? "OFF" : "ON", ENABLE_LOGS: release ? "OFF" : "ON", ABI: abi === "musl" ? "musl" : undefined, + // HACK to speed up CI testing + BUILDKITE_BUILD_ID_OVERRIDE: "7484", }; } @@ -483,11 +485,11 @@ function getLinkBunStep(platform) { return { key: `${getTargetKey(platform)}-build-bun`, label: `${getTargetLabel(platform)} - build-bun`, - depends_on: [ - `${getTargetKey(platform)}-build-vendor`, - `${getTargetKey(platform)}-build-cpp`, - `${getTargetKey(platform)}-build-zig`, - ], + // depends_on: [ + // `${getTargetKey(platform)}-build-vendor`, + // `${getTargetKey(platform)}-build-cpp`, + // `${getTargetKey(platform)}-build-zig`, + // ], agents: getCppAgent(platform), retry: getRetry(), cancel_on_build_failing: isMergeQueue(), @@ -1053,9 +1055,9 @@ async function getPipeline(options = {}) { steps: unifiedBuilds ? [getBuildBunStep(target)] : [ - getBuildVendorStep(target), - getBuildCppStep(target), - getBuildZigStep(target), + // getBuildVendorStep(target), + // getBuildCppStep(target), + // getBuildZigStep(target), getLinkBunStep(target), ], }, diff --git a/cmake/tools/SetupCodesign.cmake b/cmake/tools/SetupCodesign.cmake index fc382e83f8..2d47783940 100644 --- a/cmake/tools/SetupCodesign.cmake +++ b/cmake/tools/SetupCodesign.cmake @@ -5,10 +5,16 @@ if(ENABLE_CODESIGN AND APPLE) find_command(VARIABLE CODESIGN_PROGRAM COMMAND codesign REQUIRED) find_command(VARIABLE DITTO_PROGRAM COMMAND ditto REQUIRED) - optionx(APPLE_CODESIGN_KEYCHAIN_PATH FILEPATH "Path to the keychain to use for code signing" DEFAULT ${BUILD_PATH}/apple-codesign-keychain.db) - optionx(APPLE_CODESIGN_KEYCHAIN_PASSWORD STRING "Password for the keychain" DEFAULT "" SECRET) + set(DEFAULT_APPLE_CODESIGN_KEYCHAIN_PATH ${BUILD_PATH}/apple-codesign-keychain.db) + optionx(APPLE_CODESIGN_KEYCHAIN_PATH FILEPATH "Path to the keychain to use for code signing" DEFAULT ${DEFAULT_APPLE_CODESIGN_KEYCHAIN_PATH}) get_filename_component(APPLE_CODESIGN_KEYCHAIN_FILENAME ${APPLE_CODESIGN_KEYCHAIN_PATH} NAME) + if(APPLE_CODESIGN_KEYCHAIN_PATH STREQUAL "${DEFAULT_APPLE_CODESIGN_KEYCHAIN_PATH}") + set(APPLE_CODESIGN_KEYCHAIN_PASSWORD "") + else() + optionx(APPLE_CODESIGN_KEYCHAIN_PASSWORD STRING "Password for the keychain" DEFAULT "" SECRET) + endif() + if(NOT EXISTS ${APPLE_CODESIGN_KEYCHAIN_PATH}) execute_process( COMMAND ${SECURITY_PROGRAM} create-keychain -p "${APPLE_CODESIGN_KEYCHAIN_PASSWORD}" ${APPLE_CODESIGN_KEYCHAIN_PATH} @@ -54,14 +60,15 @@ if(ENABLE_CODESIGN AND APPLE) ) endif() + set(DEFAULT_APPLE_CODESIGN_IDENTITY_PATH ${BUILD_PATH}/apple-codesign-identity.p12) + optionx(APPLE_CODESIGN_IDENTITY_PATH FILEPATH "Path to the code signing identity .p12 file" DEFAULT ${DEFAULT_APPLE_CODESIGN_IDENTITY_PATH}) optionx(APPLE_CODESIGN_IDENTITY_BASE64 STRING "Base64-encoded code signing identity .p12 file" SECRET) - optionx(APPLE_CODESIGN_IDENTITY_PATH FILEPATH "Path to the code signing identity .p12 file") if(APPLE_CODESIGN_IDENTITY_BASE64) find_command(VARIABLE BASE64_PROGRAM COMMAND base64 REQUIRED) - setx(APPLE_CODESIGN_IDENTITY_PATH ${BUILD_PATH}/apple-codesign-identity.p12) + execute_process( - COMMAND ${CMAKE_COMMAND} -E echo ${APPLE_CODESIGN_IDENTITY_BASE64} | ${BASE64_PROGRAM} --decode > ${APPLE_CODESIGN_IDENTITY_PATH} + COMMAND ${CMAKE_COMMAND} -E echo "${APPLE_CODESIGN_IDENTITY_BASE64}" | ${BASE64_PROGRAM} --decode > ${APPLE_CODESIGN_IDENTITY_PATH} OUTPUT_QUIET ERROR_VARIABLE DECODE_IDENTITY_ERROR ERROR_STRIP_TRAILING_WHITESPACE @@ -87,15 +94,6 @@ if(ENABLE_CODESIGN AND APPLE) endif() if(NOT FIND_IDENTITY_OUTPUT MATCHES "${APPLE_CODESIGN_IDENTITY}") - if(NOT APPLE_CODESIGN_IDENTITY_BASE64 AND NOT APPLE_CODESIGN_IDENTITY_PATH) - message(FATAL_ERROR "Code signing is enabled, but no identity was found in your keychain.\n" - "To fix this, either:\n" - " - Add the identity to your keychain by running 'security import [identity-path] -k [keychain-path] -T ${CODESIGN_PROGRAM}'\n" - " - Set APPLE_CODESIGN_IDENTITY_PATH to the path of the .p12 file for the identity\n" - " - Set APPLE_CODESIGN_IDENTITY_BASE64 to the base64-encoded .p12 file for the identity\n" - ) - endif() - execute_process( COMMAND ${SECURITY_PROGRAM} import ${APPLE_CODESIGN_IDENTITY_PATH} -k ${APPLE_CODESIGN_KEYCHAIN_PATH} -P "${APPLE_CODESIGN_IDENTITY_PASSWORD}" -T ${CODESIGN_PROGRAM} OUTPUT_QUIET @@ -131,7 +129,12 @@ if(ENABLE_CODESIGN AND APPLE) endif() if(NOT FIND_IDENTITY_OUTPUT MATCHES "${APPLE_CODESIGN_IDENTITY}") - message(FATAL_ERROR "Failed to find identity ${APPLE_CODESIGN_IDENTITY}, but it was successfully imported?") + message(FATAL_ERROR "Code signing is enabled, but no identity was found in your keychain.\n" + "To fix this, either:\n" + " - Add the identity to your keychain by running 'security import [identity-path] -k [keychain-path] -T ${CODESIGN_PROGRAM}'\n" + " - Set APPLE_CODESIGN_IDENTITY_PATH to the path of the .p12 file for the identity\n" + " - Set APPLE_CODESIGN_IDENTITY_BASE64 to the base64-encoded .p12 file for the identity\n" + ) endif() endif() endif()