Browse Source

ci: Add jobs to build sunos-{i386,sparc} binaries

Brad King 8 months ago
parent
commit
28f1da4b25

+ 40 - 0
.gitlab-ci.yml

@@ -830,6 +830,46 @@ u:linux-aarch64-package:
     needs:
         - b:linux-aarch64-package
 
+b:sunos-i386-package:
+    extends:
+        - .sunos_package
+        - .sunos_release_i386
+        - .cmake_build_sunos_release
+        - .cmake_release_artifacts
+        - .linux_x86_64_tags
+        - .run_only_for_package
+    needs:
+        - p:doc-package
+    variables:
+        CMAKE_CI_ARTIFACTS_NAME: "artifacts-sunos-i386"
+
+u:sunos-i386-package:
+    extends:
+        - .rsync_upload_package
+        - .run_only_for_package
+    needs:
+        - b:sunos-i386-package
+
+b:sunos-sparc-package:
+    extends:
+        - .sunos_package
+        - .sunos_release_sparc
+        - .cmake_build_sunos_release
+        - .cmake_release_artifacts
+        - .linux_x86_64_tags
+        - .run_only_for_package
+    needs:
+        - p:doc-package
+    variables:
+        CMAKE_CI_ARTIFACTS_NAME: "artifacts-sunos-sparc"
+
+u:sunos-sparc-package:
+    extends:
+        - .rsync_upload_package
+        - .run_only_for_package
+    needs:
+        - b:sunos-sparc-package
+
 ## Sanitizer builds
 
 b:fedora41-asan:

+ 2 - 0
.gitlab/artifacts.yml

@@ -78,6 +78,8 @@
             - ${CMAKE_CI_BUILD_DIR}/cmake-*-linux-x86_64.*
             - ${CMAKE_CI_BUILD_DIR}/cmake-*-linux-aarch64.*
             - ${CMAKE_CI_BUILD_DIR}/cmake-*-macos*-universal.*
+            - ${CMAKE_CI_BUILD_DIR}/cmake-*-sunos-i386.*
+            - ${CMAKE_CI_BUILD_DIR}/cmake-*-sunos-sparc.*
             - ${CMAKE_CI_BUILD_DIR}/cmake-*-windows-x86_64.*
             - ${CMAKE_CI_BUILD_DIR}/cmake-*-windows-i386.*
             - ${CMAKE_CI_BUILD_DIR}/cmake-*-windows-arm64.*

+ 45 - 0
.gitlab/os-linux.yml

@@ -30,6 +30,24 @@
     variables:
         BOOTSTRAP_ARGS: '-- "-DCMake_DOC_ARTIFACT_PREFIX=$CI_PROJECT_DIR/build/install-doc"'
 
+.sunos_release_i386:
+    image: "kitware/cmake:build-sunos-i386-deps-2025-02-14"
+
+    variables:
+        GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
+        CMAKE_ARCH: i386
+
+.sunos_release_sparc:
+    image: "kitware/cmake:build-sunos-sparc-deps-2025-02-14"
+
+    variables:
+        GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
+        CMAKE_ARCH: sparc
+
+.sunos_package:
+    variables:
+        CMake_DOC_ARTIFACT_PREFIX: "$CI_PROJECT_DIR/build/install-doc"
+
 .needs_centos7_x86_64:
     needs:
         - b:centos7-x86_64
@@ -741,6 +759,33 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
+.cmake_build_sunos_release:
+    stage: build
+
+    script:
+        - *before_script_linux
+        # SunOS sysroot
+        - Utilities/Release/sunos/docker/sysroot.bash $CMAKE_ARCH
+        # Initial cache
+        - mkdir -p build/
+        - cp Utilities/Release/sunos/$CMAKE_ARCH/cache.txt build/CMakeCache.txt
+        # Make sccache available.
+        - source .gitlab/ci/sccache-env.sh
+        - echo "CMAKE_C_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
+        - echo "CMAKE_CXX_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
+        # Build
+        - cd build/
+        - cmake .. -GNinja
+          -DCMAKE_DOC_DIR=doc/cmake
+          -DCMake_DOC_ARTIFACT_PREFIX="$CMake_DOC_ARTIFACT_PREFIX"
+          -DCMAKE_TOOLCHAIN_FILE="$CI_PROJECT_DIR/Utilities/Release/sunos/$CMAKE_ARCH/toolchain.cmake"
+        - ninja
+        # Package
+        - cpack -G "TGZ;STGZ"
+        - sccache --show-stats
+
+    interruptible: true
+
 ### Documentation
 
 .cmake_org_help:

+ 5 - 0
Help/release/4.0.rst

