RFC: Split out project version in CMakeLists into a separate file to simplify downstream snapshot builds

Albert Astals Cid aacid at kde.org
Mon Apr 12 20:17:16 BST 2021


El dilluns, 12 d’abril de 2021, a les 20:39:26 (CEST), Neal Gompa va escriure:
> Hello all,
> 
> In the Fedora KDE SIG, we're working on setting up a process to build
> nightly snapshots of KDE software so that we can build and test
> changes across the stack easily. However, a hurdle that we've
> encountered early on is that it's difficult to pull out the version
> from the CMakeLists and use it to prepare a snapshot version for RPMs
> because they need to be evaluated by CMake to generate the correct
> value. 

I don't understand why running cmake to get the version is hard but writing a script to parse a file is easy.

They are both "running binaries", so if you can just run binaries why not just do the cmake thing that requires no changes on our side?

Cheers,
  Albert

P.S: If the problem is you don't know how to get the version from cmake we do this in various places, one being https://invent.kde.org/sysadmin/release-tools/-/blob/master/tools/python-kde-release/kde_release/cmake.py you basically run cmake with --trace-expand and parse the verison out of it.

> What I'd like to ask is to consider splitting out the version
> into a simple text file that CMakeLists would source to set the
> version.
> 
> This makes it much easier for us to parse it to generate the snapshot
> version string for our spec files when we're dynamically updating them
> for new snapshot builds. I've seen a few projects do this, so I know
> that it's possible. It's just more of a question if this is something
> we can have as a style thing for KDE projects to make it simpler to be
> able to continuously build KDE software for testing.
> 
> I'm also open to better ideas if there are any, too. :)
> 
> Best regards,
> Neal
> 
> --
> 真実はいつも一つ!/ Always, there's only one truth!
> 







More information about the kde-devel mailing list