aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/wrap
AgeCommit message (Collapse)AuthorFilesLines
2022-06-13flake8: don't use f-strings for strings without formattingEli Schwartz1-1/+1
2022-06-07wrap: Add support for applying a list of patch filesPaweł Marczewski1-1/+36
Co-authored-by: Xavier Claessens <xavier.claessens@collabora.com>
2022-04-30Ignore detached head warning while cloning subprojects with tagszxey1-1/+1
2022-03-27wrap: implement allow-insecure for 'meson wrap'Eli Schwartz1-14/+27
2022-03-27wrap: use shared function to connect to wrapdb with better errorsEli Schwartz1-5/+4
We currently inconsistently handle connection, `has_ssl`, and printing errors on urlopen failure between `meson subprojects` and `meson wrap`. Make the latter work more like the former.
2022-03-27wrap: add functionality to specify whether insecure downloads should be usedEli Schwartz1-9/+26
We have a fallback route in `meson subprojects download` and friends, which tries to retrieve wrapdb urls via http, if Python was not built with SSL support. Stop doing this. Replace it with a command line option to specify that insecure downloads are wanted, and reference it in the error message if downloading fails due to SSL issues.
2022-03-07treewide: string-quote the first argument to T.castEli Schwartz1-1/+1
Using future annotations, type annotations become strings at runtime and don't impact performance. This is not possible to do with T.cast though, because it is a function argument instead of an annotation. Quote the type argument everywhere in order to have the same effect as future annotations. This also allows linters to better detect in some cases that a given import is typing-only.
2022-03-01fix missing encodingsEli Schwartz1-1/+1
These were caught by the testsuite erroring out with a fatal EncodingWarning due to the previous commit. Fixes #9996
2022-02-27wraptool: report name of wrap in status message for "not in wrapdb"Eli Schwartz1-1/+1
2022-02-27wraptool: be forgiving of local wrap filesEli Schwartz1-9/+22
Do not traceback when trying to update a wrap that isn't a [wrap-file], just report the problem. Do not traceback on perfectly valid WrapDB wraps that don't have a patch_url because they have upstream meson.build, instead try to parse the version from the source tarball filename.
2022-02-16flake8: do not use bare exceptionsEli Schwartz1-1/+1
In one case, we actually specifically want to catch IndexError only. In the other case, excepting Exception rather than BaseException is quite fine.
2022-02-14FeatureNew: add mypy type annotations for subproject argEli Schwartz1-1/+2
Use a derived type when passing `subproject` around, so that mypy knows it's actually a SubProject, not a str. This means that passing anything other than a handle to the interpreter state's subproject attribute becomes a type violation, specifically when the order of the *four* different str arguments is typoed.
2022-01-27Checkout subproject submodules even when nestedWill Toohey1-3/+8
2022-01-18wraps: implement exponential backoff for downloading filesEli Schwartz1-1/+12
Implementation modeled after mesonlib.windows_proof_rmtree(). Implements the other half of #9688
2022-01-18wraps: on failure to apply a patch, delete the subproject directoryEli Schwartz1-2/+6
This code path is only called on initial download of a subproject, but if we raise an error and abort while downloading/applying a patch overlay we still have the upstream sources extracted... which appears to be a subproject, then turns out to be broken due to missing meson.build Partially implements #9688
2022-01-10first pass at migrating to dataclassesEli Schwartz1-6/+9
In some cases, init variables that accept None as a sentinel and immediately overwrite with [], are migrated to dataclass field factories. \o/ Note: dataclasses by default cannot provide eq methods, as they then become unhashable. In the future we may wish to opt into declaring them frozen, instead/additionally.
2021-11-30Fix typo in wrap.pyRandy1-1/+1
2021-11-28Add typing to msubprojects.pyTristan Partin1-2/+2
2021-11-02wrap: Fix concurrent os.mkdir()Xavier Claessens1-2/+1
Since 0.59.0 Meson downloads multiple wraps in parallel, so the packagecache directory could be created by one then the 2nd would hit error when calling os.mkdir() because it already exists.
2021-10-27wrap: fix support for git < 2.28Eli Schwartz1-1/+1
both of these do the same thing: init -b <branchname> -c init.defaultBranch=<branchname> init The latter contributes to unreadably long lines of code, but has the advantage of working on older versions of git. Fixes #9449
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-2/+1
2021-10-15wrap: move FeatureNew checks to a more natural placeEli Schwartz1-12/+16
Now, warnings are unconditionally raised when parsing the wrap file, whether they are used or not. That being said, these warnings literally just check for a couple of keys used in the .wrap ini file. Moving these checks from the time of use to the time of loading, means that we no longer report warnings only when originally downloading or extracting the file or VCS repo. It also means we no longer report warnings in one subproject, when a wrap file is picked up from a different subproject because the first subproject actually does a dependency lookup. This caused issues for the WrapDB tooling, which uses patch_directory everywhere and the superproject requires a suitable minimum version of meson for this... but individual wraps might use a much lower version, and would then raise a warning (in strict mode, converted to an error) when it resolved a dependency from another WrapDB project. Fixes #9118
2021-10-10improve wraptool searchDaniel Jacobs1-2/+6
2021-10-04wrap clone: be less noisy when doing automated code checkoutsEli Schwartz1-4/+5
There are two possible issues, both of which emit very long messages from git: - when shallow cloning via depth + a pinned commit we locally init rather than cloning; use an almost-certainly not conflicting dummy branch name - any time a checkout of a revision is performed, it might not be a branch name, in which case it will be a detached HEAD. By default git is very noisy about this -- it wants you to know what happened and how not to mess up. But wraps aren't per default intended for user editing and development, it's just part of the internal transport which meson uses. So, temporarily squelch this advice. Do not permanently configure the repo like this though, because the user *might* cd in and start developing on the subproject; in this case, any additional git advice they trigger is their responsibility (and they probably do want it). Fixes #9318
2021-10-04condense linesEli Schwartz1-6/+3
2021-10-04f-stringsEli Schwartz1-17/+17
2021-09-03log a more informative error when wrap-git subprojects cannot be downloadedEli Schwartz1-1/+1
"ERROR: Git program not found" is both highly true, and somewhat inscrutable. Sure, looking at the line number you can basically figure out that subproject('something') must somehow need git to operate, but that may not be immediately obvious. Make mention of the fact that it is needed to "download foo.wrap". Fixes #7764
2021-08-31pylint: turn on superflous-parensDylan Baker1-1/+1
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-30wraptool: Fix version comparisonXavier Claessens1-4/+4
2021-07-03Delete redirected wrap files in subprojects purgeTristan Partin1-0/+4
We need to store the original filename as well as whether the wrap was redirected in order to properly purge the redirected wrap.
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-1/+1
2021-06-16interpreter: Extract dependency() logic into its own helper classXavier Claessens1-7/+7
The dependency lookup is a lot of complex code. This refactor it all into a single file/class outside of interpreter main class. This new design allows adding more fallbacks candidates in the future (e.g. using cc.find_library()) but does not yet add any extra API.
2021-06-04wrap: Port to v2 protocolXavier Claessens2-46/+48
Fixes: #8754.
2021-04-22Add trailing -- parameter to git checkouts.Dan1-3/+3
2021-03-29wrap: Tell which wrap-redirect file is missingSeungha Yang1-1/+1
Otherwise user cannot understand which wrap file is missing or wrong
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz2-25/+25
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz1-1/+1
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-03-02wrap: sha256 digest is not case sensitiveXavier Claessens1-2/+2
Fixes: #8450.
2021-01-26do not require git installed in order to use wrapsEli Schwartz1-1/+3
It doesn't make sense to check for the presence of git every time we use it, but short-circuit any attempt to use a wrap right from the get-go because we are trying to be fancy with submodules. If git is not installed, simply do not try to figure out whether the wrap is a submodule that can potentially be checked out/updated for the user. Just take it on faith that it isn't one. Fixes #2623
2021-01-17Do not store config parser object in Wrap object. Closes: #7920.Jussi Pakkanen1-11/+11
2020-12-30Handle uppercase dependency names in wraps.Jussi Pakkanen1-2/+5
2020-11-20use real pathlib moduleDylan Baker1-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
2020-11-03wrap: fix type annotationsDylan Baker1-2/+2
2020-11-03wrap: Fix git exception not catched by interpreterXavier Claessens1-1/+11
This is a regression introduced in Meson 0.56.0, it was fatal error when optional dependencies fails to download their fallback subproject.
2020-10-19In text, betterer grammer usings.Jussi Pakkanen1-1/+1
2020-10-13wrap: Add 'redirect' type and use it when auto promoteXavier Claessens1-13/+39
2020-10-13Add wrap mode to disable auto promoteXavier Claessens1-0/+2
2020-10-13wrap: Use sub-subproject packagefilesXavier Claessens1-5/+6
2020-10-13Merge wraps from subprojects into wraps from main projectXavier Claessens1-10/+37
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.
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger1-1/+1