mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.64k stars 1.64k forks source link

need a tool to change all revision of subprojects to current git head #7238

Open braindevices opened 4 years ago

braindevices commented 4 years ago

In some projects the wrap file revision is: master, develop or some other branches which actually in progress constantly. When we are working on those projects, every single clone can be different from each other. In many cases for example create a release branch or tag, we need to change the revision to an actual commit/tag. Currently I need to manually change it. If there are many subprojects this can be very tedious and error prone. If we create a meson command like meson subprojects freeze, which automatically detect the current commits/tags of local subprojects then change the wrap's revisions to them, it would be very helpful.

What do you think?

maj0e commented 1 week ago

This is an old issue, but I am interested in such a mechanism as well.

At work, most of our applications have half a dozen subprojects, which are checked out at "master" or some LST branches. For reproducibility, it would be great to have a "lock" mechanism like Rust's "cargo.lock", Julia's "Manifest.toml" or nix's "flake.lock".

For meson I could imagine something like this: A "meson.lock" file, located in the subprojects folder, would contain the exact commit of all dependencies. It is either always generated, when the subprojects change, e.g. on meson subprojects update or on first meson setup builddir, or it could be only created by a command as suggested above: meson subprojects freeze.

A complementary command, e.g. meson subprojects instantiate, would then allow to set the subprojects to their locked version. This gets you the reproducibility benefits of version pinning without the downsides (because it is opt-in).