#129 tests: add support for SCL-ized LLVM 13 (llvm-toolset-13.0)
Merged 8 months ago by sergesanspaille. Opened 9 months ago by happz.
rpms/ happz/llvm tests-add-scl-support  into  rawhide

@@ -1,2 +1,2 @@ 

  summary: Make sure the the LLVM plugin for binutils' ar works

- test: ./test.sh

+ test: "$WITH_SCL ./test.sh"

file modified
+1 -1
@@ -1,3 +1,3 @@ 

  summary: Make sure rebuilding LLVM still works with the new LLVM

- test: ./test.sh

+ test: "$WITH_SCL ./test.sh"

  enabled: false

file modified
+18 -4
@@ -1,3 +1,15 @@ 

+ #

+ # Build/PR gating tests for *LLVM 13*

+ #

+ # Compatible with various LLVM 13 distributions:

+ #

+ #   * Fedora (ursine packages)

+ #   * Centos 9 stream (ursine packages)

+ #   * RHEL-9 (ursine packages)

+ #   * RHEL-8 (Red Hat module)

+ #   * RHEL-7 (software collection)

+ #

+ 

  summary: LLVM tests for build/PR gating

  adjust:

    - because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR."
@@ -6,14 +18,16 @@ 

        and trigger != commit

        and trigger != build

      enabled: false

+ 

+   - because: "When testing SCL-ized LLVM, the collection must be enabled first"

+     environment+:

+       WITH_SCL: "scl enable llvm-toolset-13.0 rust-toolset-1.58"

+     when: "collection == llvm-toolset-13.0"

+ 

  discover:

      how: fmf

  execute:

      how: tmt

- prepare:

-     - name: packages

-       how: install

-       package: llvm

  provision:

    hardware:

      memory: ">= 4 GiB"

@@ -1,29 +1,49 @@ 

  summary: Run the upstream LLVM integration test suite

  description: |

    Run the upstream LLVM integration test suite

- test: ./test.sh

+ test: "$WITH_SCL ./test.sh"

  require:

-   - cmake

-   - llvm-devel

-   - clang

-   - clang-analyzer

-   - clang-tools-extra

-   - compiler-rt

    - ninja-build

-   - libomp-devel

-   - lld

-   - lldb

    - git

    - make

    - libstdc++-static

-   - clang-devel

-   - python3-lit

  adjust:

+   # Common requirements when LLVM is not SCL-ized

+   - require+:

+       - cmake

+       - clang

+       - clang-analyzer

+       - clang-devel

+       - clang-tools-extra

+       - compiler-rt

+       - lld

+       - lldb

+       - libomp-devel

+       - llvm-devel

+       - python3-lit

+     when: "collection is not defined"

+ 

+   # Requirements for SCL-ized LLVM

+   - require+:

+       - llvm-toolset-13.0-cmake

+       - llvm-toolset-13.0-clang

+       - llvm-toolset-13.0-clang-analyzer

+       - llvm-toolset-13.0-clang-devel

+       - llvm-toolset-13.0-clang-tools-extra

+       - llvm-toolset-13.0-compiler-rt

+       - llvm-toolset-13.0-lld

+       - llvm-toolset-13.0-lldb

+       - llvm-toolset-13.0-libomp-devel

+       - llvm-toolset-13.0-llvm-devel

+       - llvm-toolset-13.0-python3-lit

Is it possible to use some kind of variable hold the suffix and populate the suffix conditionaly?

+     when: "collection == llvm-toolset-13.0"

+ 

    # libcxx shall be required in Fedora, it's not shipped with RHEL.

    - require+:

        - libcxx-devel

      when: "distro == fedora"

      because: testing against libcxx package in Fedora

+ 

    - environment+:

        CMAKE_CXXLIB: "-DENABLE_LIBCXX=OFF"

      when: "distro == rhel"

file modified
+8 -1
@@ -1,2 +1,9 @@ 

  summary: Check that libLLVM.so has been properly stripped

- test: ./test.sh

+ test: "$WITH_SCL ./test.sh"

+ environment:

