All checks were successful
Test / Create distribution (push) Successful in 58s
Test / Sandbox (push) Successful in 2m36s
Test / Hakurei (push) Successful in 3m42s
Test / ShareFS (push) Successful in 3m48s
Test / Sandbox (race detector) (push) Successful in 4m55s
Test / Hakurei (race detector) (push) Successful in 5m53s
Test / Flake checks (push) Successful in 1m35s
This had to be done out-of-band because there was no way to efficiently represent these within Artifact. Signed-off-by: Ophestra <cat@gensokyo.uk>
192 lines
5.2 KiB
Go
192 lines
5.2 KiB
Go
package rosa
|
|
|
|
import (
|
|
"path"
|
|
"slices"
|
|
"strings"
|
|
|
|
"hakurei.app/internal/pkg"
|
|
)
|
|
|
|
func (t Toolchain) newCMake() (pkg.Artifact, string) {
|
|
const (
|
|
version = "4.2.3"
|
|
checksum = "Y4uYGnLrDQX78UdzH7fMzfok46Nt_1taDIHSmqgboU1yFi6f0iAXBDegMCu4eS-J"
|
|
)
|
|
return t.NewPackage("cmake", version, pkg.NewHTTPGetTar(
|
|
nil, "https://github.com/Kitware/CMake/releases/download/"+
|
|
"v"+version+"/cmake-"+version+".tar.gz",
|
|
mustDecode(checksum),
|
|
pkg.TarGzip,
|
|
), &PackageAttr{
|
|
// test suite expects writable source tree
|
|
Writable: true,
|
|
|
|
// expected to be writable in the copy made during bootstrap
|
|
Chmod: true,
|
|
|
|
Patches: [][2]string{
|
|
{"bootstrap-test-no-openssl", `diff --git a/Tests/BootstrapTest.cmake b/Tests/BootstrapTest.cmake
|
|
index 137de78bc1..b4da52e664 100644
|
|
--- a/Tests/BootstrapTest.cmake
|
|
+++ b/Tests/BootstrapTest.cmake
|
|
@@ -9,7 +9,7 @@ if(NOT nproc EQUAL 0)
|
|
endif()
|
|
message(STATUS "running bootstrap: ${bootstrap} ${ninja_arg} ${parallel_arg}")
|
|
execute_process(
|
|
- COMMAND ${bootstrap} ${ninja_arg} ${parallel_arg}
|
|
+ COMMAND ${bootstrap} ${ninja_arg} ${parallel_arg} -- -DCMAKE_USE_OPENSSL=OFF
|
|
WORKING_DIRECTORY "${bin_dir}"
|
|
RESULT_VARIABLE result
|
|
)
|
|
`},
|
|
|
|
{"disable-broken-tests-musl", `diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
|
|
index 2ead810437..f85cbb8b1c 100644
|
|
--- a/Tests/CMakeLists.txt
|
|
+++ b/Tests/CMakeLists.txt
|
|
@@ -384,7 +384,6 @@ if(BUILD_TESTING)
|
|
add_subdirectory(CMakeLib)
|
|
endif()
|
|
add_subdirectory(CMakeOnly)
|
|
- add_subdirectory(RunCMake)
|
|
|
|
add_subdirectory(FindPackageModeMakefileTest)
|
|
|
|
@@ -528,9 +527,6 @@ if(BUILD_TESTING)
|
|
-DCMake_TEST_CUDA:BOOL=${CMake_TEST_CUDA}
|
|
-DCMake_INSTALL_NAME_TOOL_BUG:BOOL=${CMake_INSTALL_NAME_TOOL_BUG}
|
|
)
|
|
- ADD_TEST_MACRO(ExportImport ExportImport)
|
|
- set_property(TEST ExportImport APPEND
|
|
- PROPERTY LABELS "CUDA")
|
|
ADD_TEST_MACRO(Unset Unset)
|
|
ADD_TEST_MACRO(PolicyScope PolicyScope)
|
|
ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
|
|
@@ -624,7 +620,6 @@ if(BUILD_TESTING)
|
|
# run test for BundleUtilities on supported platforms/compilers
|
|
if((MSVC OR
|
|
MINGW OR
|
|
- CMAKE_SYSTEM_NAME MATCHES "Linux" OR
|
|
CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|
AND NOT CMAKE_GENERATOR STREQUAL "Watcom WMake")
|
|
|
|
@@ -3095,10 +3090,6 @@ if(BUILD_TESTING)
|
|
"${CMake_SOURCE_DIR}/Tests/CTestTestFdSetSize/test.cmake.in"
|
|
"${CMake_BINARY_DIR}/Tests/CTestTestFdSetSize/test.cmake"
|
|
@ONLY ESCAPE_QUOTES)
|
|
- add_test(CTestTestFdSetSize ${CMAKE_CTEST_COMMAND}
|
|
- -S "${CMake_BINARY_DIR}/Tests/CTestTestFdSetSize/test.cmake" -j20 -V --timeout 120
|
|
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFdSetSize/testOutput.log"
|
|
- )
|
|
|
|
if(CMAKE_TESTS_CDASH_SERVER)
|
|
set(regex "^([^:]+)://([^/]+)(.*)$")
|
|
`},
|
|
},
|
|
}, &MakeHelper{
|
|
OmitDefaults: true,
|
|
|
|
ConfigureName: "/usr/src/cmake/bootstrap",
|
|
Configure: [][2]string{
|
|
{"prefix", "/system"},
|
|
{"parallel", `"$(nproc)"`},
|
|
{"--"},
|
|
{"-DCMAKE_USE_OPENSSL", "OFF"},
|
|
{"-DCMake_TEST_NO_NETWORK", "ON"},
|
|
},
|
|
Check: []string{
|
|
"CTEST_OUTPUT_ON_FAILURE=1",
|
|
"CTEST_PARALLEL_LEVEL=128",
|
|
"test",
|
|
},
|
|
},
|
|
KernelHeaders,
|
|
), version
|
|
}
|
|
func init() {
|
|
artifactsM[CMake] = Metadata{
|
|
f: Toolchain.newCMake,
|
|
|
|
Name: "cmake",
|
|
Description: "cross-platform, open-source build system",
|
|
Website: "https://cmake.org/",
|
|
}
|
|
}
|
|
|
|
// CMakeHelper is the [CMake] build system helper.
|
|
type CMakeHelper struct {
|
|
// Joined with name with a dash if non-empty.
|
|
Variant string
|
|
|
|
// Path elements joined with source.
|
|
Append []string
|
|
|
|
// CMake CACHE entries.
|
|
Cache [][2]string
|
|
// Runs after install.
|
|
Script string
|
|
}
|
|
|
|
var _ Helper = new(CMakeHelper)
|
|
|
|
// name returns its arguments and an optional variant string joined with '-'.
|
|
func (attr *CMakeHelper) name(name, version string) string {
|
|
if attr != nil && attr.Variant != "" {
|
|
name += "-" + attr.Variant
|
|
}
|
|
return name + "-" + version
|
|
}
|
|
|
|
// extra returns a hardcoded slice of [CMake] and [Ninja].
|
|
func (*CMakeHelper) extra(int) []PArtifact {
|
|
return []PArtifact{CMake, Ninja}
|
|
}
|
|
|
|
// wantsChmod returns false.
|
|
func (*CMakeHelper) wantsChmod() bool { return false }
|
|
|
|
// wantsWrite returns false.
|
|
func (*CMakeHelper) wantsWrite() bool { return false }
|
|
|
|
// scriptEarly returns the zero value.
|
|
func (*CMakeHelper) scriptEarly() string { return "" }
|
|
|
|
// createDir returns true.
|
|
func (*CMakeHelper) createDir() bool { return true }
|
|
|
|
// wantsDir returns a hardcoded, deterministic pathname.
|
|
func (*CMakeHelper) wantsDir() string { return "/cure/" }
|
|
|
|
// script generates the cure script.
|
|
func (attr *CMakeHelper) script(name string) string {
|
|
if attr == nil {
|
|
attr = &CMakeHelper{
|
|
Cache: [][2]string{
|
|
{"CMAKE_BUILD_TYPE", "Release"},
|
|
},
|
|
}
|
|
}
|
|
if len(attr.Cache) == 0 {
|
|
panic("CACHE must be non-empty")
|
|
}
|
|
|
|
return `
|
|
cmake -G Ninja \
|
|
-DCMAKE_C_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
|
-DCMAKE_CXX_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
|
-DCMAKE_ASM_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
|
` + strings.Join(slices.Collect(func(yield func(string) bool) {
|
|
for _, v := range attr.Cache {
|
|
if !yield("-D" + v[0] + "=" + v[1]) {
|
|
return
|
|
}
|
|
}
|
|
}), " \\\n\t") + ` \
|
|
-DCMAKE_INSTALL_PREFIX=/work/system \
|
|
'/usr/src/` + name + `/` + path.Join(attr.Append...) + `'
|
|
cmake --build .
|
|
cmake --install .
|
|
` + attr.Script
|
|
}
|