summaryrefslogtreecommitdiff
path: root/mesonbuild/msubprojects.py
Commit message (Collapse)AuthorAgeFilesLines
* msubprojects: Ignore worktrees when checking outNirbheek Chauhan2020-12-071-1/+1
| | | | | | | | | Otherwise it's not possible to share git subprojects via worktrees when creating a worktree of a git repository that uses meson subprojects. The downside is that the user needs to be careful while adding commits to each tree's index.
* use real pathlib moduleDylan Baker2020-11-201-1/+1
| | | | | We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
* Merge wraps from subprojects into wraps from main projectXavier Claessens2020-10-131-1/+1
| | | | | | | | | | | | | wraps from subprojects are now merged into the list of wraps from main project, so they can be used to download dependencies of dependencies instead of having to promote wraps manually. If multiple projects provides the same wrap file, the first one to be configured wins. This also fix usage of sub-subproject that don't have wrap files. We can now configure B when its source tree is at `subprojects/A/subprojects/B/`. This has the implication that we cannot assume that subproject "foo" is at `self.subproject_dir / 'foo'` any more.
* msubprojects: Handle wrap-file to wrap-git caseXavier Claessens2020-10-131-18/+34
|
* msubprojects: Handle change of URL in wrap-gitXavier Claessens2020-10-131-3/+25
|
* pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger2020-10-041-1/+1
|
* msubprojects: Fix unit tests on WindowsXavier Claessens2020-09-181-1/+2
|
* msubprojects: Revert back to rev-parse instead of --show-currentXavier Claessens2020-09-181-1/+3
| | | | | It is undocumented in manpage, but --show-current is new in git 2.22 which is too recent for distros we want to support like Ubuntu 18.04.
* msubprojects: Stop trying to guess subproject typeXavier Claessens2020-09-181-3/+3
| | | | | | | | It was done to include them in `meson subprojects foreach` without --types argument, but it's better to special case missing --types and include wraps that have type=None too. It was a bad idea because that was messing them in `meson subprojects update`, now they are ignored by that command.
* msubprojects: Avoid useless "no local changes to save" messageXavier Claessens2020-09-181-3/+7
|
* msubprojects: Fix checkout of new tag/branchXavier Claessens2020-09-181-4/+9
| | | | | | If revision is a tag that does not exist locally, `git fetch origin <revision>` won't create it and checkout will fail. Using --refmap ensures that references exists locally.
* msubprojects: Fix --types default valueXavier Claessens2020-09-181-3/+5
|
* msubprojects: Allow comma separated list of typesXavier Claessens2020-09-101-6/+9
|
* msubprojects: Fix review commentsXavier Claessens2020-09-101-2/+8
|
* git: Use Popen_safe to avoid encoding issuesXavier Claessens2020-09-101-22/+23
|
* msubprojects: Rework update commandXavier Claessens2020-09-101-52/+96
| | | | | | | | | | | | | | | Besides refactoring code into smaller functions: - Makes the --rebase behaviour the default for consistency: it was already rebasing when current branch and revision are the same, it is less confusing to rebase when they are different too. - Add --reset mode that checkout the new branch and hard reset that branch to remote commit. This new mode guarantees that every subproject are exactly at the wrap's revision. - Local changes are always stashed first to avoid any data loss. In the worst case scenario the user can always check reflog and stash list to rollback. Fixes: #7526
* msubprojects: Return failure if some commands failedXavier Claessens2020-09-101-23/+39
| | | | | | | If the command fails on some subprojects continue with the rest but return non-0 code. This is useful for CI scripts to ensure it tests latest code instead of old cached code in case of network error or something.
* msubprojects: Stash changes before checkoutXavier Claessens2020-09-101-0/+3
|
* msubprojects: Support git subprojects with no wrap fileXavier Claessens2020-09-101-0/+7
| | | | User could have cloned manually a subproject.
* msubprojects: Use less cryptic "git branch --show-current" commandXavier Claessens2020-09-101-3/+3
| | | | It describes well what it does, compared to obscure "rev-parse".
* msubprojects: Add --type argumentXavier Claessens2020-09-101-0/+5
| | | | | It is often desired to only update git repositories and not pull files from wrapdb.
* msubprojects: Use wrap.Resolver() to load all PackageDefinitionXavier Claessens2020-09-101-21/+16
| | | | | Besides being simpler, it has the advantage of picking directories that don't have a .wrap file assotiated.
* Cherry-picking - (rm python2 % add python3 .format) (#6725)Michael Brockus2020-03-031-5/+5
|
* msubprojects: We return a string from git() nowNirbheek Chauhan2020-02-201-4/+4
| | | | Fixes https://github.com/mesonbuild/meson/issues/6651
* Move git helper out into mesonlib for reuseNirbheek Chauhan2020-01-221-7/+3
| | | | | | Reuse the git helper for `meson wrap` and `meson subprojects` so we don't need to maintain the same git-colors-on-windows workarounds in multiple places.
* msubprojects: Rename 'git' to 'git_output'Nirbheek Chauhan2020-01-221-10/+10
| | | | | No functional changes. Split out from the next commit for ease of reading.
* Fix 'meson subprojects foreach' when command returns non-zero exit codeAntonio Ospite2019-12-051-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'output' field of the subprocess.CalledProcessError exception is valid only when subprocess.check_output() is called, trying to access it after calling subprocess.check_call() results in an unwanted exception when commands return non-zero exit code, e.g.: ----------------------------------------------------------------------- $ meson subprojects foreach false Executing command in ./subprojects/sqlite-amalgamation-3250100 -> Not downloaded yet Executing command in ./subprojects/gstreamer Traceback (most recent call last): File "/home/ao2/meson/meson/mesonbuild/msubprojects.py", line 177, in foreach subprocess.check_call([options.command] + options.args, cwd=repo_dir) File "/usr/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['false']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ao2/meson/meson/mesonbuild/mesonmain.py", line 129, in run return options.run_func(options) File "/home/ao2/meson/meson/mesonbuild/msubprojects.py", line 248, in run options.subprojects_func(wrap, repo_dir, options) File "/home/ao2/meson/meson/mesonbuild/msubprojects.py", line 180, in foreach out = e.output.decode().strip() AttributeError: 'NoneType' object has no attribute 'decode' ----------------------------------------------------------------------- Use subprocess.check_output() instead and behave more like git commands in handling stderr. This makes it possible to actually run commands on all subprojects allowing them to fail on some subprojects and succeed on others. Also catch the case of missing commands and print an error message in this case as well.
* wrap: Redirect stdin to DEVNULL (again)Nirbheek Chauhan2019-11-281-0/+4
| | | | | Same fix as e7b25018c4715e538234d4ba51e32194b4757388, was accidentally missed when this code was rewritten.
* cmake: moved subprojects into the CMake moduleDaniel Mensinger2019-06-061-1/+1
|
* subproject: fix update_svnMarkus Theil2019-06-031-1/+1
| | | | Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
* Add 'meson subprojects foreach' commandAntonio Ospite2019-04-011-7/+30
| | | | | | | | | | | Sometimes it is convenient to run an arbitrary command (e.g. 'git diff') on all subprojects. Add a 'meson subprojects foreach' command to take care of that. For this command the common argument 'subprojects' does not make sense, so only add '--sourcedir' and cover the case of a missing options.subprojects in run().
* Fix git wraps with submodulesAndrei Alexeyev2019-03-111-1/+1
| | | | | | | * If clone-recursive is specified, populate submodules only after the specified revision/branch has been checked out. Fixes #4996 * Update submodules recursively on `meson subprojects update`
* Add 'meson subprojects download' commandXavier Claessens2018-12-021-1/+19
|
* Add 'meson subprojects checkout' commandXavier Claessens2018-12-021-32/+61
|
* Add 'meson subprojects update' commandXavier Claessens2018-12-021-0/+179
This is inspired by gst-build's git-update script.