fedora-llvm-team / llvm-snapshots

Everything to build LLVM snapshots
https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots/
14 stars 8 forks source link

Can't test RHEL on testing-farm (i.e. `Repository 'epel-9-x86_64' does not exist in project '@fedora-llvm-team/llvm-snapshots-big-merge-20240526'.`) #513

Closed kwk closed 1 month ago

kwk commented 1 month ago

Current behaviour

Our current test requests with testing-farm on RHEL try to install from epel:

The exception was caused by 1 earlier exceptions

Cause number 1:

    prepare step failed

    The exception was caused by 1 earlier exceptions

    Cause number 1:

        Command 'dnf copr -y enable -y @fedora-llvm-team/llvm-snapshots-big-merge-20240526' returned 1.

        stderr (17 lines)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Enabling a Copr repository. Please note that this repository is not part
        of the main distribution, and quality may vary.

        The Fedora Project does not exercise any power over the contents of
        this repository beyond the rules outlined in the Copr FAQ at
        <https://docs.pagure.org/copr.copr/user_documentation.html#what-i-can-build-in-copr>,
        and packages are not held to any quality or security level.

        Please do not file bug reports about these packages in Fedora
        Bugzilla. In case of problems, contact the owner of this repository.
        Error: It wasn't possible to enable this project.
        Repository 'epel-9-x86_64' does not exist in project '@fedora-llvm-team/llvm-snapshots-big-merge-20240526'.
        Available repositories: 'fedora-rawhide-aarch64', 'fedora-39-ppc64le', 'fedora-39-s390x', 'fedora-40-i386', 'fedora-39-x86_64', 'fedora-38-aarch64', 'rhel-9-aarch64', 'fedora-40-aarch64', 'fedora-38-x86_64', 'fedora-38-i386', 'fedora-40-ppc64le', 'fedora-40-x86_64', 'rhel-9-x86_64', 'fedora-rawhide-s390x', 'fedora-40-s390x', 'rhel-9-s390x', 'fedora-rawhide-ppc64le', 'fedora-rawhide-i386', 'fedora-39-i386', 'fedora-39-aarch64', 'fedora-38-ppc64le', 'fedora-rawhide-x86_64', 'fedora-38-s390x'

        If you want to enable a non-default repository, use the following command:
          'dnf copr enable @fedora-llvm-team/llvm-snapshots-big-merge-20240526 <repository>'
        But note that the installed repo file will likely need a manual modification.
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---^---^---^---^---^---

See this tmt-run.log

Expected behaviour

DNF should try to install from the correct rhel based repository and not from RHEL.

Proposal

The tmt-run.log from above shows this solution:

dnf copr enable @fedora-llvm-team/llvm-snapshots-big-merge-20240526 <repository>

We can apply this solution to the way that we enable the snapshot repository here:

prepare:
  - how: install
    copr: "@fedora-llvm-team/$COPR_PROJECT"

The trick is to pass an additional parameter like so:

prepare:
  - how: install
    copr: "@fedora-llvm-team/$COPR_PROJECT $COPR_CHROOT"

$COPR_CHROOT can be set as an environment variable similar to COPR_PROJECT to the chroot for which we make the request.