On systems that do not follow the Filesystem Hierarchy Standard, such as
guix, the hardcoded `/bin/pwd` will fail to be found so that the script
will fail.
Use `pwd`, instead, so that the command can be found through the normal
path search mechanism.
Change-Id: I519d535bcaf53119c8800cc5545da9a0e48e677a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
And bail out with proper warning if cmake is missing
Change-Id: I39a9e340f873f8de05264d57b2a80fb754b30fbe
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>
The cloned submodules had a wrong origin remote URL if the origin remote
of the local qt5.git repository had a trailing slash.
Fix this by stripping the trailing slash when stripping the trailing
".git" from qt5.git's remote.
Pick-to: 6.5 6.6
Fixes: QTBUG-113793
Change-Id: I199b6e1915f67558ecfe69f7300d0f9ef0d4b232
Reviewed-by: Alexandru Croitor (OOO) <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When qtrepotools is absent from --module-subset, Git hooks cannot be
installed. Emit a warning in this case.
Change-Id: I7c53b8c2817f72dbdc2b813dd18c8f63061a00c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
This is in line with e.g. qtbase. Also remove outdated/unreferenced
license files.
Pick-to: 6.3
Change-Id: I5d3370ab453610f9c8165ff9e57db7ad4a785370
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
If submodule url is absolute, don't use mirror, don't set
remote.gerrit.url and remote.gerrit.fetch.
To avoid error when passing "--mirror git://github.com/qt/":
fatal: remote error: qt/https://code.qt.io/playground/qlitehtml
is not a valid repository name
Visit https://support.github.com/ for help
amends 7374ef8e38b6b47589ff4f2977f102fc63ab3d72
Change-Id: Ifb4e1c8de57c7729f2965c16388f1acd763a150f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This is needed for qttools.
Fixes: QTBUG-93850
Change-Id: I59a7f8a56d8d7143521b67d0c385150e62338209
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
There's no mention of additionalLibrary status.
Pick-to: 6.1 6.0
Change-Id: I3ebf8fdc6dcfc01392b1ab5a42734cef81d6fc61
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This fixes the warning 'Useless use of a constant ("qt5") in void
context at ./init-repository line 649.'
Pick-to: 6.1 6.0 5.15
Change-Id: I12133b30b504e536eaf68e4260df5aed28543eb6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Introducing additionalLibrary to .gitmodules
broke init-repository. Add the new state also
here.
Task-number: QTBUG-90669
Pick-to: 6.1
Change-Id: I3ac9960427ef2fd8fe39b508b69459f4fcf81ca7
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Do set correct --alternates argument for sub-submodules like
qtwebengine/src/3rdparty. So far these repositories were always
fully cloned from remote (or the mirror).
Fixes: QTBUG-61901
Change-Id: I19f5930a03ab9050b6e62ac5a5c78780d0544e03
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
otherwise abuse may go unnoticed (at this stage ...).
Change-Id: Ic8c2a843a941cdeb2d69542830eccf7fadcf252d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
changed submodule sha1s should not prevent updating.
Change-Id: Ibd4480bed91de2a04719c32c95a4c603eda4c44b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
after 8c0390143, we cannot rely on the denormalized segment starting
with a slash any more.
Task-number: QTBUG-59753
Change-Id: Ia3a3c005d1f41320747a60efc48a180caa88206b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Valentin Fokin <fokinv@inf.u-szeged.hu>
when used without the --branch option, we clone with --no-checkout, to
avoid unnecessarily checking out files twice when the recorded sha1
doesn't happen to be the tip of the default branch. however, that would
leave the index in a dirty state which would make the subsequent
submodule update abort at some point, silently.
to deal with the problem, we ignore this type of index dirtyness and use
submodule update with --force.
Task-number: QTBUG-57289
Change-Id: I6fc9693b0eaadfb04d2d80f9c8f1f2e11be47ae9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
the operation would later error out anyway, after spending a lot of time
fetching the remotes, and leaving a partially updated state behind.
Change-Id: Ib2a688e446a9bd4ba3b15fc73082224433c18388
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I7ebf3c46088e193c8f4605532c1f4a1b6d62d230
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
there is no point in re-fetching all repositories just because an update
failed due to local modifications.
Change-Id: Ie9883586d77f3310058353844f0bbcfb0b775ebb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
the .gitmodules of tagged commits typically refers to a release branch
which was deleted shortly after the release. consequently, git clone
--branch is bound to fail.
of course, cloning a fixed sha1/tag requires no branch in the first
place, so revert back to using git clone --no-checkout in that case.
amends ac6168c0c.
Task-number: QTBUG-49133
Change-Id: Ica032f1d07a70ad89f16b23bdf5cdab785612fdc
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Previously we expected gitdir to be always absolute. This patch fixes
git_install_hooks in case of relative gitdir.
Change-Id: Ia0883af18229703aaa22c62fd2181ed56d9f2fce
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
another thing the doc claims to be possible - also quite reasonably.
Change-Id: I2220245b10f02a778345b6549e345b2486630ffd
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
the doc - quite reasonably - claims that it is possible.
Change-Id: I4668b3feafe721f1db4deb65848206d8197962c8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Introduce new "deprecated" value for status attribute.
We have two flavors of big source packages we need to produce:
qt-everywhere-* which needs to include:
- essential
- addon
- preview
- deprecated (e.g. qtscript and qtenginio for Qt5.6 release)
Installer only specific source package:
- essential
- addon
The rest (deprecated, preview, ...) need to be shown as split src
packages in the installer.
The above leads to the following changes:
qtscript: addon -> deprecated
Needs to be part of big src packages but excluded from installer
specific big source package.
qtenginio: obsolete -> deprecated
We can't exclude this module from qt-everywhere src packages.
qtwayland: preview -> addon
Needs to be part of installer specific big src package and the
module status is not preview anymore.
Change-Id: I52e10629bf81860f56ebc4ce9d395e0ca54c4264
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
the primary purpose of this change is making it work with new-style
submodules (1.7+) and git-worktree (2.5+). this means resolving '.git'
and 'commondir' files.
we avoid calling git commands, because a) it's slow on windows, b) some
of them are unavailable in older git versions and it's tedious to deal
with that and c) their output is not necessarily optimal (not always
absolute paths).
we also don't use relative paths for the hook locations any more, as
that's too tedious to deal with.
Change-Id: Ie341e748e56d6bef40856e4a49ac368850028d83
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
instead of a simple bool, we now have five states: preview, active,
addon, obsolete, and ignore (the default). the default includes the
first three.
the CI system is expected to use --module-subset=all,-ignore to include
everything that is expected to build (in some configurations).
Change-Id: Ifb43412054a8e42db0425f24f8e53acfce363caa
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This caught me out the first time I tried to use init-repository.
Documentation should work for noobs.
Change-Id: Ia6c9ce395ace034128bfe80f2c31be7f9cd4cf35
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
QtWebkit (and QtWebkit-Examples) were deprecated in Qt 5.5 and will now
be removed from qt5.git in Qt5.6 release
Change-Id: I86e1072141956136fa5e4220cdcdf812492453b3
Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
When cloning qtdeclarative, we end up also cloning qtdeclarative-testsuites,
which is not intentional for users of Qt (and init-repository). The init-repository
script checks for the submodule "repo".update key and skips the sub module if the value
is "ignore". However according to the documentation no checkout is to be done if the value
is "none", which is also what qtdeclarative's .gitmodules specifies for the ecmascript
test suite.
Change-Id: Ieb37607ae4ea7c32d6af886d3e2533fb9dea1f13
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
git submodule update does not cause an actual checkout if HEAD matches
the recorded submodule sha1 even if it was not actually checked out.
it would be possible to work around this by calling git checkout HEAD in
each submodule if no files are checked out, but that seems hacky.
instead, just make the module cloning already check out the desired
branch. this produces checkouts that are within a few commits of the
final sha1, so isn't too bad.
Change-Id: I435c1a2e24f39fd8c0d65f0d90df0216715668b7
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Change-Id: Ieb3be34b0d4061fb8dc886991528951f59dbd67e
Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
we already did it a moment ago.
this should affect only the --remote case, but there is no harm in
always specifying it.
Change-Id: I3ef0854c790726772fb63ab7829b59ef85ac4f18
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
we will subsequently do a submodule update with a possibly different
sha1 anyway.
Change-Id: I4950f3727e4263a73c32eff8460962d5796bc5f3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
it is in no way said that the remote's HEAD will contain the commit to
be checked out - in fact, it's pretty much guaranteed that it won't for
anything but the default branch. fetching the whole remote avoids
additional roundtrips and makes the --branch feature actually work
reasonably.
Change-Id: I20de2da848b12aea8c5b2784307fe9860252009b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
a submodule update with --remote will use the tip of the remote's
branch, but it won't actually switch to the branch if HEAD doesn't point
to it yet.
Change-Id: If13e31da2646683dfb9e832eaab929190acb0167
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
clearly, i botched the syntax, but i can't even tell how. that's perl.
the new version is more readable anyway.
Change-Id: Ic3e93c2cf30ee92f368808070899af4b9f7809a3
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
it's just wasting time.
Change-Id: I541cc535c5c95b0140cfa14d7cb042dbe029525e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Commit 486f5f37761 broke the cloning with one of the mirror options:
git ls-remote git://mirror/qt/qtactiveqt.git.git test/if/mirror/exists
fatal: The remote end hung up unexpectedly
Change-Id: Ia154ee34dd10e35b24676777d8dde98ef0790ee1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>