[education/rkward] /: Add occasional build against R devel
Thomas Friedrichsmeier
null at kde.org
Thu Apr 9 21:32:56 BST 2026
Git commit 8af723ef13980cc0391303b64eb29fd362efddf7 by Thomas Friedrichsmeier.
Committed on 09/04/2026 at 20:32.
Pushed by tfry into branch 'master'.
Add occasional build against R devel
M +29 -0 .gitlab-ci.yml
M +30 -27 rkward/autotests/core_test.cpp
https://invent.kde.org/education/rkward/-/commit/8af723ef13980cc0391303b64eb29fd362efddf7
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e994d096e..c485d349a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -77,3 +77,32 @@ check_warnings:
script:
- "if [[ $(cat build/make.error | grep warning -i) ]]; then cat build/make.error; exit 1; fi"
allow_failure: true
+
+# R does *not* have strong promise of backwards compatibility, we encounter breakage quite frequently for new minor releases
+# Check occasionally, what kind of breakage has already happened
+build_r_devel:
+ extends:
+ - .ci_linux_base
+ - .suse_tumbleweed_qt6stable
+ rules:
+ # only run on the scheduled interval, or manual
+ - if: $R_DEVEL_PIPELINE == "1"
+ allow_failure: false
+ - when: manual
+ allow_failure: true
+ script:
+ # fetch and build R devel version
+ - mkdir -p $CI_PROJECT_DIR/rdir && cd $CI_PROJECT_DIR/rdir
+ - wget https://cran.r-project.org/src/base-prerelease/R-devel.tar.xz
+ - tar -xJf R-devel.tar.xz
+ - mkdir install
+ - mkdir build && cd build
+ - ../R-devel/configure --prefix=$CI_PROJECT_DIR/rdir/install --enable-R-shlib --with-x=no --with-recommended-packages=no
+ - make -j 9 && make install
+ - cd ../..
+ # build rkward, next
+ - git config --global --add safe.directory $CI_PROJECT_DIR
+ # no dlopen() loading, to get at better symbol information for the backend process from ASAN
+ - python3 -u ci-utilities/run-ci-build.py --project $CI_PROJECT_NAME --branch $CI_COMMIT_REF_NAME --platform Linux/Qt6/Shared --extra-cmake-args=-DR_EXECUTABLE=$CI_PROJECT_DIR/rdir/install/bin/R --extra-cmake-args=-DDLOPEN_RLIB=0
+ after_script:
+ - ci-utilities/run-collect-crashes.py
diff --git a/rkward/autotests/core_test.cpp b/rkward/autotests/core_test.cpp
index 1840d587d..8e3b81d2d 100644
--- a/rkward/autotests/core_test.cpp
+++ b/rkward/autotests/core_test.cpp
@@ -60,11 +60,40 @@ void testLog(const char *fmt, ...) {
va_end(ap);
}
+void listBackendLog() {
+ testLog("Listing (new) contents of /tmp/rkward.rbackend");
+ QByteArray output, oldoutput;
+ QFile f(QDir::tempPath() + u"/rkward.rbackend"_s);
+ if (f.open(QIODevice::ReadOnly)) {
+ output = f.readAll();
+ f.close();
+ }
+
+ QFile fl(QDir::tempPath() + u"/rkward.rbackend.listed"_s);
+ if (fl.open(QIODevice::ReadOnly)) {
+ oldoutput = fl.readAll();
+ fl.close();
+ }
+
+ if (fl.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
+ fl.write(output);
+ fl.close();
+ }
+
+ if (output.startsWith(oldoutput)) {
+ output = output.sliced(oldoutput.length());
+ }
+ testLog("%s", qPrintable(QString::fromLocal8Bit(output)));
+}
+
void RKDebug(int, int level, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
testLog(fmt, ap);
- if (level >= DL_ERROR) QFAIL("error message during test (see above)");
+ if (level >= DL_ERROR) {
+ listBackendLog();
+ QFAIL("error message during test (see above)");
+ }
va_end(ap);
}
@@ -128,32 +157,6 @@ class RKWardCoreTest : public QObject {
RInterface::issueCommand(new RCommand(QStringLiteral("rm(list=ls(all.names=TRUE))"), RCommand::User));
}
- void listBackendLog() {
- testLog("Listing (new) contents of /tmp/rkward.rbackend");
- QByteArray output, oldoutput;
- QFile f(QDir::tempPath() + u"/rkward.rbackend"_s);
- if (f.open(QIODevice::ReadOnly)) {
- output = f.readAll();
- f.close();
- }
-
- QFile fl(QDir::tempPath() + u"/rkward.rbackend.listed"_s);
- if (fl.open(QIODevice::ReadOnly)) {
- oldoutput = fl.readAll();
- fl.close();
- }
-
- if (fl.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
- fl.write(output);
- fl.close();
- }
-
- if (output.startsWith(oldoutput)) {
- output = output.sliced(oldoutput.length());
- }
- testLog("%s", qPrintable(QString::fromLocal8Bit(output)));
- }
-
void waitForBackendStarted() {
QElapsedTimer t;
t.start();
More information about the rkward-tracker
mailing list