From ac677e98aaf7449c98f19365cd64e5b6b486a423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Wed, 2 Dec 2026 08:44:54 +0100 Subject: [PATCH] Test master with the Rust omc All the jobs that test master, and the pull request job, now build the Rust omc. Before, only the wasm jobs did; the other jobs tested the bootstrapped C omc. runRegressiontest adds the cmake flags of the Rust omc (rustCmakeFlags, formerly wasmCmakeFlags) when testsRustOMC(branch) is true, so the stages do not give them. The wasm jobs get the same cmake flags as before, so their cached omc stays valid. The cache of the other master jobs has a new stamp, so they build the Rust omc on the first run. Assisted-by: Claude Opus 5.5 --- .CI/Jenkinsfile | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.CI/Jenkinsfile b/.CI/Jenkinsfile index 722f846..150c0a9 100644 --- a/.CI/Jenkinsfile +++ b/.CI/Jenkinsfile @@ -207,8 +207,7 @@ pipeline { if (pullRequestTarget() == 'C') { runRegressiontest("pr/${pullRequest()}", "pr/${pullRequest()}", '', '', false, pullRequestSimflags(), testFlags, false, false, 0, config) } else { - runRegressiontest("pr/${pullRequest()}", "pr/${pullRequest()}", 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, pullRequestSimflags(), "--nobuildmodel ${testFlags}", false, false, 0, config, - wasmCmakeFlags()) + runRegressiontest("pr/${pullRequest()}", "pr/${pullRequest()}", 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, pullRequestSimflags(), "--nobuildmodel ${testFlags}", false, false, 0, config) } } } @@ -344,8 +343,7 @@ pipeline { // --nobuildmodel: the model is translated, compiled and simulated by one simulate(), // so omc reports the JIT compile as the build time rather than leaving it in the // simulation the way a resimulate does. - runRegressiontest('master', 'wasm-jit', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 0, 'configs/conf.json', - wasmCmakeFlags()) + runRegressiontest('master', 'wasm-jit', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 0, 'configs/conf.json') } } stage('wasm-fmu') { @@ -363,8 +361,7 @@ pipeline { steps { // --branch=wasm-jit and no runner of its own fills that table: the two runners write // wasm-jit-me and wasm-jit-cs, beside the wasm-jit the stage above fills. - runRegressiontest('master', 'wasm-jit', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--wasmfmu=me,cs', false, false, 0, 'configs/conf.json', - wasmCmakeFlags()) + runRegressiontest('master', 'wasm-jit', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--wasmfmu=me,cs', false, false, 0, 'configs/conf.json') } } stage('wasm-web') { @@ -384,7 +381,7 @@ pipeline { // driver and solvers, which the environment below selects. withEnv(wasmWebEnv()) { runRegressiontest('master', 'wasm-web', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 0, 'configs/conf.json', - wasmCmakeFlags() + ' -DRUST_OMC_WASM_INWASM_DRIVER=ON') + '-DRUST_OMC_WASM_INWASM_DRIVER=ON') } } } @@ -481,8 +478,7 @@ pipeline { expression { params.heavy_tests_wasm } } steps { - runRegressiontest('master', 'heavy_tests_wasm', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 1, 'configs/heavy_tests.json', - wasmCmakeFlags()) + runRegressiontest('master', 'heavy_tests_wasm', 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 1, 'configs/heavy_tests.json') } } @@ -911,6 +907,11 @@ def sccachePreamble() { ''' } +/* Whether the omc tested for `branch` is the Rust one: master and the pull requests into it. */ +def testsRustOMC(branch) { + return branch == 'master' || branch.startsWith('pr/') +} + /** * Whether omc is built with cmake for `branch`, rather than with Autoconf and Makefiles. * @@ -941,7 +942,7 @@ def buildsWithCMake(branch) { * physical cpus on the machine'. * @param libs_config_file: The config file to be used for testing. * This file specifies which libraries to test and what options to use for them. - * @param cmakeFlags: Target-specific cmake flags, e.g. `-DOM_OMC_ENABLE_RUST=ON`, added to the + * @param cmakeFlags: Target-specific cmake flags, e.g. `-DRUST_OMC_WASM_INWASM_DRIVER=ON`, added to the * shared release flags. Only for the branches built with cmake, see * buildsWithCMake(). * @param dockerfile: Directory with a Dockerfile, relative to the testing repository. Defaults to @@ -958,10 +959,8 @@ def fmiSimulators(fmi3 = false) { (fmi3 ? ['fmpy-fmi3-cs-cvode'] : []) } -/* The cmake flags of an omc that can translate to wasm-jit. The wasm-jit and - * wasm-fmu jobs share the build cached in ~/saved_omc/wasm-jit, so they have to - * ask for the same one. */ -def wasmCmakeFlags() { +/* The cmake flags of the Rust omc, which testsRustOMC() adds to a job's own. */ +def rustCmakeFlags() { return '-DOM_OMC_ENABLE_RUST=ON -DRUST_OMC_CI=ON -DRUST_OMC_THREADS=4 -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache' } @@ -1126,6 +1125,9 @@ def runRegressiontest(branch, name, extraFlags, omsHash, omcompiler, extrasimfla OMCPATH = "${omcompiler ? '../' : './'}OMCompiler" def useCMake = buildsWithCMake(branch) + if (testsRustOMC(branch)) { + cmakeFlags = "${rustCmakeFlags()} ${cmakeFlags}".trim() + } // The build runs in OMCompiler, one level below the cmake source tree. if (useCMake && omcompiler) { error 'cmake builds need the OMCompiler directory of the OpenModelica repository (omcompiler=false)'