+   LIBLLVM_PATH: /usr/lib64/libLLVM.so

+ adjust:

+   - because: "With SCL-ized LLVM, library path is different"

+     environment+:

+       LIBLLVM_PATH: /opt/rh/llvm-toolset-13.0/root/usr/lib64/libLLVM.so

+     when: "collection == llvm-toolset-13.0"

file modified
+1 -1
@@ -7,4 +7,4 @@ 

  # is less than 100MB to ensure it was successfully stripped.

  # https://bugzilla.redhat.com/show_bug.cgi?id=1793250

  

- test $(stat -L -c %s /usr/lib64/libLLVM.so) -lt 104857600

+ test $(stat -L -c %s $LIBLLVM_PATH) -lt 104857600

file modified
+1 -1
@@ -1,2 +1,2 @@ 

  summary: Make sure llvm-config symlink is properly set up

- test: ./test.sh

+ test: "$WITH_SCL ./test.sh"

file modified
+24 -14
@@ -1,16 +1,26 @@ 

  summary: Test basic cargo usage

- test: ./test.sh

- require:

- # Required for rust and possibly other dependant packages

- #

- # NOTE #1: drop the requirement once the transitional period between releases is gone

- # and llvm-compat is no longer a) needed, and b) part of the build.

- #

- # NOTE #2: keep it the first requirement. Depending on the order of requirements, placing it somewhere

- # else in the list may lead to harness uninstalling and re-installing LLVM packages. That a) would be

- # a waste of time, b) could potentially hide issues, leading to testing unexpected NVRs.

- #

- #  - llvm-compat

+ test: "$WITH_SCL ./test.sh"

+ require: []

+ adjust:

+   # Common requirements when LLVM is not SCL-ized

+   - require+:

+     # Required for rust and possibly other dependant packages

+     #

+     # NOTE #1: drop the requirement once the transitional period between releases is gone

+     # and llvm-compat is no longer a) needed, and b) part of the build.

+     #

+     # NOTE #2: keep it the first requirement. Depending on the order of requirements, placing it somewhere

+     # else in the list may lead to harness uninstalling and re-installing LLVM packages. That a) would be

+     # a waste of time, b) could potentially hide issues, leading to testing unexpected NVRs.

+     #

+     #  - llvm-compat

  

-   - cargo

-   - rust

+       - cargo

+       - rust

+     when: "collection is not defined"

+ 

+   # Requirements for SCL-ized LLVM

+   - require+:

+       - rust-toolset-1.58-cargo

+       - rust-toolset-1.58-rust

+     when: "collection == llvm-toolset-13.0"

@@ -1,2 +1,2 @@ 

  summary: Make sure the versioned llvm-config symlink is properly set up

- test: ./test.sh

+ test: "$WITH_SCL ./test.sh"

no initial comment

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Verified with various LLVM 13 flavors. There are some failed tests for llvm-toolset-13.0 collection, but those are not caused by tests but rather genuine issues worth reporting.

Build succeeded.

Build succeeded.

Is it possible to use some kind of variable hold the suffix and populate the suffix conditionaly?

Is it possible to use some kind of variable hold the suffix and populate the suffix conditionaly?

If you ask for something like this:

adjust:
  # Requirements for SCL-ized LLVM
  - set:
      SCLIZED_REQUIRE: "llvm-toolset-13.0-"
    when: "collection == llvm-toolset-13.0"

  - require+:
      - "${SCLIZED_REQUIRE}cmake"
      - "${SCLIZED_REQUIRE}clang"
      ...

then the answer is "no". require does not allow this kind of runtime modifications, there's no way to influence "variables" known to TMT at this point.

I did ask about something similar, it was actually my first idea, some kind of "programmable" requirement. Not supported. On the other hand, should this be allowed, then it might become quite powerful over time, allowing so many wild rules - that I somehow realized it might make things actually worse, prone to overcomplicated rules, therefore I didn't even file a TMT issue for this kind of feature. Also, I must admit I kind of like the explicitness of those two lists.

ok! That was indeed my thoughts :-)

Pull-Request has been merged by sergesanspaille

8 months ago