From Fedora Project Wiki
mNo edit summary
Line 43: Line 43:
* [https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject.org/thread/6DXB77G5BWSDDULN3J2PJQF4GYHP2ED2/ Contribution by Stephan Gallagher, May 2020, EPEL Dev mailing list]
* [https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject.org/thread/6DXB77G5BWSDDULN3J2PJQF4GYHP2ED2/ Contribution by Stephan Gallagher, May 2020, EPEL Dev mailing list]
* [https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject.org/thread/ICZGG2SQKUTV2JUBAS4XTWX2FQIKZT27/ CMake as module on EPEL 8]
* [https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject.org/thread/ICZGG2SQKUTV2JUBAS4XTWX2FQIKZT27/ CMake as module on EPEL 8]
* [https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject.org/thread/6DXB77G5BWSDDULN3J2PJQF4GYHP2ED2/ CMAke as module - procedure]


The first thing to look at is CMake's compatibility policy. At a quick glance, it appears that CMake upstream expects to maintain backwards-compatible support for all minor releases within the "3.x" major release number. So from my perspective, the best choice for you would be to pick the stream name "3", resulting in `cmake:3` as your module stream. This will allow you to update to any future 3.x release within the same stream. If CMake 4 is ever released, you can create the `cmake:4` stream in the same manner.
The first thing to look at is CMake's compatibility policy. At a quick glance, it appears that CMake upstream expects to maintain backwards-compatible support for all minor releases within the "3.x" major release number. So from my perspective, the best choice for you would be to pick the stream name "3", resulting in `cmake:3` as your module stream. This will allow you to update to any future 3.x release within the same stream. If CMake 4 is ever released, you can create the `cmake:4` stream in the same manner.
Line 64: Line 65:
[1] https://src.fedoraproject.org/modules/cmake
[1] https://src.fedoraproject.org/modules/cmake
[2] https://docs.fedoraproject.org/en-US/modularity/making-modules/defining-modules/
[2] https://docs.fedoraproject.org/en-US/modularity/making-modules/defining-modules/
=== Alternative description ===
1) Make a module:
$ fedpkg clone cmake3
$ fedpkg request-repo --namespace modules --exception cmake3-latest
$ fedpkg request-branch --namespace modules --repo cmake3-latest epel8
2) Writing a `modulemd` file based on this example [1]:
[1] https://docs.fedoraproject.org/en-US/modularity/making-modules/defining-m...
3) Build the module:
$ fedpkg module-build

Revision as of 18:00, 15 May 2020

Message from Petr Pisar on the 14 May 2020, on the Fedora Devel mailing list:

Let's look at real examples. <https://bodhi.fedoraproject.org/releases/EPEL-8M> lists avocado-latest-820200512173744.9edba152 module. That's this <https://koji.fedoraproject.org/koji/buildinfo?buildID=3D1506528> module build in Koji. The Source field reads <https://src.fedoraproject.org/modules/avocado.git?#12e2140e759fdb0a4477ab2432c411a4452d8efc>.

Theat means "fedpkg clone modules/avocado" and there these branches:

  • latest
 remotes/origin/52lts
 remotes/origin/69lts
 remotes/origin/HEAD -> origin/latest
 remotes/origin/f29
 remotes/origin/latest
 remotes/origin/master
 remotes/origin/stable

The module stream is called "latest", let us check "latest" branch:

commit 12e2140e759fdb0a4477ab2432c411a4452d8efc (HEAD -> latest, origin/lat= est, origin/HEAD) Author: Merlin Mathesius <mmathesi@redhat.com> Date: Tue May 12 12:37:44 2020 -0500

   Rebuild with avocado 79.0.
   Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>

So you can see the module is built from a non-epel8 branch. An avocado.yaml file lists these dependencies:

 dependencies:
 - buildrequires:
     platform: []
   requires:
     platform: []

So "platform" is left empty to expand it by MBS on all available platforms. If you look at koji listing <https://koji.fedoraproject.org/koji/packageinfo?packageID=3D26942>, there are five modules avocado-latest-*20200512173744 builds of from the same sources. That probably means that Koji attempts to build the module for all Fedoras and EPEL 8. Technically, it's possible to override the platform with "fedpkg module-build" command, but I cannot see any trace of it in the logs.

That build was performed by "merlinm" users. You can ask him for more details.

Cmake 3 as a module

The first thing to look at is CMake's compatibility policy. At a quick glance, it appears that CMake upstream expects to maintain backwards-compatible support for all minor releases within the "3.x" major release number. So from my perspective, the best choice for you would be to pick the stream name "3", resulting in cmake:3 as your module stream. This will allow you to update to any future 3.x release within the same stream. If CMake 4 is ever released, you can create the cmake:4 stream in the same manner.

To do this, request the "3" branch for the cmake module with:

$ fedpkg request-branch --namespace modules cmake 3

Once that branch is created:

$ fedpkg clone modules/cmake
$ fedpkg switch-branch 3

Create a cmake.yaml file in the dist-git checkout as described in the docs [2], commit and push it to dist-git and then do:

$ fedpkg module-build

When creating the definition, you'll want to either leave the dependencies at platform: [ ] (meaning build for all supported releases, Fedora and EPEL) or else specifically use platform: [ el8 ] to build only for EPEL 8.

All of this said: it's important to note that this approach also means that any package that wants to use your newer CMake to build in EPEL 8 will need to build as a module and set their module dependency to include cmake:3. It won't be available in the buildroot for non-modular packages.

[1] https://src.fedoraproject.org/modules/cmake [2] https://docs.fedoraproject.org/en-US/modularity/making-modules/defining-modules/

Alternative description

1) Make a module:

$ fedpkg clone cmake3
$ fedpkg request-repo --namespace modules --exception cmake3-latest
$ fedpkg request-branch --namespace modules --repo cmake3-latest epel8

2) Writing a modulemd file based on this example [1]:

[1] https://docs.fedoraproject.org/en-US/modularity/making-modules/defining-m...

3) Build the module:

$ fedpkg module-build