conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
921 stars 1.66k forks source link

[request] Update version names for bgfx/, bx/, bimg/ (then update the version itself) #24345

Open xoorath opened 2 weeks ago

xoorath commented 2 weeks ago

Package Name/Version

bgfx/cci.20230216, bimg/cci.20230114, bx/cci.20221116

Changelog

https://github.com/bkaradzic/bgfx

Context about the new update

The recipes for bgfx, bimg and bx currently only have one version each and have a naming pattern cci.YYYYMMDD. I'd like to update this to use the actual bgfx version and make a few fixes.

bgfx already has a version number with the following format

        // bgfx 1.104.7082
        //      ^ ^^^ ^^^^
        //      | |   +--- Commit number  (https://github.com/bkaradzic/bgfx / git rev-list --count HEAD)
        //      | +------- API version    (from https://github.com/bkaradzic/bgfx/blob/master/scripts/bgfx.idl#L4)
        //      +--------- Major revision (always 1)

Change # 1: I would create a new version number that exactly matches the bgfx version from bgfx/cci.20230216. I would add bgfx/1.118.8429 which has the same git sha and download link. This is so users of bgfx/cci.20230216 can migrate to the bgfx version syntax without needing to update their projects beyond that.

Change # 2: I would do the same thing for bimg, but the version number would only be the commit number as there is no API version or noted major revision number for the bimg project. I would add bimg/356 which matches exactly with the existing bimg/cci.20230114. (this is done with the same process as bgfx using git rev-list --count HEAD)

Change # 3: Unfortunately, the existing version bx in the index is bx/cci.20221116 which does not line up with the latest at the time bgfx/cci.20230216 was created, although it is close. Because of this I would create a new version bx/1847 which does line up with that version and can be used by bgfx/1.118.8429. As far as I can tell this should still be safe for most (if not all) users who want to migrate from bgfx/cci.20230216 to bgfx/1.118.8429, but it isn't quite as clean as I'd like.

Change # 4: I would like to make a minor syntax tweak to the bgfx recipe to make it easier for a script I made to automatically update the recipe. The slight tweak looks like this:

image

By putting the version numbers on their own newline it's a bit easier for me to automatically prepend version numbers.

Change # 5: Once the above 4 changes have been accepted and merged in: I would add the head revision of bgfx to the index.

xoorath commented 2 weeks ago

Tagging the recipes/bgfx contributors for comment: @RazielXYZ, @RazielZ, @SpaceIm, @franramirez688

Cheers

xoorath commented 2 weeks ago

There was a discussion about versioning bx and bimg in the bgfx discord here that may be of interest: https://discord.com/channels/712512073522872352/712512073522872355/1251747602299359282

I am also discussing in the cpplang slack #conan channel about best practices WRT breaking apart or consolidating packages: https://cpplang.slack.com/archives/C41CWV9HA/p1718512818727179

I don't think those discussions impact the changes I'm suggesting here yet, but I think it might change what comes after making the version numbers more consistent.

AbrilRBS commented 2 weeks ago

As per change #4, ideally we would move those mappings to the conandata.yml file under bx_version_mappings/bimg_version_mapping (or similar key), with the structure:

bx_version_mappings:
   "cci.20230216": "cci.20221116"

etc

(And access them with self.conan_data["bx_version_mappings"][self.version]) This way changes in the mapping for unrelated versions do not trigger a new revision and subsequent compilations (As we run a trim_conandata() hook, docs here)

(Again, thanks a lot for taking the time to update these recipes, we really appreciate it!)

RazielXYZ commented 2 weeks ago

We're also considering and testing consolidating bx and bimg into just bgfx' recipe/package instead of carrying on with them as separate. Any input on if that would be preferable is welcome as well!