#135 tests: ninja is not ninja on RHEL7/ppc64/Epel
Merged 6 months ago by sergesanspaille. Opened 7 months ago by happz.
rpms/ happz/llvm tests-ninja-ppc64-name  into  rawhide

@@ -34,4 +34,4 @@ 

  cd llvm-toolchain-integration-test-suite

  mkdir _build && cd _build

  cmake .. -GNinja ${CMAKE_CXXLIB:-}

- ninja $thread_args check

+ cmake --build . $thread_args --target check

no initial comment

Build succeeded.

rebased onto 32e387c164cdaf68d5745c3055f10616c89e7c41

6 months ago

If you usecmake --build to trigger the build, it should make the patch much simpler (and robust)

If you usecmake --build to trigger the build, it should make the patch much simpler (and robust)

Yes, please use cmake --build.

Can you be more specific? Code we have comes from the "original" content of this repo before adding TMT, I got no chance to invent any thing better, therefore I'm afraid I'm not sure what exactly should I drop and/or replace.

Would this be better then? Is cmake going to use the right ninja executable, i.e. ninja-build when ninja does not exist?

cd llvm-toolchain-integration-test-suite
cmake .. --build -GNinja ${CMAKE_CXXLIB:-}

to replace the current script (plus the proposed ninja fix):

cd llvm-toolchain-integration-test-suite
mkdir _build && cd _build
cmake .. -GNinja ${CMAKE_CXXLIB:-}
"$NINJA" $thread_args check

Can you be more specific? Code we have comes from the "original" content of this repo before adding TMT, I got no chance to invent any thing better, therefore I'm afraid I'm not sure what exactly should I drop and/or replace.

The basic idea is that you invoke CMake once and tell it what build system to use (e.g. Unix Makefiles or Ninja for example). This is "configure" step. Then instead of manually calling the build tool explicitly in the build step, you call cmake --build <builddir> to let cmake figure out what underlying build system binary to call.

Would this be better then? Is cmake going to use the right ninja executable, i.e. ninja-build when ninja does not exist?

Yes, cmake will call the right tool if you build with cmake --build <builddir> instead of cd <builddir> && ninja.

bash cd llvm-toolchain-integration-test-suite cmake .. --build -GNinja ${CMAKE_CXXLIB:-}

This is wrong. This is the configure step and --build doesn't belong here. You need a separate invocation of cmake to actually build.

to replace the current script (plus the proposed ninja fix):

bash cd llvm-toolchain-integration-test-suite mkdir _build && cd _build cmake .. -GNinja ${CMAKE_CXXLIB:-} "$NINJA" $thread_args check

I'd replace "$NINJA" $thread_args check with cmake --build . $thread_args check. Right @sergesanspaille ?

I'm not surprised I got it wrong, that's why I'm asking, I use cmake very rarely :) But it makes sense to replace the actual "build" command, you're right about the "configure" and "build" steps being separate here, thanks for the explanation.

So this should be close to what we need, if not the final answer:

cd llvm-toolchain-integration-test-suite
mkdir _build && cd _build
cmake .. -GNinja ${CMAKE_CXXLIB:-}
cmake --build . $thread_args check

@happz I think you got it right unless @sergesanspaille has a different opinion.

Clean and simple! Thanks @kkleine & @happz for paying attention to details ;-)

rebased onto 415bca7da86acd5abc3bd207cb5bf83c04617d11

6 months ago

Got it, and it's fixed. I just need to test it with a couple of environments.

It doesn't look like any tests were executed:

+ threads=0
+ thread_args=
+ repo_url=https://github.com/opencollab/llvm-toolchain-integration-test-suite
+ '[' 0 -gt 0 ']'
+ '[' 0 -ge 1 ']'
++ mktemp -d -p /var/tmp
+ cd /var/tmp/tmp.pD9p2kBLuC
+ git clone https://github.com/opencollab/llvm-toolchain-integration-test-suite
Cloning into 'llvm-toolchain-integration-test-suite'...
+ cd llvm-toolchain-integration-test-suite
+ mkdir _build
+ cd _build
+ cmake .. -GNinja -DENABLE_LIBCXX=OFF
-- Checking for lit
-- Checking for clang++
-- Checking for clang
-- Checking for clang-tidy
-- Checking for clang-format
-- Checking for clang-format-diff
-- Checking for clangd
-- Checking for opt
-- Checking for llvm-nm
-- Checking for llc
-- Checking for lli
-- Checking for opt
-- Checking for llvm-profdata
-- Checking for lld
-- Checking for lldb
-- Checking for llvm-config
-- Checking for llvm-objdump
-- Checking for scan-build
-- Checking for scan-view
-- Checking for scan-build-py
-- Checking for mlir-translate
-- Disabling tests related to mlir-translate
-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/tmp.pD9p2kBLuC/llvm-toolchain-integration-test-suite/_build
+ cmake --build . check
ninja: no work to do.

add --target check instead of just check

rebased onto c3eaca6

6 months ago

Build succeeded.

Pull-Request has been merged by sergesanspaille

6 months ago
Metadata