Skip to content

The new -Dasserts=ON flag breaks standalone roottest #6575

@eguiraud

Description

@eguiraud

Describe the bug

Our nightly conda builds are affected.

An example of the broken tests is here. The relevant part of the output:

cd /test_job/roottest_build/cling/array
/usr/bin/timeout -s USR2 270s /opt/conda/envs/test-root/bin/root -e '#define NDEBUG' -e '#define ClingWorkAroundMissingDynamicScope' -e '#define ClingWorkAroundUnnamedInclude' -e '#define ClingWorkAroundMissingSmartInclude' -e '#define ClingWorkAroundNoDotInclude' -e '#define ClingWorkAroundMissingAutoLoadingForTemplates' -e '#define ClingWorkAroundAutoParseUsingNamespace' -e '#define ClingWorkAroundTClassUpdateDouble32' -e '#define ClingWorkAroundAutoParseDeclaration' -e '#define ClingWorkAroundMissingUnloading' -e '#define ClingWorkAroundBrokenUnnamedReturn' -e '#define ClingWorkAroundUnnamedDetection2' -e 'gSystem->SetBuildDir("/test_job/roottest_build/cling/array",true)' -e 'gSystem->AddDynamicPath("/test_job/roottest_build/cling/array")' -e 'gROOT->SetMacroPath("/test_job/roottest/cling/array")' -e 'gInterpreter->AddIncludePath("-I/test_job/roottest_build/cling/array")' -e 'gSystem->AddIncludePath("-I/test_job/roottest_build/cling/array")' -q -l -b /test_job/roottest/cling/array/runarray1test.C
-- BEGIN TEST OUTPUT --

ROOT_cli_0:1:9: warning: 'NDEBUG' macro redefined [-Wmacro-redefined]
#define NDEBUG
        ^
<command line>:1:9: note: previous definition is here
#define NDEBUG 1
        ^

To Reproduce

To reproduce it's sufficient to compile ROOT with -DCMAKE_BUILD_TYPE=Release -Droottest=OFF and then compile roottest separately against this build of ROOT.

Additional context

As far as I understand, that -e '#define NDEBUG' in the invocation of root.exe used by roottest was not there before, and it's what's causing the issue.

roottest takes the -e '#define ...' arguments from cmake's COMPILE_DEFINITIONS (a quick git grep COMPILE_DEFINITIONS in the roottest repository shows where this happens).

I could not figure out where the other definition of NDEBUG comes from.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions