The QtSynchronizeRepo.cmake script, which is meant to be driven by a
git-sync-to script, has been rewritten to support more use cases, as
well as improve the code readability and error reporting.
The script now supports the following additional use cases:
- Clone a specified qt/{repo} submodule from code.qt.io into the
current directory, and initialize (clone) its dependencies
- Initialize a submodule and its dependencies in an existing qt5.git
super repo. This is similar to what init-repository does, except
instead of using the qt5.git sha1s, it uses the dependencies.yaml
of the specified submodule
- Support for git fetch --depth, to allow shallow cloning of the
specified submodule and its dependencies. This is useful for CI
where only a specific revision needs to be checked out.
The main incentive for this change is allow cloning qttools/dev/HEAD
and its dependencies in a CI run, but it's useful for daily work as
well. At some point we should check what can be merged together with
the existing init-repository script.
Pick-to: 6.8
Task-number: QTBUG-128730
Change-Id: Ie6d49d253223cc93b8831ef41d25e0adeac39b8b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Developers that use a top-level qt5.git can use git submodule foreach
to run commands for each submodule. That is not available to
developers that maintain their own non-submodule based top-level
checkout using git worktrees.
Extend the QtSynchronizeRepo.cmake script that allows to sync
submodules / worktrees to also allow running foreach commands.
The CMake invocation to run a foreach would look like
cmake -DQT_FOREACH=TRUE "-DARGS=git pull -r" -P
cmake/QtSynchronizeRepo.cmake
But it's nicer to create a git-qt-foreach script in
/usr/local/bin/git-qt-foreach with the following contents
cmake -DQT_FOREACH=TRUE "-DARGS=$*" -P cmake/QtSynchronizeRepo.cmake
Make sure to chmod a+x it and invoke like
git qt-foreach git pull -r
Change-Id: I0ccd67facbfe702c6a872165cdfd9f9e6eae9043
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In certain cases the dependency resolution between Qt repositories
resulted in a wrong order, for example qtsvg being handled before
qtbase. See the linked task for an example.
Replace the existing algorithm with a post-order traversal of the
dependency graph to produce a topological ordering.
Rename qt_internal_add_module_dependencies to
qt_internal_resolve_module_dependencies and remove unnecessary
positional arguments. Use keyword arguments for a nicer API.
Raise the cmake_policy in QtSynchronizeRepo.cmake to avoid policy
warnings we now would get due to the use of IN_LIST.
Fixes: QTBUG-98268
Change-Id: I1425fd9c802fa71ae42549ceb14bcfc4c0a62078
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Make a few modifications to the dependency evaluation to include the
revision of each dependency, and a method that checks each dependency
out to the revision necessary to create a consistent set for the
requested module.
If the requested module is ".", check all modules out to the given
revision.
Can be called (ideally from a git-sync-to alias script):
cmake -DSYNC_TO_MODULE="$1" -DSYNC_TO_BRANCH="$2" \
-P cmake/QtSynchronizeRepo.cmake
Change-Id: I007e9f9023bae949907b64e264ae7869dff1da2e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>