These test helpers are moved to qtbase submodule.
Change-Id: If8aa31fe1d9a93f2667249abd90ae9b8cb81d07a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Ensure the coma-separated argument is transformed to CMake list
properly.
Amends 7c8bab37bb792086f38d704f37bc8b712311d0f7
Pick-to: 6.8
Task-number: QTBUG-122954
Change-Id: I082ad2c9c964c66feee3a8deff55ae137adafe8b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When evaluating the arguments from the config.tl.opt file we need
to consider that arguments may contain the escaped semicolons for
the list arguments. The escaped semicolons '\;' needs to be converted
to a CMake brace escaped sequence to make sure that semicolon persist
when running the command.
Fixes: QTBUG-124265
Change-Id: I051f856b43f75b0bac17ae13bd8c7de540f8c794
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The -help option was parsed by init-repository and not passed along
to configure. Make sure to pass it.
Currently this means a developer won't be able to see the
init-repository help when using the configure script.
Task-number: QTBUG-120030
Change-Id: I5d8c0f9147e1fcd5522ab98ad9ab0947a8411d1a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Make sure that -submodules argument is processed when we assume that
the top-level Qt meta repository is already initialized.
Amends 2c9664ca33d2ed3d8236c865a489c9e7c5885f68
Fixes: QTBUG-122954
Change-Id: Id7a325c2dd670667e8b0fdcd607b52080b118f4f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Calling configure will now implicitly run init-repository when
appropriate. See further down below for what "appropriate" means.
All supported init-repository options can be passed to configure as
except for -mirror, -oslo, -berlin.
This includes useful options like -submodules, -no-resolve-deps and
-no-optional-deps.
When running configure on a qt5.git clone without any submodules
cloned, configure will exit with a helpful error message suggesting to
pass -init-submodules, so it automatically clones missing repositories.
This means cloning is opt-in, so that internet access is not done
implicitly.
The error message also suggests passing the -submodules option.
This will affect which submodules will be cloned by init-repository
and which submodules will be configured by configure.
In this case -submodules is effectively an alias of
init-repository's -module-subset for cloning purposes.
When calling configure a second time, without -init-submodules, on an
already configured repo, init-repository behavior is entirely skipped.
-submodules now accepts init-repository-style special values like
"essential", "addon", "all", "existing", "-deprecated" for the purpose
of cloning submodules. The values are then translated into actual repos
that should also be configured or skipped by configure.
The default subset of cloned submodules is currently the same one as
init-repository, "default", which clones 44 actively maintained
repositories as well as deprecated submodules.
If configure is called a second time WITH -init-submodules, it's the
same as calling init-repository --force to re-initialize submodules.
In this case passing something like
--submodules existing,<additional-submodules>
might make sense to add or remove submodules.
As a drive-by this also fixes the bug where you couldn't pass a
configure -- -DFOO=0
parameter to configure, because it got treated as '0>', redirecting
from a different stream than stdout, leading to empty content in the
file.
[ChangeLog][General][Build System] The configure script now implicitly
calls init-repository when appropriate and accepts init-repository
command line options.
Fixes: QTBUG-120030
Task-number: QTBUG-122622
Change-Id: Iedbfcbf0a87c8ee89e40d00b6377b68296a65a62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The new test uses the recently introduced upstream cmake test
infrastructure module, to ensure the execution log output is identical
between the old perl script and new the cmake script for a few basic
use cases. It is not an exhaustive test of all features. It should
work on Windows, macOS, Linux (assuming perl is installed).
There are also a few tests that only apply to the cmake-script
version for features that exist only in the latter (like the 'existing'
module-subset key).
The test is a 'manual' test instead of an 'auto' test because we don't
really want to clone so many submodules as part of every qt5.git
integration in Coin.
In the future, we could potentially add a nightly Jenkins job to run
the tests.
Task-number: QTBUG-120030
Change-Id: I4201d734c2877109102518b073dec24bb63edc24
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
init-repository is now implemented using CMake + .sh / .bat scripts.
The intent behind the change is not to require Perl to checkout and
build Qt, because it can be troublesome to acquire on Windows and it
can also lead to issues during builds due to CMake picking up a Perl
distribution-shipped compiler.
All previous options were ported over like
- module-subset
- alternates
- etc.
A few new options were added:
- --resolve-deps / --no-resolve-deps
- --optional-deps / --no-optional-deps
- --verbose
and some other internal ones for testing reasons.
The new script does automatic resolving of dependencies
based on the depends / recommends keys in .gitmodules unless
--no-resolve-deps is passed.
So if you configure with --module-subset=qtsvg, the script will also
initialize qtbase.
If --no-optional-deps is passed, only required dependencies ('depends'
ky) will be included and optional dependencies ('recommends' key) will
be excluded.
The new script now has a new default behavior when calling
init-repository a second time with --force, without specifying a
--module-subset option. Instead of initializing all submodules, it
will just update the existing / previously initialized submodules.
It also understands a new module-subset keyword "existing", which
expands to the previously initialized submodules, so someone can
initialize an additional submodule by calling
init-repository -f --module-subset=existing,qtsvg
Implementation notes:
The overall code flow is init-repository -> cmake/QtIRScript.cmake
-> qt_ir_run_main_script -> qt_ir_run_after_args_parsed ->
qt_ir_handle_init_submodules (recursive) -> qt_ir_clone_one_submodule
with some bells and whistles on the side.
The command line parsing is an adapted copy of the functions
in qtbase/cmake/QtProcessConfigureArgs.cmake. We can't use those exact
functions because qtbase is not available when init-repository is
initially called, and force cloning qtbase was deemed undesirable.
We also have a new mechanism to detect whether init-repository was
previously called. The perl script used the existence of the qtbase
submodule as the check. In the cmake script, we instead set a custom
marker into the local repo config file.
Otherwise the code logic should be a faithful reimplementation of
init-repository.pl aside from some small things like logging and
progress reporting.
The pre-existing git cloning logic in QtTopLevelHelpers was not used
because it would not be compatible with the alternates option and I
didn't want to accidentally break the pre-existing code. Plus
init-repository is a bit opinionated about how it clones and checks
out repos.
The dependency collection and sorting logic uses the pre-existing code
though.
See follow up commit about implicitly calling init-repository when
qt5/configure is called and the repo was not initialized before.
[ChangeLog][General] init-repository was rewritten using CMake. Perl
is no longer required to initialize the qt5.git super repo.
Task-number: QTBUG-120030
Task-number: QTBUG-122622
Change-Id: Ibc38ab79d3fdedd62111ebbec496eabd64c20d2b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>