@@ -236,3 +236,8 @@ Other Changes
   now only shown when the message log level is set to ``VERBOSE``, ``DEBUG``,
   or ``TRACE`` via the   :option:`cmake --log-level` option or the
   :variable:`CMAKE_MESSAGE_LOG_LEVEL` cache variable.
+
+* Precompiled SunOS ``sparc`` and ``i386`` binaries are now provided
+  on `cmake.org`_.
+
+.. _`cmake.org`: https://cmake.org/download/

+ 6 - 0
Tests/RunCMake/CMakeRelease/FileTable-stdout.txt

@@ -13,6 +13,10 @@
 "cmake-@version@-macos-universal\.tar\.gz"
 "cmake-@version@-macos10\.10-universal\.dmg"
 "cmake-@version@-macos10\.10-universal\.tar\.gz"
+"cmake-@version@-sunos-i386\.sh"
+"cmake-@version@-sunos-i386\.tar\.gz"
+"cmake-@version@-sunos-sparc\.sh"
+"cmake-@version@-sunos-sparc\.tar\.gz"
 "cmake-@version@-windows-i386\.msi"
 "cmake-@version@-windows-i386\.zip"
 "cmake-@version@-windows-x86_64\.msi"
@@ -28,6 +32,8 @@
 "cmake-@version@-macos-universal\.dmg"
 -- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "macos10\.10"\) and \(\.class == "archive"\)\) \| \.name
 "cmake-@version@-macos10\.10-universal\.tar\.gz"
+-- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "sunos"\) and \(\.architecture\[\] \| \. == "sparc"\) and \(\.class == "archive"\)\) \| \.name
+"cmake-@version@-sunos-sparc\.tar\.gz"
 -- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "windows"\) and \(\.architecture\[\] \| \. == "i386"\) and \(\.class == "installer"\)\) \| \.name
 "cmake-@version@-windows-i386\.msi"
 -- query: \.files\[\] \| select\(\.architecture\[\] \| \. == "x86_64"\) \| \.name

+ 1 - 0
Tests/RunCMake/CMakeRelease/FileTable.cmake

@@ -11,6 +11,7 @@ foreach(query
     ".files[] | select(.os[] | . == \"source\") | .name"
     ".files[] | select((.os[] | . == \"macOS\") and (.class == \"volume\")) | .name"
     ".files[] | select((.os[] | . == \"macos10.10\") and (.class == \"archive\")) | .name"
+    ".files[] | select((.os[] | . == \"sunos\") and (.architecture[] | . == \"sparc\") and (.class == \"archive\")) | .name"
     ".files[] | select((.os[] | . == \"windows\") and (.architecture[] | . == \"i386\") and (.class == \"installer\")) | .name"
     ".files[] | select(.architecture[] | . == \"x86_64\") | .name"
     ".files[] | select([.macOSmin] | inside([\"10.10\", \"10.11\", \"10.12\"])) | .name"

+ 24 - 0
Utilities/Release/files-v1.json.in

@@ -59,6 +59,30 @@
       "name": "cmake-@[email protected]",
       "macOSmin": "10.10"
     },
+    {
+      "os": ["sunos", "SunOS"],
+      "architecture": ["i386"],
+      "class": "installer",
+      "name": "cmake-@[email protected]"
+    },
+    {
+      "os": ["sunos", "SunOS"],
+      "architecture": ["i386"],
+      "class": "archive",
+      "name": "cmake-@[email protected]"
+    },
+    {
+      "os": ["sunos", "SunOS"],
+      "architecture": ["sparc"],
+      "class": "installer",
+      "name": "cmake-@[email protected]"
+    },
+    {
+      "os": ["sunos", "SunOS"],
+      "architecture": ["sparc"],
+      "class": "archive",
+      "name": "cmake-@[email protected]"
+    },
     {
       "os": ["windows", "Windows"],
       "architecture": ["i386"],

+ 4 - 0
Utilities/Release/files-v1.rst

@@ -70,6 +70,9 @@ The members are:
     ``Windows``, ``windows``
       Windows packages.
 
+    ``SunOS``, ``sunos``
+      SunOS packages.
+
   ``architecture``
     A JSON array of strings naming the architecture(s) for which the
     package file is built, possibly using multiple alternative spellings.
@@ -79,6 +82,7 @@ The members are:
     On Windows, architecture names include ``x86_64``, ``i386``, and ``arm64``.
     On macOS, universal binary packages list all architectures,
     e.g. ``["arm64","x86_64"]``.
+    On SunOS, architecture names include ``i386`` and ``sparc``.
 
   ``class``
     A JSON string naming the class of package.  The value is one of: