You are not logged in.

#1 2020-03-19 16:14:52

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,841

[SOLVED} cmake / ninja - disable building tests if --nocheck is used

My llvm trunk packages* do build tests and have a check() function , but the tests fail rather often.
In order to be able to run the tests in check() , -D LLVM_BUILD_TESTS=ON \ is used to instruct cmake/ninja to build tests.

This increases the time & resources needed during build() by a lot.
If there is a way to determine whether makepkg is run with --nocheck (or !check in BUILDENV ) , I could disable building tests for that case and get  a substantial speedup .

How could this be achieved ?







*
f.e. https://aur.archlinux.org/packages/llvm-minimal-git

Last edited by Lone_Wolf (2020-03-20 12:53:32)


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#2 2020-03-19 17:05:21

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,159

Re: [SOLVED} cmake / ninja - disable building tests if --nocheck is used

Is there no way to make cmake only build the test code during "ninja check" rather than by default during build()?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2020-03-20 12:53:05

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,841

Re: [SOLVED} cmake / ninja - disable building tests if --nocheck is used

I couldn't find an option for that, but decided to try anyway .

It turned out the check-* targets verify if build tests are already compiled and if not, compile them first and then run the tests.

So it seems the upstream developers had already considered this usecase.


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#4 2020-03-20 20:48:26

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,159

Re: [SOLVED} cmake / ninja - disable building tests if --nocheck is used

Hmm, so you're saying LLVM_BUILD_TESTS doesn't configure whether the tests are added to the build system, but only configures whether they are built by default?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2020-03-21 13:37:19

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,841

Re: [SOLVED} cmake / ninja - disable building tests if --nocheck is used

That's what it looks like to me.

In order to allow others to replicate results (without having to deal with everchanging vcs packages) , I've used extra-x86_64-build on llvm-9.0.1-2 from repos to build with -D LLVM_BUILD_TESTS=ON and OFF .
The logs are uploaded to my box account and shared for download/view .

-DLLVM_BUILD_TESTS=OFF
https://app.box.com/s/egq8cl70rmx4wwt9a5nt4mmpxj82hnds
https://app.box.com/s/7b5pty8l9kksakehocb8v48ndxn7rdp2

-DLLVM_BUILD_TESTS=ON
https://app.box.com/s/n9jkx0wtvs26kyrbyr4pdigvisshz95h
https://app.box.com/s/2nr8hdewtrhg7m0pi4mcn4usbtefk2t6


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

Board footer

Powered by FluxBB