From 83eb4b8151269b7d2ab8c726968ab40d8db4be93 Mon Sep 17 00:00:00 2001 From: ccptoebeans Date: Thu, 23 Jul 2026 16:34:38 +0000 Subject: [PATCH 1/6] correct vcpkg registry submodule URL --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index b328964..917890b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "vendor/github.com/microsoft/vcpkg"] path = vendor/github.com/microsoft/vcpkg - url = git@github.com/microsoft/vcpkg.git + url = git@github.com:microsoft/vcpkg.git From 866537701559ae59b1bd555bf7eaf1d84ade012d Mon Sep 17 00:00:00 2001 From: ccptoebeans Date: Thu, 23 Jul 2026 16:36:43 +0000 Subject: [PATCH 2/6] remove submodule --- .gitmodules | 3 --- vendor/github.com/microsoft/vcpkg | 1 - 2 files changed, 4 deletions(-) delete mode 160000 vendor/github.com/microsoft/vcpkg diff --git a/.gitmodules b/.gitmodules index 917890b..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "vendor/github.com/microsoft/vcpkg"] - path = vendor/github.com/microsoft/vcpkg - url = git@github.com:microsoft/vcpkg.git diff --git a/vendor/github.com/microsoft/vcpkg b/vendor/github.com/microsoft/vcpkg deleted file mode 160000 index 856505b..0000000 --- a/vendor/github.com/microsoft/vcpkg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 856505bb767458c99d8e3c3ed441f59a058d3687 From c2099e72fadc2cfce1a42985eb562f6799777503 Mon Sep 17 00:00:00 2001 From: ccptoebeans Date: Fri, 24 Jul 2026 09:55:51 +0000 Subject: [PATCH 3/6] Ensure compatablility with MSVC v145 --- .gitmodules | 6 + CMakeLists.txt | 2 - CMakePresets.json | 129 ++++++++++-------- cmake/CcpGlobalSettings.cmake | 37 ----- cmake/triplets/universal-osx-debug.cmake | 11 -- cmake/triplets/universal-osx-internal.cmake | 11 -- cmake/triplets/universal-osx-release.cmake | 11 -- cmake/triplets/universal-osx-trinitydev.cmake | 11 -- cmake/triplets/x64-windows-debug.cmake | 12 -- cmake/triplets/x64-windows-internal.cmake | 12 -- cmake/triplets/x64-windows-release.cmake | 12 -- cmake/triplets/x64-windows-trinitydev.cmake | 12 -- vendor/github.com/carbonengine/vcpkg-registry | 1 + vendor/github.com/microsoft/vcpkg | 1 + 14 files changed, 79 insertions(+), 189 deletions(-) delete mode 100644 cmake/CcpGlobalSettings.cmake delete mode 100644 cmake/triplets/universal-osx-debug.cmake delete mode 100644 cmake/triplets/universal-osx-internal.cmake delete mode 100644 cmake/triplets/universal-osx-release.cmake delete mode 100644 cmake/triplets/universal-osx-trinitydev.cmake delete mode 100644 cmake/triplets/x64-windows-debug.cmake delete mode 100644 cmake/triplets/x64-windows-internal.cmake delete mode 100644 cmake/triplets/x64-windows-release.cmake delete mode 100644 cmake/triplets/x64-windows-trinitydev.cmake create mode 160000 vendor/github.com/carbonengine/vcpkg-registry create mode 160000 vendor/github.com/microsoft/vcpkg diff --git a/.gitmodules b/.gitmodules index e69de29..3296e62 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "vendor/github.com/microsoft/vcpkg"] + path = vendor/github.com/microsoft/vcpkg + url = git@github.com:microsoft/vcpkg.git +[submodule "vendor/github.com/carbonengine/vcpkg-registry"] + path = vendor/github.com/carbonengine/vcpkg-registry + url = git@github.com:carbonengine/vcpkg-registry.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 8968b40..0be44f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,6 @@ file (STRINGS "BuildNumber.txt" BUILD_NUMBER) string(REPLACE "\"" "" BUILD_NUMBER ${BUILD_NUMBER}) project(pdm VERSION ${BUILD_NUMBER}) -include(cmake/CcpGlobalSettings.cmake) - option(DLL_EXPORT "Export symbols (for building DLL)" OFF) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake) diff --git a/CMakePresets.json b/CMakePresets.json index f7eb5de..bd81cff 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -12,12 +12,16 @@ "binaryDir": "${sourceDir}/.cmake-build-${presetName}", "cacheVariables": { "VCPKG_USE_HOST_TOOLS": "ON", - "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake/triplets" + "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/vendor/github.com/carbonengine/vcpkg-registry/triplets" + }, + "environment": { + "PATH_TO_VCPKG_ROOT": "${sourceDir}/vendor/github.com/microsoft/vcpkg" }, "hidden": true }, { "name": "windows", + "inherits": "common", "condition": { "type": "equals", "lhs": "${hostSystemName}", @@ -27,137 +31,146 @@ }, { "name": "osx", + "inherits": "common", "condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin" }, + "hidden": true + }, + { + "name": "x64-windows", + "inherits": "windows", "cacheVariables": { - "CMAKE_OSX_ARCHITECTURES": "arm64;x86_64" + "VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/vendor/github.com/carbonengine/vcpkg-registry/toolchains/x64-windows-145-carbon.cmake" }, "hidden": true }, { - "name": "visual-studio", - "generator": "Visual Studio 17 2022", - "inherits": ["common", "windows"], - "toolset": { - "value": "v141" + "name": "arm64-osx", + "inherits": "osx", + "cacheVariables": { + "CMAKE_OSX_ARCHITECTURES": "arm64", + "VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/vendor/github.com/carbonengine/vcpkg-registry/toolchains/arm64-osx-carbon.cmake" }, "hidden": true }, { - "name": "ninja-multi-config", - "generator": "Ninja Multi-Config", - "inherits": "common", + "name": "x64-osx", + "inherits": "osx", + "cacheVariables": { + "CMAKE_OSX_ARCHITECTURES": "x86_64", + "VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/vendor/github.com/carbonengine/vcpkg-registry/toolchains/x64-osx-carbon.cmake" + }, "hidden": true }, { - "name": "vs-x64-windows-internal", - "inherits": "visual-studio", + "name": "x64-windows-internal", + "inherits": "x64-windows", "cacheVariables": { "CMAKE_BUILD_TYPE": "Internal", - "VCPKG_TARGET_TRIPLET": "x64-windows-internal", - "VCPKG_HOST_TRIPLET": "x64-windows-internal" + "VCPKG_TARGET_TRIPLET": "x64-windows-145-internal", + "VCPKG_HOST_TRIPLET": "x64-windows-145-internal" } }, { - "name": "vs-x64-windows-release", - "inherits": "visual-studio", + "name": "x64-windows-release", + "inherits": "x64-windows", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "VCPKG_TARGET_TRIPLET": "x64-windows-release", - "VCPKG_HOST_TRIPLET": "x64-windows-release" + "VCPKG_TARGET_TRIPLET": "x64-windows-145-release", + "VCPKG_HOST_TRIPLET": "x64-windows-145-release" } }, { - "name": "vs-x64-windows-debug", - "inherits": "visual-studio", + "name": "x64-windows-debug", + "inherits": "x64-windows", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", - "VCPKG_TARGET_TRIPLET": "x64-windows-debug", - "VCPKG_HOST_TRIPLET": "x64-windows-debug" + "VCPKG_TARGET_TRIPLET": "x64-windows-145-debug", + "VCPKG_HOST_TRIPLET": "x64-windows-145-debug" } }, { - "name": "vs-x64-windows-trinitydev", - "inherits": "visual-studio", + "name": "x64-windows-trinitydev", + "inherits": "x64-windows", "cacheVariables": { "CMAKE_BUILD_TYPE": "TrinityDev", - "VCPKG_TARGET_TRIPLET": "x64-windows-trinitydev", - "VCPKG_HOST_TRIPLET": "x64-windows-trinitydev" + "VCPKG_TARGET_TRIPLET": "x64-windows-145-trinitydev", + "VCPKG_HOST_TRIPLET": "x64-windows-145-trinitydev" } }, { - "name": "nmc-x64-windows-internal", - "inherits": ["ninja-multi-config", "windows"], + "name": "arm64-osx-internal", + "inherits": "arm64-osx", "cacheVariables": { "CMAKE_BUILD_TYPE": "Internal", - "VCPKG_TARGET_TRIPLET": "x64-windows-internal", - "VCPKG_HOST_TRIPLET": "x64-windows-internal" + "VCPKG_TARGET_TRIPLET": "arm64-osx-internal", + "VCPKG_HOST_TRIPLET": "arm64-osx-internal" } }, { - "name": "nmc-x64-windows-release", - "inherits": ["ninja-multi-config", "windows"], + "name": "arm64-osx-release", + "inherits": "arm64-osx", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "VCPKG_TARGET_TRIPLET": "x64-windows-release", - "VCPKG_HOST_TRIPLET": "x64-windows-release" + "VCPKG_TARGET_TRIPLET": "arm64-osx-release", + "VCPKG_HOST_TRIPLET": "arm64-osx-release" } }, { - "name": "nmc-x64-windows-debug", - "inherits": ["ninja-multi-config", "windows"], + "name": "arm64-osx-debug", + "inherits": "arm64-osx", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", - "VCPKG_TARGET_TRIPLET": "x64-windows-debug", - "VCPKG_HOST_TRIPLET": "x64-windows-debug" + "VCPKG_TARGET_TRIPLET": "arm64-osx-debug", + "VCPKG_HOST_TRIPLET": "arm64-osx-debug" } }, { - "name": "nmc-x64-windows-trinitydev", - "inherits": ["ninja-multi-config", "windows"], + "name": "arm64-osx-trinitydev", + "inherits": "arm64-osx", "cacheVariables": { "CMAKE_BUILD_TYPE": "TrinityDev", - "VCPKG_TARGET_TRIPLET": "x64-windows-trinitydev", - "VCPKG_HOST_TRIPLET": "x64-windows-trinitydev" + "VCPKG_TARGET_TRIPLET": "arm64-osx-trinitydev", + "VCPKG_HOST_TRIPLET": "arm64-osx-trinitydev" } }, { - "name": "nmc-universal-osx-internal", - "inherits": ["ninja-multi-config", "osx"], + "name": "x64-osx-internal", + "inherits": "x64-osx", "cacheVariables": { "CMAKE_BUILD_TYPE": "Internal", - "VCPKG_TARGET_TRIPLET": "universal-osx-internal", - "VCPKG_HOST_TRIPLET": "universal-osx-internal" + "VCPKG_TARGET_TRIPLET": "x64-osx-internal", + "VCPKG_HOST_TRIPLET": "x64-osx-internal" } }, { - "name": "nmc-universal-osx-release", - "inherits": ["ninja-multi-config", "osx"], + "name": "x64-osx-release", + "inherits": "x64-osx", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "VCPKG_TARGET_TRIPLET": "universal-osx-release", - "VCPKG_HOST_TRIPLET": "universal-osx-release" + "VCPKG_TARGET_TRIPLET": "x64-osx-release", + "VCPKG_HOST_TRIPLET": "x64-osx-release" } }, { - "name": "nmc-universal-osx-debug", - "inherits": ["ninja-multi-config", "osx"], + "name": "x64-osx-debug", + "inherits": "x64-osx", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", - "VCPKG_TARGET_TRIPLET": "universal-osx-debug", - "VCPKG_HOST_TRIPLET": "universal-osx-debug" + "VCPKG_TARGET_TRIPLET": "x64-osx-debug", + "VCPKG_HOST_TRIPLET": "x64-osx-debug" } }, { - "name": "nmc-universal-osx-trinitydev", - "inherits": ["ninja-multi-config", "osx"], + "name": "x64-osx-trinitydev", + "inherits": "x64-osx", "cacheVariables": { "CMAKE_BUILD_TYPE": "TrinityDev", - "VCPKG_TARGET_TRIPLET": "universal-osx-trinitydev", - "VCPKG_HOST_TRIPLET": "universal-osx-trinitydev" + "VCPKG_TARGET_TRIPLET": "x64-osx-trinitydev", + "VCPKG_HOST_TRIPLET": "x64-osx-trinitydev" } } ] diff --git a/cmake/CcpGlobalSettings.cmake b/cmake/CcpGlobalSettings.cmake deleted file mode 100644 index f313c60..0000000 --- a/cmake/CcpGlobalSettings.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright © 2026 CCP ehf. - -if(APPLE) - # Explicitly set the minimum macOS version we target; otherwise it defaults to whatever version - # we are building on, but we want to stick to our policy of supporting the last three releases. - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14 CACHE STRING "The minimum macOS version we target." FORCE) - message(STATUS "Building for minimum macOS version: ${CMAKE_OSX_DEPLOYMENT_TARGET}") - message(STATUS "Building for ${CMAKE_OSX_ARCHITECTURES} architecture") -endif() - -if(WIN32) - # Windows 10 is our minimum requirement, so make sure we're enforcing it. - add_compile_definitions(WINVER=0x0A00) - add_compile_definitions(_WIN32_WINNT=0x0A00) - add_compile_definitions(_WIN32_WINDOWS=0x0A00) - add_compile_definitions(NTDDI_VERSION=0x0A000000) - set(WIN_SDK_VERSION "10.0.17763.0") - set(CMAKE_SYSTEM_VERSION ${WIN_SDK_VERSION} CACHE STRING INTERNAL FORCE) - set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ${WIN_SDK_VERSION} CACHE STRING INTERNAL FORCE) -endif() - -# Require out-of-source builds -file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH) -if(EXISTS "${LOC_PATH}") - message(FATAL_ERROR "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please make a build subdirectory. Feel free to remove CMakeCache.txt and CMakeFiles.") -endif() - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_CXX_VISIBILITY_PRESET hidden) -set(CMAKE_OBJCXX_VISIBILITY_PRESET hidden) -set(CMAKE_XCODE_GENERATE_SCHEME ON) -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) -set_property(GLOBAL PROPERTY USE_FOLDERS ON) - diff --git a/cmake/triplets/universal-osx-debug.cmake b/cmake/triplets/universal-osx-debug.cmake deleted file mode 100644 index 9833ca4..0000000 --- a/cmake/triplets/universal-osx-debug.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright © 2026 CCP ehf. - -set(VCPKG_TARGET_ARCHITECTURE "arm64;x86_64") -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) -set(VCPKG_BUILD_TYPE "release") - -set(VCPKG_CMAKE_SYSTEM_NAME Darwin) -set(VCPKG_OSX_ARCHITECTURES "arm64;x86_64") - -set(CARBON_BUILD_TYPE "Debug") diff --git a/cmake/triplets/universal-osx-internal.cmake b/cmake/triplets/universal-osx-internal.cmake deleted file mode 100644 index c294d73..0000000 --- a/cmake/triplets/universal-osx-internal.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright © 2026 CCP ehf. - -set(VCPKG_TARGET_ARCHITECTURE "arm64;x86_64") -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) -set(VCPKG_BUILD_TYPE "release") - -set(VCPKG_CMAKE_SYSTEM_NAME Darwin) -set(VCPKG_OSX_ARCHITECTURES "arm64;x86_64") - -set(CARBON_BUILD_TYPE "Internal") diff --git a/cmake/triplets/universal-osx-release.cmake b/cmake/triplets/universal-osx-release.cmake deleted file mode 100644 index 6e5475f..0000000 --- a/cmake/triplets/universal-osx-release.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright © 2026 CCP ehf. - -set(VCPKG_TARGET_ARCHITECTURE "arm64;x86_64") -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) -set(VCPKG_BUILD_TYPE "release") - -set(VCPKG_CMAKE_SYSTEM_NAME Darwin) -set(VCPKG_OSX_ARCHITECTURES "arm64;x86_64") - -set(CARBON_BUILD_TYPE "Release") diff --git a/cmake/triplets/universal-osx-trinitydev.cmake b/cmake/triplets/universal-osx-trinitydev.cmake deleted file mode 100644 index 36590f2..0000000 --- a/cmake/triplets/universal-osx-trinitydev.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright © 2026 CCP ehf. - -set(VCPKG_TARGET_ARCHITECTURE "arm64;x86_64") -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) -set(VCPKG_BUILD_TYPE "release") - -set(VCPKG_CMAKE_SYSTEM_NAME Darwin) -set(VCPKG_OSX_ARCHITECTURES "arm64;x86_64") - -set(CARBON_BUILD_TYPE "TrinityDev") diff --git a/cmake/triplets/x64-windows-debug.cmake b/cmake/triplets/x64-windows-debug.cmake deleted file mode 100644 index cabeffb..0000000 --- a/cmake/triplets/x64-windows-debug.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright © 2026 CCP ehf. - -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) -set(VCPKG_PLATFORM_TOOLSET v141) -set(VCPKG_BUILD_TYPE "release") - -set(VCPKG_CMAKE_SYSTEM_VERSION "10.0.17763.0") -set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_MSVC_RUNTIME_LIBRARY:STRING=MultiThreadedDLL) - -set(CARBON_BUILD_TYPE "Debug") diff --git a/cmake/triplets/x64-windows-internal.cmake b/cmake/triplets/x64-windows-internal.cmake deleted file mode 100644 index a8ce255..0000000 --- a/cmake/triplets/x64-windows-internal.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright © 2026 CCP ehf. - -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) -set(VCPKG_PLATFORM_TOOLSET v141) -set(VCPKG_BUILD_TYPE "release") - -set(VCPKG_CMAKE_SYSTEM_VERSION "10.0.17763.0") -set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_MSVC_RUNTIME_LIBRARY:STRING=MultiThreadedDLL) - -set(CARBON_BUILD_TYPE "Internal") diff --git a/cmake/triplets/x64-windows-release.cmake b/cmake/triplets/x64-windows-release.cmake deleted file mode 100644 index 4dc3854..0000000 --- a/cmake/triplets/x64-windows-release.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright © 2026 CCP ehf. - -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) -set(VCPKG_PLATFORM_TOOLSET v141) -set(VCPKG_BUILD_TYPE "release") - -set(VCPKG_CMAKE_SYSTEM_VERSION "10.0.17763.0") -set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_MSVC_RUNTIME_LIBRARY:STRING=MultiThreadedDLL) - -set(CARBON_BUILD_TYPE "Release") diff --git a/cmake/triplets/x64-windows-trinitydev.cmake b/cmake/triplets/x64-windows-trinitydev.cmake deleted file mode 100644 index c7be220..0000000 --- a/cmake/triplets/x64-windows-trinitydev.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright © 2026 CCP ehf. - -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) -set(VCPKG_PLATFORM_TOOLSET v141) -set(VCPKG_BUILD_TYPE "release") - -set(VCPKG_CMAKE_SYSTEM_VERSION "10.0.17763.0") -set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_MSVC_RUNTIME_LIBRARY:STRING=MultiThreadedDLL) - -set(CARBON_BUILD_TYPE "TrinityDev") diff --git a/vendor/github.com/carbonengine/vcpkg-registry b/vendor/github.com/carbonengine/vcpkg-registry new file mode 160000 index 0000000..1477f95 --- /dev/null +++ b/vendor/github.com/carbonengine/vcpkg-registry @@ -0,0 +1 @@ +Subproject commit 1477f954feb21b845d5aee75ccd3f6e0133f25cd diff --git a/vendor/github.com/microsoft/vcpkg b/vendor/github.com/microsoft/vcpkg new file mode 160000 index 0000000..2475cc3 --- /dev/null +++ b/vendor/github.com/microsoft/vcpkg @@ -0,0 +1 @@ +Subproject commit 2475cc332a47b3a63bb3de58293bdab7726613ca From a6a91462ee0375df2f9f68c58d1f9915661d17c4 Mon Sep 17 00:00:00 2001 From: ccptoebeans Date: Fri, 24 Jul 2026 10:00:26 +0000 Subject: [PATCH 4/6] Ad teamcity config to pdm --- .teamcity/MacOS/Project.kt | 197 +++++++++++++ .teamcity/Windows/Project.kt | 252 +++++++++++++++++ .teamcity/_Self.kt/Project.kt | 25 ++ .../buildTypes/CreateUniversalBuilds.kt | 167 +++++++++++ .../_Self.kt/buildTypes/PublishToPerforce.kt | 264 ++++++++++++++++++ .teamcity/pom.xml | 104 +++++++ .teamcity/settings.kts | 35 +++ 7 files changed, 1044 insertions(+) create mode 100644 .teamcity/MacOS/Project.kt create mode 100644 .teamcity/Windows/Project.kt create mode 100644 .teamcity/_Self.kt/Project.kt create mode 100644 .teamcity/_Self.kt/buildTypes/CreateUniversalBuilds.kt create mode 100644 .teamcity/_Self.kt/buildTypes/PublishToPerforce.kt create mode 100644 .teamcity/pom.xml create mode 100644 .teamcity/settings.kts diff --git a/.teamcity/MacOS/Project.kt b/.teamcity/MacOS/Project.kt new file mode 100644 index 0000000..1b1f82f --- /dev/null +++ b/.teamcity/MacOS/Project.kt @@ -0,0 +1,197 @@ +// Copyright © 2025 CCP ehf. + +package MacOS + +import jetbrains.buildServer.configs.kotlin.DslContext +import jetbrains.buildServer.configs.kotlin.Project +import jetbrains.buildServer.configs.kotlin.* +import jetbrains.buildServer.configs.kotlin.buildFeatures.PullRequests +import jetbrains.buildServer.configs.kotlin.buildFeatures.XmlReport +import jetbrains.buildServer.configs.kotlin.buildFeatures.commitStatusPublisher +import jetbrains.buildServer.configs.kotlin.buildFeatures.freeDiskSpace +import jetbrains.buildServer.configs.kotlin.buildFeatures.nuGetFeedCredentials +import jetbrains.buildServer.configs.kotlin.buildFeatures.perfmon +import jetbrains.buildServer.configs.kotlin.buildFeatures.pullRequests +import jetbrains.buildServer.configs.kotlin.buildFeatures.sshAgent +import jetbrains.buildServer.configs.kotlin.buildFeatures.xmlReport +import jetbrains.buildServer.configs.kotlin.buildSteps.exec +import jetbrains.buildServer.configs.kotlin.buildSteps.powerShell +import jetbrains.buildServer.configs.kotlin.buildSteps.python +import jetbrains.buildServer.configs.kotlin.buildSteps.script +import jetbrains.buildServer.configs.kotlin.triggers.vcs +import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot +import jetbrains.buildServer.configs.kotlin.buildFeatures.provideAwsCredentials + +val arm64_Debug = CarbonBuildMacOS("Debug MacOS arm64", "Debug", "arm64-osx-debug", "aarch64") +val arm64_Internal = CarbonBuildMacOS("Internal MacOS arm64", "Internal", "arm64-osx-internal", "aarch64") +val arm64_TrinityDev = CarbonBuildMacOS("TrinityDev MacOS arm64", "TrinityDev", "arm64-osx-trinitydev", "aarch64") +val arm64_Release = CarbonBuildMacOS("Release MacOS arm64", "Release", "arm64-osx-release", "aarch64") + +val x64_Debug = CarbonBuildMacOS("Debug MacOS x64", "Debug", "x64-osx-debug", "x86_64") +val x64_Internal = CarbonBuildMacOS("Internal MacOS x64", "Internal", "x64-osx-internal", "x86_64") +val x64_TrinityDev = CarbonBuildMacOS("TrinityDev MacOS x64", "TrinityDev", "x64-osx-trinitydev", "x86_64") +val x64_Release = CarbonBuildMacOS("Release MacOS x64", "Release", "x64-osx-release", "x86_64") + +object Project : Project({ + id("MacOS") + name = "macOS" + + buildType(_Self.buildTypes.CreateUniversalBuilds) + + buildType(arm64_Debug) + buildType(arm64_Internal) + buildType(arm64_TrinityDev) + buildType(arm64_Release) + + buildType(x64_Debug) + buildType(x64_Internal) + buildType(x64_TrinityDev) + buildType(x64_Release) +}) + +class CarbonBuildMacOS(buildName: String, configType: String, preset: String, agentArchitecture: String) : BuildType({ + id(buildName.toId()) + name = buildName + + artifactRules = "%env.CMAKE_INSTALL_PREFIX%" + + params { + param("env.SENTRY_CLI_DEBUG_SYMBOL_TYPE", "dsym") + param("env.GIT_TAG_HASH_OVERRIDE", "") + param("env.CMAKE_CONFIG_TYPE", configType) + param("env.CMAKE_GENERATOR", "Ninja Multi-Config") + param("teamcity.vcsTrigger.runBuildInNewEmptyBranch", "true") + param("github_checkout_folder", "github") + param("env.CTEST_JUNIT_OUTPUT_FILE", "ctest_results.xml") + select("env.VISUAL_STUDIO_PLATFORM_TOOLSET", "v141", label = "Visual Studio Platform Toolset", description = "Specify the toolset for the build. e.g. v141 or v143.", + options = listOf("v141 (2017)" to "v141", "v143 (2022)" to "v143")) + param("env.CMAKE_BUILD_TARGETS", "all") + param("env.CMAKE_INSTALL_PREFIX", ".build-artifact") + param("env.SENTRY_PROJECT", "exefile-crashes") + param("env.CMAKE_BUILD_FOLDER", ".cmake-build-%build.number%") + param("env.GIT_TAG_HASH", "") + param("env.EXECUTABLE_FILENAMES_MATCH", "") + param("env.CMAKE_PRESET", preset) + param("env.VCPKG_BINARY_SOURCES", "clear;x-aws,s3://vcpkg-binary-cache-static/cache/,readwrite") + param("env.X_VCPKG_REGISTRIES_CACHE", "%teamcity.build.checkoutDir%/%github_checkout_folder%/regcache") + param("env.CMAKE_BUILD_PARALLEL_LEVEL", "8") + param("env.CTEST_PARALLEL_LEVEL", "1") + } + + + vcs { + root(DslContext.settingsRootId, "+:. => %github_checkout_folder%") + root(AbsoluteId("CarbonPipelineTools"), "+:. => carbon_pipeline_tools") + cleanCheckout = true + } + + steps { + exec { + name = "Create VCPKG registrycache location" + workingDir = "%teamcity.build.checkoutDir%/%github_checkout_folder%" + path = "mkdir" + arguments = "regcache" + } + exec { + name = "(macOS) Get Git Tag/Hash" + workingDir = "%teamcity.build.checkoutDir%/%github_checkout_folder%" + path = "python3" + arguments = "%teamcity.build.checkoutDir%/carbon_pipeline_tools/carbon/GetGitTagAndOrHash.py" + } + exec { + name = "(macOS) Remove build artifacts folder" + path = "rm" + arguments = "-rf %env.CMAKE_INSTALL_PREFIX%" + } + exec { + name = "Configure" + path = "cmake" + arguments = "--preset %env.CMAKE_PRESET% -S %teamcity.build.checkoutDir%/%github_checkout_folder% -B %env.CMAKE_BUILD_FOLDER% -DINSTALL_TO_MONOLITH=ON -DCMAKE_INSTALL_PREFIX=%env.CMAKE_INSTALL_PREFIX% -DVCPKG_INSTALL_OPTIONS=--x-buildtrees-root=%teamcity.build.checkoutDir%/%github_checkout_folder%/buildtrees" + } + exec { + name = "Build" + path = "cmake" + arguments = "--build %env.CMAKE_BUILD_FOLDER% --config %env.CMAKE_CONFIG_TYPE% --target %env.CMAKE_BUILD_TARGETS%" + } + exec { + name = "Run Tests" + workingDir = "%env.CMAKE_BUILD_FOLDER%" + path = "ctest" + arguments = "-C %env.CMAKE_CONFIG_TYPE% -V --output-on-failure --output-junit %env.CTEST_JUNIT_OUTPUT_FILE%" + } + exec { + name = "Package artifact" + path = "cmake" + arguments = "--install %env.CMAKE_BUILD_FOLDER% --config %env.CMAKE_CONFIG_TYPE%" + } + exec { + name = "Upload symbols to sentry" + path = "sentry-cli" + arguments = "upload-dif --wait %env.CMAKE_BUILD_FOLDER%" + param("script.content", """ + #!/usr/bin/env bash -eu + filesWithSymbols = ( + # insert your binary files with symbols here! + ) + """.trimIndent()) + } + } + + triggers { + vcs { + triggerRules = "+:root=${DslContext.settingsRootId.id}:." + branchFilter = """ + +: + +pr:* + """.trimIndent() + } + } + + features { + pullRequests { + vcsRootExtId = "${DslContext.settingsRootId.id}" + provider = github { + authType = token { + token = "%GITHUB_CARBON_PAT%" + } + filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER + filterTargetBranch = """ + +:refs/heads/* + -:refs/heads/release/3.x + -:refs/heads/release/2.x + -:refs/heads/release/1.x + """.trimIndent() + } + } + commitStatusPublisher { + publisher = github { + githubUrl = "https://api.github.com" + authType = personalToken { + token = "%GITHUB_CARBON_PAT%" + } + } + } + xmlReport { + reportType = XmlReport.XmlReportType.JUNIT + rules = "+:%env.CMAKE_BUILD_FOLDER%/%env.CTEST_JUNIT_OUTPUT_FILE%" + verbose = true + } + perfmon { + } + freeDiskSpace { + requiredSpace = "10gb" + failBuild = true + } + sshAgent { + teamcitySshKey = "ccpgames-evetech GitHub" + } + provideAwsCredentials { + awsConnectionId = "Carbon_AwsVcpkgBinaryCacheServiceAccount" + } + } + + requirements { + startsWith("teamcity.agent.jvm.os.name", "Mac OS X") + startsWith("teamcity.agent.jvm.os.arch", agentArchitecture) + } +}) diff --git a/.teamcity/Windows/Project.kt b/.teamcity/Windows/Project.kt new file mode 100644 index 0000000..f56bdb5 --- /dev/null +++ b/.teamcity/Windows/Project.kt @@ -0,0 +1,252 @@ +// Copyright © 2025 CCP ehf. + +package Windows + +import jetbrains.buildServer.configs.kotlin.DslContext +import jetbrains.buildServer.configs.kotlin.Project +import jetbrains.buildServer.configs.kotlin.* +import jetbrains.buildServer.configs.kotlin.buildFeatures.PullRequests +import jetbrains.buildServer.configs.kotlin.buildFeatures.XmlReport +import jetbrains.buildServer.configs.kotlin.buildFeatures.commitStatusPublisher +import jetbrains.buildServer.configs.kotlin.buildFeatures.freeDiskSpace +import jetbrains.buildServer.configs.kotlin.buildFeatures.nuGetFeedCredentials +import jetbrains.buildServer.configs.kotlin.buildFeatures.perfmon +import jetbrains.buildServer.configs.kotlin.buildFeatures.pullRequests +import jetbrains.buildServer.configs.kotlin.buildFeatures.sshAgent +import jetbrains.buildServer.configs.kotlin.buildFeatures.xmlReport +import jetbrains.buildServer.configs.kotlin.buildSteps.exec +import jetbrains.buildServer.configs.kotlin.buildSteps.powerShell +import jetbrains.buildServer.configs.kotlin.buildSteps.python +import jetbrains.buildServer.configs.kotlin.buildSteps.script +import jetbrains.buildServer.configs.kotlin.triggers.vcs +import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot +import jetbrains.buildServer.configs.kotlin.buildFeatures.provideAwsCredentials + +val Debug = CarbonBuildWindows("Debug Windows", "Debug", "x64-windows-debug") +val Internal = CarbonBuildWindows("Internal Windows", "Internal", "x64-windows-internal") +val TrinityDev = CarbonBuildWindows("TrinityDev Windows", "TrinityDev", "x64-windows-trinitydev") +val Release = CarbonBuildWindows("Release Windows", "Release", "x64-windows-release") + +object Project : Project({ + id("Windows") + name = "Windows" + + buildType(Debug) + buildType(Internal) + buildType(TrinityDev) + buildType(Release) +}) + + +class CarbonBuildWindows(buildName: String, configType: String, preset: String) : BuildType({ + id(buildName.toId()) + this.name = buildName + + artifactRules = "%env.CMAKE_INSTALL_PREFIX%" + + params { + param("env.GIT_TAG_HASH_OVERRIDE", "") + param("github_checkout_folder", "github") + param("env.CTEST_JUNIT_OUTPUT_FILE", "ctest_results.xml") + select("env.VISUAL_STUDIO_PLATFORM_TOOLSET", "v141", label = "Visual Studio Platform Toolset", description = "Specify the toolset for the build. e.g. v141 or v143.", + options = listOf("v141 (2017)" to "v141", "v143 (2022)" to "v143")) + param("env.CMAKE_BUILD_TARGETS", "all") + param("env.CMAKE_INSTALL_PREFIX", ".build-artifact") + param("env.CMAKE_CONFIG_TYPE", configType) + param("env.SENTRY_PROJECT", "exefile-crashes") + param("env.CMAKE_BUILD_FOLDER", ".cmake-build-%build.number%") + param("env.CMAKE_GENERATOR", "Ninja Multi-Config") + param("env.GIT_TAG_HASH", "") + param("env.EXECUTABLE_FILENAMES_MATCH", "") + param("teamcity.vcsTrigger.runBuildInNewEmptyBranch", "true") + param("env.CMAKE_PRESET", preset) + param("env.VCPKG_BINARY_SOURCES", "clear;x-aws,s3://vcpkg-binary-cache-static/cache/,readwrite") + param("env.X_VCPKG_REGISTRIES_CACHE", "%teamcity.build.checkoutDir%/%github_checkout_folder%/regcache") + param("env.CMAKE_BUILD_PARALLEL_LEVEL", "8") + param("env.CTEST_PARALLEL_LEVEL", "1") + } + + vcs { + root(DslContext.settingsRootId, "+:. => %github_checkout_folder%") + root(AbsoluteId("CarbonPipelineTools"), "+:. => carbon_pipeline_tools") + cleanCheckout = true + } + + steps { + exec { + name = "Create VCPKG registrycache location" + workingDir = "%teamcity.build.checkoutDir%/%github_checkout_folder%" + path = "mkdir" + arguments = "regcache" + } + exec { + name = "(Windows) Get Git Tag/Hash" + workingDir = "%teamcity.build.checkoutDir%/%github_checkout_folder%" + path = "python" + arguments = "%teamcity.build.checkoutDir%/carbon_pipeline_tools/carbon/GetGitTagAndOrHash.py" + } + script { + name = "(Windows) Bootstrap Build environment" + workingDir = "%teamcity.agent.work.dir%" + scriptContent = """ + REM unfortunately ninja does not find the VS environment otherwise + REM NB: the exported PATH also contains the location where we installed sentry-cli, e.g. teamcity.agent.work.dir + call "%%ProgramFiles(x86)%%\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\vsdevcmd.bat" -arch=x64 + echo ##teamcity[setParameter name='env.INCLUDE' value='%%INCLUDE%%'] + echo ##teamcity[setParameter name='env.LIB' value='%%LIB%%'] + echo ##teamcity[setParameter name='env.LIBPATH' value='%%LIBPATH%%'] + echo ##teamcity[setParameter name='env.PATH' value='%teamcity.agent.work.dir%;%%PATH%%'] + """.trimIndent() + } + exec { + name = "Configure" + path = "cmake" + arguments = "--preset %env.CMAKE_PRESET% -S %teamcity.build.checkoutDir%/%github_checkout_folder% -B %env.CMAKE_BUILD_FOLDER% -DINSTALL_TO_MONOLITH=ON -DCMAKE_INSTALL_PREFIX=%env.CMAKE_INSTALL_PREFIX% -DVCPKG_INSTALL_OPTIONS=--x-buildtrees-root=%teamcity.build.checkoutDir%/%github_checkout_folder%/buildtrees" + } + exec { + name = "Build" + path = "cmake" + arguments = "--build %env.CMAKE_BUILD_FOLDER% --config %env.CMAKE_CONFIG_TYPE% --target %env.CMAKE_BUILD_TARGETS%" + } + exec { + name = "Run Tests" + workingDir = "%env.CMAKE_BUILD_FOLDER%" + path = "ctest" + arguments = "-C %env.CMAKE_CONFIG_TYPE% -V --output-on-failure --output-junit %env.CTEST_JUNIT_OUTPUT_FILE%" + } + exec { + name = "Package artifact" + path = "cmake" + arguments = "--install %env.CMAKE_BUILD_FOLDER% --config %env.CMAKE_CONFIG_TYPE%" + } + exec { + name = "Upload symbols to sentry" + path = "sentry-cli" + arguments = "upload-dif --wait %env.CMAKE_BUILD_FOLDER%" + param("script.content", """ + #!/usr/bin/env bash -eu + filesWithSymbols = ( + # insert your binary files with symbols here! + ) + """.trimIndent()) + } + script { + name = "(Windows) CMD Upload debug symbols to internal symbol server" + scriptContent = """ + @echo off + ( + echo ${'$'}User = "%DOMAIN_USER%" + echo ${'$'}Password = ConvertTo-SecureString -String "%DOMAIN_USER_PASSWORD%" -AsPlainText -Force + echo ${'$'}Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ${'$'}User, ${'$'}Password + echo New-PSDrive -Name "symbols" -PSProvider FileSystem -Root ${'$'}Env:TC_SYMBOL_STORE_PATH -Credential ${'$'}Credential + echo Write-Host "##teamcity[progressMessage 'Storing symbols']" + echo ${'$'}symstoreFlags = ^@^("add","/compress","/t", "CCP Games", "/c", "TeamCity %build.number%", "/s", "${'$'}Env:TC_SYMBOL_STORE_PATH", "/o", "/r", "/f", "%env.CMAKE_BUILD_FOLDER%"^) + echo ^& ${'$'}Env:TC_SYMSTORE_PATH ${'$'}symstoreFlags ^| Tee-Object -file symstore.txt + echo ${'$'}stored = get-content symstore.txt ^| Select-String "^SYMSTORE: Number of files stored = (.*)${'$'}" + echo ${'$'}stored = ${'$'}stored.Matches.Groups[1].Value + echo ${'$'}errors = get-content symstore.txt ^| Select-String "^SYMSTORE: Number of errors = (.*)${'$'}" + echo ${'$'}errors = ${'$'}errors.Matches.Groups[1].Value + echo ${'$'}ignored = get-content symstore.txt ^| Select-String "^SYMSTORE: Number of files ignored = (.*)${'$'}" + echo ${'$'}ignored = ${'$'}ignored.Matches.Groups[1].Value + echo Write-Host "##teamcity[buildStatus text='Stored: ${'$'}stored, Errors: ${'$'}errors, Ignored: ${'$'}ignored']" + ) > file.ps1 + powershell -File file.ps1 + """.trimIndent() + } + powerShell { + name = "(Windows) Upload debug symbols to internal symbol server" + enabled = false + + conditions { + startsWith("teamcity.agent.jvm.os.name", "Windows") + } + scriptMode = script { + content = """ + ${'$'}User = "%DOMAIN_USER%" + ${'$'}Password = ConvertTo-SecureString -String "%DOMAIN_USER_PASSWORD%" -AsPlainText -Force + ${'$'}Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ${'$'}User, ${'$'}Password + New-PSDrive -Name "symbols" -PSProvider FileSystem -Root ${'$'}Env:TC_SYMBOL_STORE_PATH -Credential ${'$'}Credential + + Write-Host "##teamcity[progressMessage 'Storing symbols']" + ${'$'}symstoreFlags = @("add", + "/compress", + "/t", "CCP Games", # Product Name + "/c", "TeamCity %build.number%", #Comment + "/s", "${'$'}Env:TC_SYMBOL_STORE_PATH", # Store destination + "/o", # Verbose + "/r", # Recursive + "/f", "%env.CMAKE_BUILD_FOLDER%") # source folder + & ${'$'}Env:TC_SYMSTORE_PATH ${'$'}symstoreFlags | Tee-Object -file symstore.txt + + ${'$'}stored = get-content symstore.txt | Select-String "^SYMSTORE: Number of files stored = (.*)${'$'}" + ${'$'}stored = ${'$'}stored.Matches.Groups[1].Value + + ${'$'}errors = get-content symstore.txt | Select-String "^SYMSTORE: Number of errors = (.*)${'$'}" + ${'$'}errors = ${'$'}errors.Matches.Groups[1].Value + + ${'$'}ignored = get-content symstore.txt | Select-String "^SYMSTORE: Number of files ignored = (.*)${'$'}" + ${'$'}ignored = ${'$'}ignored.Matches.Groups[1].Value + + Write-Host "##teamcity[buildStatus text='Stored: ${'$'}stored, Errors: ${'$'}errors, Ignored: ${'$'}ignored']" + """.trimIndent() + } + } + } + + triggers { + vcs { + triggerRules = "+:root=${DslContext.settingsRootId.id}:." + branchFilter = """ + +: + +pr:* + """.trimIndent() + } + } + + features { + pullRequests { + vcsRootExtId = "${DslContext.settingsRootId.id}" + provider = github { + authType = token { + token = "%GITHUB_CARBON_PAT%" + } + filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER + filterTargetBranch = """ + +:refs/heads/* + -:refs/heads/release/3.x + -:refs/heads/release/2.x + -:refs/heads/release/1.x + """.trimIndent() + } + } + commitStatusPublisher { + publisher = github { + githubUrl = "https://api.github.com" + authType = personalToken { + token = "%GITHUB_CARBON_PAT%" + } + } + } + xmlReport { + reportType = XmlReport.XmlReportType.JUNIT + rules = "+:%env.CMAKE_BUILD_FOLDER%/%env.CTEST_JUNIT_OUTPUT_FILE%" + verbose = true + } + perfmon { + } + freeDiskSpace { + requiredSpace = "10gb" + failBuild = true + } + sshAgent { + teamcitySshKey = "ccpgames-evetech GitHub" + } + provideAwsCredentials { + awsConnectionId = "Carbon_AwsVcpkgBinaryCacheServiceAccount" + } + } + + requirements { + startsWith("teamcity.agent.jvm.os.name", "Windows Server") + } +}) diff --git a/.teamcity/_Self.kt/Project.kt b/.teamcity/_Self.kt/Project.kt new file mode 100644 index 0000000..52c8b70 --- /dev/null +++ b/.teamcity/_Self.kt/Project.kt @@ -0,0 +1,25 @@ +// Copyright © 2025 CCP ehf. + +package _Self + +import _Self.buildTypes.* +import jetbrains.buildServer.configs.kotlin.* +import jetbrains.buildServer.configs.kotlin.Project +import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot + + +object Project : Project({ + + description = "Build / Publish pipeline for https://github.com/carbonengine/pdm" + + params { + /* before changing carbon_ref, make sure to disable automatic settings synchronization on teamcity */ + param("carbon_ref", "refs/heads/main") + param("carbon-pipeline-tools-ref", "refs/heads/main") + } + + subProject(Windows.Project) + subProject(MacOS.Project) + + buildType(PublishToPerforce) +}) diff --git a/.teamcity/_Self.kt/buildTypes/CreateUniversalBuilds.kt b/.teamcity/_Self.kt/buildTypes/CreateUniversalBuilds.kt new file mode 100644 index 0000000..0a770b6 --- /dev/null +++ b/.teamcity/_Self.kt/buildTypes/CreateUniversalBuilds.kt @@ -0,0 +1,167 @@ +// Copyright © 2026 CCP ehf. + +package _Self.buildTypes + +import jetbrains.buildServer.configs.kotlin.* +import jetbrains.buildServer.configs.kotlin.buildFeatures.vcsLabeling +import jetbrains.buildServer.configs.kotlin.triggers.vcs +import jetbrains.buildServer.configs.kotlin.buildSteps.python +import jetbrains.buildServer.configs.kotlin.buildSteps.script +import jetbrains.buildServer.configs.kotlin.buildSteps.exec + +class UniversalBuild() : BuildType({ + name = "Create MacOS Universal Binaries" + + params{ + param("carbon-pipeline-tools-ref", "refs/heads/main") + param("universal-output-dir", "%system.teamcity.build.workingDir%/output_build") + param("universal-lib-path", "lib/macOS/universal/AppleClang/") + param("universal-bin-path", "bin/macOS/universal/AppleClang/") + param("x64-lib-path", "lib/macOS/x64") + param("arm64-lib-path", "lib/macOS/arm64") + param("x64-bin-path", "bin/macOS/x64") + param("arm64-bin-path", "bin/macOS/arm64") + text("file-matchers", + "-m '*.so:%system.teamcity.build.workingDir%/lib' -m '*.dylib:%system.teamcity.build.workingDir%/lib' -m '*.a:%system.teamcity.build.workingDir%/lib'", + label = "lipo-build matchers", + description = """ + -m '*.so:lib' to tell the tool to lipo together .so files and output the fat binaries to lib/. + You can supply multiple matchers. You don't need to specify an output directory: -m '*.so' + Matchers without destination directories will be placed in 'universal-output-dir' + """.trimIndent() + ) + } + + artifactRules = "%universal-output-dir%" + + vcs { + root(AbsoluteId("CarbonPipelineTools"), "+:carbon/.=>carbon") + + checkoutMode = CheckoutMode.ON_AGENT + cleanCheckout = true + } + + steps { + exec { + name = "Create output location" + id = "output_location" + path = "mkdir" + arguments = "%universal-output-dir%" + } + script { + name = "Populate output location" + id = "populate_output_location" + scriptContent = """ + cp -r %system.teamcity.build.workingDir%/x64/* %universal-output-dir%/ + cp -r %system.teamcity.build.workingDir%/arm64/* %universal-output-dir%/ + """.trimIndent() + } + python { + name = "Run lipo" + id = "run_lipo" + environment = venv { + requirementsFile = "" + } + command = file { + filename = "carbon/lipo-builds.py" + scriptArguments = "%file-matchers% -a %system.teamcity.build.workingDir%/arm64 -x %system.teamcity.build.workingDir%/x64 -o %system.teamcity.build.workingDir%" + } + } + script { + name = "Prepare universal build artifact" + id = "prep_artifact" + scriptContent = """ + mkdir -p %universal-output-dir%/%universal-lib-path% + mkdir -p %universal-output-dir%/%universal-bin-path% + cp %system.teamcity.build.workingDir%/lib/* %universal-output-dir%/%universal-lib-path% + cp %system.teamcity.build.workingDir%/bin/* %universal-output-dir%/%universal-bin-path% + rm -r %universal-output-dir%/%x64-lib-path% + rm -r %universal-output-dir%/%arm64-lib-path% + """.trimIndent() + } + } + + dependencies { + dependency(MacOS.arm64_Debug) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%system.teamcity.build.workingDir%/arm64" + } + } + dependency(MacOS.x64_Debug) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%system.teamcity.build.workingDir%/x64" + } + } + + dependency(MacOS.arm64_Release) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%system.teamcity.build.workingDir%/arm64" + } + } + dependency(MacOS.x64_Release) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%system.teamcity.build.workingDir%/x64" + } + } + + dependency(MacOS.arm64_Internal) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%system.teamcity.build.workingDir%/arm64" + } + } + dependency(MacOS.x64_Internal) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%system.teamcity.build.workingDir%/x64" + } + } + + dependency(MacOS.arm64_TrinityDev) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%system.teamcity.build.workingDir%/arm64" + } + } + dependency(MacOS.x64_TrinityDev) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%system.teamcity.build.workingDir%/x64" + } + } + } + + requirements { + startsWith("teamcity.agent.jvm.os.name", "Mac OS X") + } +}) + +val CreateUniversalBuilds = UniversalBuild() \ No newline at end of file diff --git a/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt b/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt new file mode 100644 index 0000000..46c174d --- /dev/null +++ b/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt @@ -0,0 +1,264 @@ +// Copyright © 2025 CCP ehf. + +package _Self.buildTypes + +import jetbrains.buildServer.configs.kotlin.* +import jetbrains.buildServer.configs.kotlin.buildFeatures.vcsLabeling +import jetbrains.buildServer.configs.kotlin.triggers.vcs +import jetbrains.buildServer.configs.kotlin.buildSteps.python +import jetbrains.buildServer.configs.kotlin.buildSteps.powerShell + + + +class Publish(perforce_publish_path: String) : BuildType({ + name = "Publish to Perforce" + + enablePersonalBuilds = false + type = BuildTypeSettings.Type.DEPLOYMENT + maxRunningBuilds = 1 + + params { + select("project", "frontier", label = "Which project to publish into?", description = "e.g. EVE or Frontier or Frontier Stream", display = ParameterDisplay.PROMPT, + options = listOf("EVE Online" to "eve", "Frontier" to "eve-frontier", "Frontier Stream" to "frontier")) + + param("perforce_path_to_publish_into", perforce_publish_path) + + param("env.P4PASSWD", "%platform_automation_pass%") + param("env.P4USER", "platform_automation") + text("reverse.dep.*.env.GIT_TAG_HASH_OVERRIDE", "", label = "GTH override for component version in vendor", description = "GIT TAG HASH OVERRIDE, IF NEEDED FOR DEPENDENCIES", display = ParameterDisplay.PROMPT, allowEmpty = true) + param("env.TC_BUILD_URL", "%teamcity.serverUrl%/viewLog.html?buildId=%teamcity.build.id%") + text("eve_branch_shortname", "", label = "Branch Name", description = """The name of the branch, for example MAINLINE""", display = ParameterDisplay.PROMPT, allowEmpty = false) + param("env.TC_BUILDID", "%teamcity.build.id%") + param("env.TC_BUILD_NUMBER", "Carbon PDM #%build.number%") + param("env.P4PORT", "p4is.ccp.ad.local:1666") + param("env.TC_EVE_BRANCH_SHORTNAME", "%eve_branch_shortname%") + param("env.TC_EVE_PROJECT", "%project%") + param("carbon-pipeline-tools-ref", "refs/heads/main") + select("eve_branch_path", "//%project%/%eve_branch_shortname%/", label = "Perforce branch", description = "Is this a regular perforce branch or a perforce stream? Used for setting the proper branch path.", display = ParameterDisplay.PROMPT, + options = listOf("Regular" to "//%project%/branches/%eve_branch_type%/%eve_branch_shortname%/", "Frontier Stream" to "//%project%/%eve_branch_shortname%/")) + select("eve_branch_type", "sandbox", label = "Branch type", description = "The type of branch to publish into", display = ParameterDisplay.PROMPT, + options = listOf("Sandbox" to "sandbox", "Development" to "development", "Release" to "release", "Staging" to "staging", "Stream" to "")) + param("env.TC_PERFORCE_PATH_TO_PUBLISH_INTO", "%perforce_path_to_publish_into%") + param("env.EXECUTABLE_FILENAMES_MATCH", "") + + select("reverse.dep.*.env.VISUAL_STUDIO_PLATFORM_TOOLSET", "v141", label = "Visual Studio Platform Toolset", description = "Specify the toolset for the build. e.g. v141 or v143.", display = ParameterDisplay.PROMPT, + options = listOf("v141 (2017)" to "v141", "v143 (2022)" to "v143")) + text("reverse.dep.*.carbon_ref", "", label = "Ref Carbon Component", description = "REF for carbon component e.g. refs/heads/main or refs/tags/v1.0.0 or refs/heads/frontier", display = ParameterDisplay.PROMPT, allowEmpty = true) + } + + vcs { + root(AbsoluteId("CarbonPipelineTools"), "+:carbon/.=>carbon") + + checkoutMode = CheckoutMode.ON_AGENT + cleanCheckout = true + } + + steps { + python { + name = "Check builds have matching git tags" + id = "Check build tags" + command = script { + content = """ + tags = set([ + "${MacOS.arm64_Release.depParamRefs["env.GIT_TAG_HASH"]}", + "${MacOS.arm64_Debug.depParamRefs["env.GIT_TAG_HASH"]}", + "${MacOS.arm64_Internal.depParamRefs["env.GIT_TAG_HASH"]}", + "${MacOS.arm64_TrinityDev.depParamRefs["env.GIT_TAG_HASH"]}", + "${MacOS.x64_Release.depParamRefs["env.GIT_TAG_HASH"]}", + "${MacOS.x64_Debug.depParamRefs["env.GIT_TAG_HASH"]}", + "${MacOS.x64_Internal.depParamRefs["env.GIT_TAG_HASH"]}", + "${MacOS.x64_TrinityDev.depParamRefs["env.GIT_TAG_HASH"]}", + "${Windows.Release.depParamRefs["env.GIT_TAG_HASH"]}", + "${Windows.Debug.depParamRefs["env.GIT_TAG_HASH"]}", + "${Windows.Internal.depParamRefs["env.GIT_TAG_HASH"]}", + "${Windows.TrinityDev.depParamRefs["env.GIT_TAG_HASH"]}" + ]) + if len(tags) > 1: + raise ValueError(f"Multiple different build tags have been detected {tags}") + """.trimIndent() + } + } + python { + name = "Check Publish Branch" + id = "nopublish_check" + command = script { + content = """ + if '%eve_branch_path%' == '//eve/branches/development/mainline/': + print("##teamcity[message text='Check failed: You cannot publish directly to EVE MAINLINE' status='ERROR']") + raise ValueError("Check failed: The variable is equal to 'EVE MAINLINE'") + else: + print("##teamcity[message text='Not publishing to EVE MAINLINE' status='NORMAL']") + """.trimIndent() + } + } + powerShell { + name = "Sync perforce" + id = "Sync_perforce" + scriptMode = script { + content = """ + + Write-Host "##teamcity[message text='Using %env.P4USER% credentials for project: %project%' status='NORMAL']" + Write-Host "Logging in to p4 with user: %env.P4USER% ..." + echo %env.P4PASSWD%|p4 -p %env.P4PORT% -u %env.P4USER% login + + ${'$'}loginResult = p4 login -s 2>&1 + ${'$'}loginStatus = if (${'$'}LASTEXITCODE -eq 0) { "Valid" } else { "Invalid/Expired" } + Write-Host "##teamcity[message text='P4 Login Status: ${'$'}loginStatus (${'$'}loginResult)']" + + ${'$'}clientName = "TC_p4_%teamcity.agent.name%_%teamcity.build.default.checkoutDir%_%eve_branch_shortname%" + Write-Host "Switching to client ${'$'}clientName ..." + p4 set P4CLIENT=${'$'}clientName + + ${'$'}paths = @("TeamCity/Publishers/...", "vendor/python/...", "packages/...", "carbon/common/stdlib/...") + ${'$'}syncPaths = @() + + if ("%project%" -eq "frontier" ) { + ${'$'}branchPath = "//%project%/%eve_branch_shortname%" + ${'$'}publishPath = "${'$'}branchPath/%perforce_path_to_publish_into%/..." + + foreach (${'$'}path in ${'$'}paths) { + ${'$'}syncPaths += "${'$'}branchPath/${'$'}path" + } + + ${'$'}p4SpecOutput = p4 client -S ${'$'}branchPath -o 2>&1 + + if (${'$'}p4SpecOutput -match "already exists") { + Write-Host "Client already exists. Switching stream..." + p4 client -t ${'$'}clientName -s -S ${'$'}branchPath + } + else { + Write-Host "Creating/updating client..." + ${'$'}p4SpecOutput | p4 client -i + } + + # Force syncing files from Perforce + Write-Host "Syncing from perforce with paths: ${'$'}(${'$'}syncPaths -join ' ')" + p4 -s sync -q -f ${'$'}syncPaths + p4 -s sync -q ${'$'}publishPath + p4 -s sync -f -k %teamcity.build.checkoutDir%/%perforce_path_to_publish_into%/... + } + else { + p4 info > p4_info.txt + ${'$'}workspaceName = (Select-String p4_info.txt -Pattern "Client name: (.*)").Matches[0].Groups[1].Value + Remove-Item p4_info.txt + Write-Host "Setting up client ${'$'}workspaceName" + + ${'$'}branchPath = "//%project%/branches/%eve_branch_type%/%eve_branch_shortname%" + ${'$'}workDir = "%teamcity.build.checkoutDir%" + ${'$'}publishPath = "${'$'}branchPath/%perforce_path_to_publish_into%/..." + + foreach (${'$'}path in ${'$'}paths) { + ${'$'}syncPaths += "${'$'}branchPath/${'$'}path" + } + + ${'$'}mappings = foreach (${'$'}path in ${'$'}paths) { + "${'$'}(${'$'}branchPath)/${'$'}path //${'$'}(${'$'}workspaceName)/${'$'}path" + } + Write-Host "Mapping: ${'$'}mappings" + ${'$'}publishMapping = "${'$'}(${'$'}branchPath)/%perforce_path_to_publish_into%/... //${'$'}(${'$'}workspaceName)/%perforce_path_to_publish_into%/..." + Write-Host "Extramapping: ${'$'}publishMapping" + + + p4 --field "View=${'$'}(${'$'}mappings[0])" --field "View+=${'$'}(${'$'}mappings[1])" --field "View+=${'$'}(${'$'}mappings[2])" --field "View+=${'$'}(${'$'}mappings[3])" --field "View+=${'$'}publishMapping" client -o | p4 client -i + + # Force syncing files from Perforce + Write-Host "Syncing from perforce" + p4 -s sync -q -f ${'$'}syncPaths + p4 -s sync -q ${'$'}publishPath + p4 -s sync -f -k %teamcity.build.checkoutDir%/%perforce_path_to_publish_into%/... + } + """.trimIndent() + } + } + python { + name = "Publish-to-Perforce" + environment = venv { + requirementsFile = "" + } + command = file { + filename = "carbon/publish-to-perforce.py" + scriptArguments = "%system.teamcity.build.workingDir%" + } + } + powerShell { + name = "Python-to-Perforce" + enabled = false + formatStderrAsError = true + scriptMode = file { + path = "TeamCity/Publishers/Python-To-Perforce.ps1" + } + scriptArgs = "%perforce_path_to_publish_into% packages" + } + powerShell { + name = "Delete p4 workspace" + id = "Delete_p4_workspace" + executionMode = BuildStep.ExecutionMode.ALWAYS + scriptMode = script { + content = """ + ${'$'}clientName = "TC_p4_%teamcity.agent.name%_%teamcity.build.default.checkoutDir%_%eve_branch_shortname%" + Write-Host "Deleting workspace ${'$'}clientName" + p4 client -d ${'$'}clientName + """.trimIndent() + } + } + } + + dependencies { + dependency(CreateUniversalBuilds) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%perforce_path_to_publish_into%/${MacOS.arm64_Release.depParamRefs["env.GIT_TAG_HASH"]}" + } + } + dependency(Windows.Debug) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.Debug.depParamRefs["env.GIT_TAG_HASH"]}" + } + } + dependency(Windows.Internal) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.Internal.depParamRefs["env.GIT_TAG_HASH"]}" + } + } + dependency(Windows.Release) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.Release.depParamRefs["env.GIT_TAG_HASH"]}" + } + } + dependency(Windows.TrinityDev) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.TrinityDev.depParamRefs["env.GIT_TAG_HASH"]}" + } + } + artifacts(AbsoluteId("Infrastructure_MetaTeamCity_Tools_TeamcityChanges")) { + buildRule = lastSuccessful() + artifactRules = "binaries.zip!*=>" + } + } + + requirements { + contains("teamcity.agent.jvm.os.name", "Windows") + doesNotContain("teamcity.agent.name", "TEST-AUTOM") + } +}) + +val PublishToPerforce = Publish("vendor/github.com/carbonengine/pdm") \ No newline at end of file diff --git a/.teamcity/pom.xml b/.teamcity/pom.xml new file mode 100644 index 0000000..fdb3d9e --- /dev/null +++ b/.teamcity/pom.xml @@ -0,0 +1,104 @@ + + + 4.0.0 + Carbon Blue Config DSL Script + Carbon_Blue + Carbon_Blue_dsl + 1.0-SNAPSHOT + + + org.jetbrains.teamcity + configs-dsl-kotlin-parent + 1.0-SNAPSHOT + + + + + jetbrains-all + https://download.jetbrains.com/teamcity-repository + + true + + + + teamcity-server + https://teamcity.evetech.net/app/dsl-plugins-repository + + true + + + + + + + JetBrains + https://download.jetbrains.com/teamcity-repository + + + + + ${basedir} + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + + + compile + process-sources + + compile + + + + test-compile + process-test-sources + + test-compile + + + + + + org.jetbrains.teamcity + teamcity-configs-maven-plugin + ${teamcity.dsl.version} + + kotlin + target/generated-configs + + + + + + + + org.jetbrains.teamcity + configs-dsl-kotlin-latest + ${teamcity.dsl.version} + compile + + + org.jetbrains.teamcity + configs-dsl-kotlin-plugins-latest + 1.0-SNAPSHOT + pom + compile + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + compile + + + org.jetbrains.kotlin + kotlin-script-runtime + ${kotlin.version} + compile + + + \ No newline at end of file diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts new file mode 100644 index 0000000..d8b050f --- /dev/null +++ b/.teamcity/settings.kts @@ -0,0 +1,35 @@ +import jetbrains.buildServer.configs.kotlin.* +import jetbrains.buildServer.configs.kotlin.Project + + +/* +The settings script is an entry point for defining a single +TeamCity project. TeamCity looks for the 'settings.kts' file in a +project directory and runs it if it's found, so the script name +shouldn't be changed and its package should be the same as the +project's id. + +The script should contain a single call to the project() function +with a Project instance or an init function as an argument. + +VcsRoots, BuildTypes, and Templates of this project must be +registered inside project using the vcsRoot(), buildType(), and +template() methods respectively. + +Subprojects can be defined either in their own settings.kts or by +calling the subProjects() method in this project. + +To debug settings scripts in command-line, run the + + mvnDebug org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate + +command and attach your debugger to the port 8000. + +To debug in IntelliJ Idea, open the 'Maven Projects' tool window (View -> +Tool Windows -> Maven Projects), find the generate task +node (Plugins -> teamcity-configs -> teamcity-configs:generate), +the 'Debug' option is available in the context menu for the task. +*/ + +version = "2025.03" +project(_Self.Project) \ No newline at end of file From 58839bac44cb333a5be2da40c302d1a1a3a37e78 Mon Sep 17 00:00:00 2001 From: ccptoebeans Date: Fri, 24 Jul 2026 11:19:22 +0000 Subject: [PATCH 5/6] Remove trinitydev and internal builds from presets & teamcity config --- .teamcity/MacOS/Project.kt | 8 --- .teamcity/Windows/Project.kt | 4 -- .../buildTypes/CreateUniversalBuilds.kt | 38 ------------- .../_Self.kt/buildTypes/PublishToPerforce.kt | 24 --------- CMakePresets.json | 54 ------------------- 5 files changed, 128 deletions(-) diff --git a/.teamcity/MacOS/Project.kt b/.teamcity/MacOS/Project.kt index 1b1f82f..0f797b7 100644 --- a/.teamcity/MacOS/Project.kt +++ b/.teamcity/MacOS/Project.kt @@ -23,13 +23,9 @@ import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot import jetbrains.buildServer.configs.kotlin.buildFeatures.provideAwsCredentials val arm64_Debug = CarbonBuildMacOS("Debug MacOS arm64", "Debug", "arm64-osx-debug", "aarch64") -val arm64_Internal = CarbonBuildMacOS("Internal MacOS arm64", "Internal", "arm64-osx-internal", "aarch64") -val arm64_TrinityDev = CarbonBuildMacOS("TrinityDev MacOS arm64", "TrinityDev", "arm64-osx-trinitydev", "aarch64") val arm64_Release = CarbonBuildMacOS("Release MacOS arm64", "Release", "arm64-osx-release", "aarch64") val x64_Debug = CarbonBuildMacOS("Debug MacOS x64", "Debug", "x64-osx-debug", "x86_64") -val x64_Internal = CarbonBuildMacOS("Internal MacOS x64", "Internal", "x64-osx-internal", "x86_64") -val x64_TrinityDev = CarbonBuildMacOS("TrinityDev MacOS x64", "TrinityDev", "x64-osx-trinitydev", "x86_64") val x64_Release = CarbonBuildMacOS("Release MacOS x64", "Release", "x64-osx-release", "x86_64") object Project : Project({ @@ -39,13 +35,9 @@ object Project : Project({ buildType(_Self.buildTypes.CreateUniversalBuilds) buildType(arm64_Debug) - buildType(arm64_Internal) - buildType(arm64_TrinityDev) buildType(arm64_Release) buildType(x64_Debug) - buildType(x64_Internal) - buildType(x64_TrinityDev) buildType(x64_Release) }) diff --git a/.teamcity/Windows/Project.kt b/.teamcity/Windows/Project.kt index f56bdb5..78a5d7f 100644 --- a/.teamcity/Windows/Project.kt +++ b/.teamcity/Windows/Project.kt @@ -23,8 +23,6 @@ import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot import jetbrains.buildServer.configs.kotlin.buildFeatures.provideAwsCredentials val Debug = CarbonBuildWindows("Debug Windows", "Debug", "x64-windows-debug") -val Internal = CarbonBuildWindows("Internal Windows", "Internal", "x64-windows-internal") -val TrinityDev = CarbonBuildWindows("TrinityDev Windows", "TrinityDev", "x64-windows-trinitydev") val Release = CarbonBuildWindows("Release Windows", "Release", "x64-windows-release") object Project : Project({ @@ -32,8 +30,6 @@ object Project : Project({ name = "Windows" buildType(Debug) - buildType(Internal) - buildType(TrinityDev) buildType(Release) }) diff --git a/.teamcity/_Self.kt/buildTypes/CreateUniversalBuilds.kt b/.teamcity/_Self.kt/buildTypes/CreateUniversalBuilds.kt index 0a770b6..f35823b 100644 --- a/.teamcity/_Self.kt/buildTypes/CreateUniversalBuilds.kt +++ b/.teamcity/_Self.kt/buildTypes/CreateUniversalBuilds.kt @@ -119,44 +119,6 @@ class UniversalBuild() : BuildType({ artifactRules = "**/*=>%system.teamcity.build.workingDir%/x64" } } - - dependency(MacOS.arm64_Internal) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "**/*=>%system.teamcity.build.workingDir%/arm64" - } - } - dependency(MacOS.x64_Internal) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "**/*=>%system.teamcity.build.workingDir%/x64" - } - } - - dependency(MacOS.arm64_TrinityDev) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "**/*=>%system.teamcity.build.workingDir%/arm64" - } - } - dependency(MacOS.x64_TrinityDev) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "**/*=>%system.teamcity.build.workingDir%/x64" - } - } } requirements { diff --git a/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt b/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt index 46c174d..96aac9f 100644 --- a/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt +++ b/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt @@ -62,16 +62,10 @@ class Publish(perforce_publish_path: String) : BuildType({ tags = set([ "${MacOS.arm64_Release.depParamRefs["env.GIT_TAG_HASH"]}", "${MacOS.arm64_Debug.depParamRefs["env.GIT_TAG_HASH"]}", - "${MacOS.arm64_Internal.depParamRefs["env.GIT_TAG_HASH"]}", - "${MacOS.arm64_TrinityDev.depParamRefs["env.GIT_TAG_HASH"]}", "${MacOS.x64_Release.depParamRefs["env.GIT_TAG_HASH"]}", "${MacOS.x64_Debug.depParamRefs["env.GIT_TAG_HASH"]}", - "${MacOS.x64_Internal.depParamRefs["env.GIT_TAG_HASH"]}", - "${MacOS.x64_TrinityDev.depParamRefs["env.GIT_TAG_HASH"]}", "${Windows.Release.depParamRefs["env.GIT_TAG_HASH"]}", "${Windows.Debug.depParamRefs["env.GIT_TAG_HASH"]}", - "${Windows.Internal.depParamRefs["env.GIT_TAG_HASH"]}", - "${Windows.TrinityDev.depParamRefs["env.GIT_TAG_HASH"]}" ]) if len(tags) > 1: raise ValueError(f"Multiple different build tags have been detected {tags}") @@ -222,15 +216,6 @@ class Publish(perforce_publish_path: String) : BuildType({ artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.Debug.depParamRefs["env.GIT_TAG_HASH"]}" } } - dependency(Windows.Internal) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.Internal.depParamRefs["env.GIT_TAG_HASH"]}" - } - } dependency(Windows.Release) { snapshot { onDependencyFailure = FailureAction.FAIL_TO_START @@ -240,15 +225,6 @@ class Publish(perforce_publish_path: String) : BuildType({ artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.Release.depParamRefs["env.GIT_TAG_HASH"]}" } } - dependency(Windows.TrinityDev) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.TrinityDev.depParamRefs["env.GIT_TAG_HASH"]}" - } - } artifacts(AbsoluteId("Infrastructure_MetaTeamCity_Tools_TeamcityChanges")) { buildRule = lastSuccessful() artifactRules = "binaries.zip!*=>" diff --git a/CMakePresets.json b/CMakePresets.json index bd81cff..0e5c838 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -65,15 +65,6 @@ }, "hidden": true }, - { - "name": "x64-windows-internal", - "inherits": "x64-windows", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Internal", - "VCPKG_TARGET_TRIPLET": "x64-windows-145-internal", - "VCPKG_HOST_TRIPLET": "x64-windows-145-internal" - } - }, { "name": "x64-windows-release", "inherits": "x64-windows", @@ -92,24 +83,6 @@ "VCPKG_HOST_TRIPLET": "x64-windows-145-debug" } }, - { - "name": "x64-windows-trinitydev", - "inherits": "x64-windows", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "TrinityDev", - "VCPKG_TARGET_TRIPLET": "x64-windows-145-trinitydev", - "VCPKG_HOST_TRIPLET": "x64-windows-145-trinitydev" - } - }, - { - "name": "arm64-osx-internal", - "inherits": "arm64-osx", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Internal", - "VCPKG_TARGET_TRIPLET": "arm64-osx-internal", - "VCPKG_HOST_TRIPLET": "arm64-osx-internal" - } - }, { "name": "arm64-osx-release", "inherits": "arm64-osx", @@ -128,24 +101,6 @@ "VCPKG_HOST_TRIPLET": "arm64-osx-debug" } }, - { - "name": "arm64-osx-trinitydev", - "inherits": "arm64-osx", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "TrinityDev", - "VCPKG_TARGET_TRIPLET": "arm64-osx-trinitydev", - "VCPKG_HOST_TRIPLET": "arm64-osx-trinitydev" - } - }, - { - "name": "x64-osx-internal", - "inherits": "x64-osx", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Internal", - "VCPKG_TARGET_TRIPLET": "x64-osx-internal", - "VCPKG_HOST_TRIPLET": "x64-osx-internal" - } - }, { "name": "x64-osx-release", "inherits": "x64-osx", @@ -163,15 +118,6 @@ "VCPKG_TARGET_TRIPLET": "x64-osx-debug", "VCPKG_HOST_TRIPLET": "x64-osx-debug" } - }, - { - "name": "x64-osx-trinitydev", - "inherits": "x64-osx", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "TrinityDev", - "VCPKG_TARGET_TRIPLET": "x64-osx-trinitydev", - "VCPKG_HOST_TRIPLET": "x64-osx-trinitydev" - } } ] } From 0ddee565c43bde750b162eebbf171bb1c8bd45a8 Mon Sep 17 00:00:00 2001 From: ccptoebeans Date: Fri, 24 Jul 2026 11:22:15 +0000 Subject: [PATCH 6/6] Remove PublishToPerforce build step --- .teamcity/_Self.kt/Project.kt | 2 - .../_Self.kt/buildTypes/PublishToPerforce.kt | 240 ------------------ 2 files changed, 242 deletions(-) delete mode 100644 .teamcity/_Self.kt/buildTypes/PublishToPerforce.kt diff --git a/.teamcity/_Self.kt/Project.kt b/.teamcity/_Self.kt/Project.kt index 52c8b70..a88458e 100644 --- a/.teamcity/_Self.kt/Project.kt +++ b/.teamcity/_Self.kt/Project.kt @@ -20,6 +20,4 @@ object Project : Project({ subProject(Windows.Project) subProject(MacOS.Project) - - buildType(PublishToPerforce) }) diff --git a/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt b/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt deleted file mode 100644 index 96aac9f..0000000 --- a/.teamcity/_Self.kt/buildTypes/PublishToPerforce.kt +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright © 2025 CCP ehf. - -package _Self.buildTypes - -import jetbrains.buildServer.configs.kotlin.* -import jetbrains.buildServer.configs.kotlin.buildFeatures.vcsLabeling -import jetbrains.buildServer.configs.kotlin.triggers.vcs -import jetbrains.buildServer.configs.kotlin.buildSteps.python -import jetbrains.buildServer.configs.kotlin.buildSteps.powerShell - - - -class Publish(perforce_publish_path: String) : BuildType({ - name = "Publish to Perforce" - - enablePersonalBuilds = false - type = BuildTypeSettings.Type.DEPLOYMENT - maxRunningBuilds = 1 - - params { - select("project", "frontier", label = "Which project to publish into?", description = "e.g. EVE or Frontier or Frontier Stream", display = ParameterDisplay.PROMPT, - options = listOf("EVE Online" to "eve", "Frontier" to "eve-frontier", "Frontier Stream" to "frontier")) - - param("perforce_path_to_publish_into", perforce_publish_path) - - param("env.P4PASSWD", "%platform_automation_pass%") - param("env.P4USER", "platform_automation") - text("reverse.dep.*.env.GIT_TAG_HASH_OVERRIDE", "", label = "GTH override for component version in vendor", description = "GIT TAG HASH OVERRIDE, IF NEEDED FOR DEPENDENCIES", display = ParameterDisplay.PROMPT, allowEmpty = true) - param("env.TC_BUILD_URL", "%teamcity.serverUrl%/viewLog.html?buildId=%teamcity.build.id%") - text("eve_branch_shortname", "", label = "Branch Name", description = """The name of the branch, for example MAINLINE""", display = ParameterDisplay.PROMPT, allowEmpty = false) - param("env.TC_BUILDID", "%teamcity.build.id%") - param("env.TC_BUILD_NUMBER", "Carbon PDM #%build.number%") - param("env.P4PORT", "p4is.ccp.ad.local:1666") - param("env.TC_EVE_BRANCH_SHORTNAME", "%eve_branch_shortname%") - param("env.TC_EVE_PROJECT", "%project%") - param("carbon-pipeline-tools-ref", "refs/heads/main") - select("eve_branch_path", "//%project%/%eve_branch_shortname%/", label = "Perforce branch", description = "Is this a regular perforce branch or a perforce stream? Used for setting the proper branch path.", display = ParameterDisplay.PROMPT, - options = listOf("Regular" to "//%project%/branches/%eve_branch_type%/%eve_branch_shortname%/", "Frontier Stream" to "//%project%/%eve_branch_shortname%/")) - select("eve_branch_type", "sandbox", label = "Branch type", description = "The type of branch to publish into", display = ParameterDisplay.PROMPT, - options = listOf("Sandbox" to "sandbox", "Development" to "development", "Release" to "release", "Staging" to "staging", "Stream" to "")) - param("env.TC_PERFORCE_PATH_TO_PUBLISH_INTO", "%perforce_path_to_publish_into%") - param("env.EXECUTABLE_FILENAMES_MATCH", "") - - select("reverse.dep.*.env.VISUAL_STUDIO_PLATFORM_TOOLSET", "v141", label = "Visual Studio Platform Toolset", description = "Specify the toolset for the build. e.g. v141 or v143.", display = ParameterDisplay.PROMPT, - options = listOf("v141 (2017)" to "v141", "v143 (2022)" to "v143")) - text("reverse.dep.*.carbon_ref", "", label = "Ref Carbon Component", description = "REF for carbon component e.g. refs/heads/main or refs/tags/v1.0.0 or refs/heads/frontier", display = ParameterDisplay.PROMPT, allowEmpty = true) - } - - vcs { - root(AbsoluteId("CarbonPipelineTools"), "+:carbon/.=>carbon") - - checkoutMode = CheckoutMode.ON_AGENT - cleanCheckout = true - } - - steps { - python { - name = "Check builds have matching git tags" - id = "Check build tags" - command = script { - content = """ - tags = set([ - "${MacOS.arm64_Release.depParamRefs["env.GIT_TAG_HASH"]}", - "${MacOS.arm64_Debug.depParamRefs["env.GIT_TAG_HASH"]}", - "${MacOS.x64_Release.depParamRefs["env.GIT_TAG_HASH"]}", - "${MacOS.x64_Debug.depParamRefs["env.GIT_TAG_HASH"]}", - "${Windows.Release.depParamRefs["env.GIT_TAG_HASH"]}", - "${Windows.Debug.depParamRefs["env.GIT_TAG_HASH"]}", - ]) - if len(tags) > 1: - raise ValueError(f"Multiple different build tags have been detected {tags}") - """.trimIndent() - } - } - python { - name = "Check Publish Branch" - id = "nopublish_check" - command = script { - content = """ - if '%eve_branch_path%' == '//eve/branches/development/mainline/': - print("##teamcity[message text='Check failed: You cannot publish directly to EVE MAINLINE' status='ERROR']") - raise ValueError("Check failed: The variable is equal to 'EVE MAINLINE'") - else: - print("##teamcity[message text='Not publishing to EVE MAINLINE' status='NORMAL']") - """.trimIndent() - } - } - powerShell { - name = "Sync perforce" - id = "Sync_perforce" - scriptMode = script { - content = """ - - Write-Host "##teamcity[message text='Using %env.P4USER% credentials for project: %project%' status='NORMAL']" - Write-Host "Logging in to p4 with user: %env.P4USER% ..." - echo %env.P4PASSWD%|p4 -p %env.P4PORT% -u %env.P4USER% login - - ${'$'}loginResult = p4 login -s 2>&1 - ${'$'}loginStatus = if (${'$'}LASTEXITCODE -eq 0) { "Valid" } else { "Invalid/Expired" } - Write-Host "##teamcity[message text='P4 Login Status: ${'$'}loginStatus (${'$'}loginResult)']" - - ${'$'}clientName = "TC_p4_%teamcity.agent.name%_%teamcity.build.default.checkoutDir%_%eve_branch_shortname%" - Write-Host "Switching to client ${'$'}clientName ..." - p4 set P4CLIENT=${'$'}clientName - - ${'$'}paths = @("TeamCity/Publishers/...", "vendor/python/...", "packages/...", "carbon/common/stdlib/...") - ${'$'}syncPaths = @() - - if ("%project%" -eq "frontier" ) { - ${'$'}branchPath = "//%project%/%eve_branch_shortname%" - ${'$'}publishPath = "${'$'}branchPath/%perforce_path_to_publish_into%/..." - - foreach (${'$'}path in ${'$'}paths) { - ${'$'}syncPaths += "${'$'}branchPath/${'$'}path" - } - - ${'$'}p4SpecOutput = p4 client -S ${'$'}branchPath -o 2>&1 - - if (${'$'}p4SpecOutput -match "already exists") { - Write-Host "Client already exists. Switching stream..." - p4 client -t ${'$'}clientName -s -S ${'$'}branchPath - } - else { - Write-Host "Creating/updating client..." - ${'$'}p4SpecOutput | p4 client -i - } - - # Force syncing files from Perforce - Write-Host "Syncing from perforce with paths: ${'$'}(${'$'}syncPaths -join ' ')" - p4 -s sync -q -f ${'$'}syncPaths - p4 -s sync -q ${'$'}publishPath - p4 -s sync -f -k %teamcity.build.checkoutDir%/%perforce_path_to_publish_into%/... - } - else { - p4 info > p4_info.txt - ${'$'}workspaceName = (Select-String p4_info.txt -Pattern "Client name: (.*)").Matches[0].Groups[1].Value - Remove-Item p4_info.txt - Write-Host "Setting up client ${'$'}workspaceName" - - ${'$'}branchPath = "//%project%/branches/%eve_branch_type%/%eve_branch_shortname%" - ${'$'}workDir = "%teamcity.build.checkoutDir%" - ${'$'}publishPath = "${'$'}branchPath/%perforce_path_to_publish_into%/..." - - foreach (${'$'}path in ${'$'}paths) { - ${'$'}syncPaths += "${'$'}branchPath/${'$'}path" - } - - ${'$'}mappings = foreach (${'$'}path in ${'$'}paths) { - "${'$'}(${'$'}branchPath)/${'$'}path //${'$'}(${'$'}workspaceName)/${'$'}path" - } - Write-Host "Mapping: ${'$'}mappings" - ${'$'}publishMapping = "${'$'}(${'$'}branchPath)/%perforce_path_to_publish_into%/... //${'$'}(${'$'}workspaceName)/%perforce_path_to_publish_into%/..." - Write-Host "Extramapping: ${'$'}publishMapping" - - - p4 --field "View=${'$'}(${'$'}mappings[0])" --field "View+=${'$'}(${'$'}mappings[1])" --field "View+=${'$'}(${'$'}mappings[2])" --field "View+=${'$'}(${'$'}mappings[3])" --field "View+=${'$'}publishMapping" client -o | p4 client -i - - # Force syncing files from Perforce - Write-Host "Syncing from perforce" - p4 -s sync -q -f ${'$'}syncPaths - p4 -s sync -q ${'$'}publishPath - p4 -s sync -f -k %teamcity.build.checkoutDir%/%perforce_path_to_publish_into%/... - } - """.trimIndent() - } - } - python { - name = "Publish-to-Perforce" - environment = venv { - requirementsFile = "" - } - command = file { - filename = "carbon/publish-to-perforce.py" - scriptArguments = "%system.teamcity.build.workingDir%" - } - } - powerShell { - name = "Python-to-Perforce" - enabled = false - formatStderrAsError = true - scriptMode = file { - path = "TeamCity/Publishers/Python-To-Perforce.ps1" - } - scriptArgs = "%perforce_path_to_publish_into% packages" - } - powerShell { - name = "Delete p4 workspace" - id = "Delete_p4_workspace" - executionMode = BuildStep.ExecutionMode.ALWAYS - scriptMode = script { - content = """ - ${'$'}clientName = "TC_p4_%teamcity.agent.name%_%teamcity.build.default.checkoutDir%_%eve_branch_shortname%" - Write-Host "Deleting workspace ${'$'}clientName" - p4 client -d ${'$'}clientName - """.trimIndent() - } - } - } - - dependencies { - dependency(CreateUniversalBuilds) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "**/*=>%perforce_path_to_publish_into%/${MacOS.arm64_Release.depParamRefs["env.GIT_TAG_HASH"]}" - } - } - dependency(Windows.Debug) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.Debug.depParamRefs["env.GIT_TAG_HASH"]}" - } - } - dependency(Windows.Release) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "**/*=>%perforce_path_to_publish_into%/${Windows.Release.depParamRefs["env.GIT_TAG_HASH"]}" - } - } - artifacts(AbsoluteId("Infrastructure_MetaTeamCity_Tools_TeamcityChanges")) { - buildRule = lastSuccessful() - artifactRules = "binaries.zip!*=>" - } - } - - requirements { - contains("teamcity.agent.jvm.os.name", "Windows") - doesNotContain("teamcity.agent.name", "TEST-AUTOM") - } -}) - -val PublishToPerforce = Publish("vendor/github.com/carbonengine/pdm") \ No newline at end of file