diff options
Diffstat (limited to 'meta-oe/recipes-dbs/rocksdb')
3 files changed, 73 insertions, 2 deletions
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch b/meta-oe/recipes-dbs/rocksdb/files/0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch new file mode 100644 index 0000000000..b0a949fe31 --- /dev/null +++ b/meta-oe/recipes-dbs/rocksdb/files/0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 9abf6cd09c60f0be9a85c055dfdf43698f057f73 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Wed, 25 Sep 2024 13:47:37 +0800 | ||
4 | Subject: [PATCH] CMakeLists.txt: Make the test discovery occur on target | ||
5 | |||
6 | Set DISCOVERY_MODE to PRE_TEST to delay test discovery until just | ||
7 | prior to test execution on the target to fix the build failure as | ||
8 | the default POST_BUILD behavior is not desirable in cross-compiling | ||
9 | env. | ||
10 | |||
11 | /build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/build/env_basic_test: error while loading shared libraries: libgflags.so.2.2: cannot open shared object file: No such file or directory | ||
12 | CMake Error at /build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/recipe-sysroot-native/usr/share/cmake-3.30/Modules/GoogleTestAddTests.cmake:112 (message): | ||
13 | Error running test executable. | ||
14 | |||
15 | Path: '/build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/build/env_basic_test' | ||
16 | Working directory: '/build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/build' | ||
17 | Result: 127 | ||
18 | Output: | ||
19 | |||
20 | Upstream-Status: Inappropriate [oe specific] | ||
21 | |||
22 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
23 | --- | ||
24 | CMakeLists.txt | 2 +- | ||
25 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
28 | index 403ad1243..f34397798 100644 | ||
29 | --- a/CMakeLists.txt | ||
30 | +++ b/CMakeLists.txt | ||
31 | @@ -1502,7 +1502,7 @@ if(WITH_TESTS) | ||
32 | ) | ||
33 | target_link_libraries(${exename}${ARTIFACT_SUFFIX} testutillib${ARTIFACT_SUFFIX} testharness gtest ${THIRDPARTY_LIBS} ${ROCKSDB_LIB}) | ||
34 | if(NOT "${exename}" MATCHES "db_sanity_test") | ||
35 | - gtest_discover_tests(${exename} DISCOVERY_TIMEOUT 120) | ||
36 | + gtest_discover_tests(${exename} DISCOVERY_TIMEOUT 120 DISCOVERY_MODE PRE_TEST) | ||
37 | add_dependencies(rocksdb_check ${exename}${ARTIFACT_SUFFIX}) | ||
38 | endif() | ||
39 | endforeach(sourcefile ${TESTS}) | ||
40 | -- | ||
41 | 2.34.1 | ||
42 | |||
diff --git a/meta-oe/recipes-dbs/rocksdb/files/run-ptest b/meta-oe/recipes-dbs/rocksdb/files/run-ptest new file mode 100644 index 0000000000..45406fdfa1 --- /dev/null +++ b/meta-oe/recipes-dbs/rocksdb/files/run-ptest | |||
@@ -0,0 +1,12 @@ | |||
1 | #!/bin/sh | ||
2 | ptestdir=$(dirname "$(readlink -f "$0")") | ||
3 | cd "$ptestdir"/tests || exit | ||
4 | |||
5 | for test in *_test; do | ||
6 | if ./${test} >/dev/null 2>&1; then | ||
7 | echo "PASS: ${test}" | ||
8 | else | ||
9 | echo "FAIL: ${test}" | ||
10 | fi | ||
11 | done | ||
12 | |||
diff --git a/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb b/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb index fae54fdba4..57d163bfc7 100644 --- a/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb +++ b/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb | |||
@@ -18,6 +18,8 @@ SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH};protocol=htt | |||
18 | file://0006-Implement-timer-for-arm-v6.patch \ | 18 | file://0006-Implement-timer-for-arm-v6.patch \ |
19 | file://0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch \ | 19 | file://0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch \ |
20 | file://static_library_as_option.patch \ | 20 | file://static_library_as_option.patch \ |
21 | file://0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch \ | ||
22 | file://run-ptest \ | ||
21 | " | 23 | " |
22 | 24 | ||
23 | SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch" | 25 | SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch" |
@@ -27,7 +29,7 @@ SRC_URI:remove:toolchain-clang:riscv32 = "file://0001-replace-old-sync-with-new- | |||
27 | 29 | ||
28 | S = "${WORKDIR}/git" | 30 | S = "${WORKDIR}/git" |
29 | 31 | ||
30 | inherit cmake | 32 | inherit cmake ptest |
31 | 33 | ||
32 | PACKAGECONFIG ??= "bzip2 zlib lz4 gflags" | 34 | PACKAGECONFIG ??= "bzip2 zlib lz4 gflags" |
33 | PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2" | 35 | PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2" |
@@ -40,7 +42,7 @@ PACKAGECONFIG[gflags] = "-DWITH_GFLAGS=ON,-DWITH_GFLAGS=OFF,gflags" | |||
40 | # Tools and tests currently don't compile on armv5 so we disable them | 42 | # Tools and tests currently don't compile on armv5 so we disable them |
41 | EXTRA_OECMAKE = "\ | 43 | EXTRA_OECMAKE = "\ |
42 | -DPORTABLE=ON \ | 44 | -DPORTABLE=ON \ |
43 | -DWITH_TESTS=OFF \ | 45 | -DWITH_TESTS=${@bb.utils.contains("DISTRO_FEATURES", "ptest", "ON", "OFF", d)} \ |
44 | -DWITH_BENCHMARK_TOOLS=OFF \ | 46 | -DWITH_BENCHMARK_TOOLS=OFF \ |
45 | -DWITH_TOOLS=OFF \ | 47 | -DWITH_TOOLS=OFF \ |
46 | -DFAIL_ON_WARNINGS=OFF \ | 48 | -DFAIL_ON_WARNINGS=OFF \ |
@@ -54,6 +56,21 @@ do_install:append() { | |||
54 | sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/rocksdb/RocksDBTargets.cmake | 56 | sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/rocksdb/RocksDBTargets.cmake |
55 | } | 57 | } |
56 | 58 | ||
59 | do_install_ptest() { | ||
60 | install -d ${D}${PTEST_PATH}/tests | ||
61 | # only cover the basic test as all the tests need to take about 6 hours | ||
62 | # time ./run-ptest | ||
63 | # real 356m32.956s | ||
64 | # user 252m32.004s | ||
65 | # sys 178m50.246s | ||
66 | install -m 0755 ${B}/env_basic_test ${D}${PTEST_PATH}/tests/ | ||
67 | install -m 0755 ${B}/db_basic_test ${D}${PTEST_PATH}/tests/ | ||
68 | install -m 0755 ${B}/agg_merge_test ${D}${PTEST_PATH}/tests/ | ||
69 | install -m 0755 ${B}/testutil_test ${D}${PTEST_PATH}/tests/ | ||
70 | install -m 0755 ${B}/cache_test ${D}${PTEST_PATH}/tests/ | ||
71 | } | ||
72 | |||
57 | # Need toku_time_now() implemented for ppc/musl | 73 | # Need toku_time_now() implemented for ppc/musl |
58 | # see utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h | 74 | # see utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h |
59 | COMPATIBLE_HOST:libc-musl:powerpc = "null" | 75 | COMPATIBLE_HOST:libc-musl:powerpc = "null" |
76 | COMPATIBLE_HOST:armv5 = 'null' | ||