Commit Graph

121 Commits

Author SHA1 Message Date
Xavier Claessens b7bcdb7839 wrap: sha256 digest is not case sensitive
Fixes: #8450.
2021-03-02 12:38:46 -05:00
Eli Schwartz 9d602e6531
do not require git installed in order to use wraps
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-26 08:09:53 -05:00
Jussi Pakkanen efe7270429 Do not store config parser object in Wrap object. Closes: #7920. 2021-01-17 21:04:21 +00:00
Jussi Pakkanen ca30550e06 Handle uppercase dependency names in wraps. 2020-12-30 20:54:41 +00:00
Dylan Baker f6672c7a19 use real pathlib module
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-20 15:08:40 -08:00
Dylan Baker 2bd309543f wrap: fix type annotations 2020-11-03 21:42:18 -05:00
Xavier Claessens 42cc9294e9 wrap: Fix git exception not catched by interpreter
This is a regression introduced in Meson 0.56.0, it was fatal
error when optional dependencies fails to download their fallback
subproject.
2020-11-03 21:28:32 +02:00
Jussi Pakkanen 64f8479097 In text, betterer grammer usings. 2020-10-19 00:04:14 +03:00
Xavier Claessens 3a01823786 wrap: Add 'redirect' type and use it when auto promote 2020-10-13 17:55:16 -04:00
Xavier Claessens a20d7ad67d wrap: Use sub-subproject packagefiles 2020-10-13 17:55:16 -04:00
Xavier Claessens 6333ee88c1 Merge wraps from subprojects into wraps from main project
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-13 17:55:16 -04:00
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Xavier Claessens e0cd54a322 msubprojects: Stop trying to guess subproject type
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.
2020-09-18 03:01:15 +00:00
Xavier Claessens 14c1a6983d msubprojects: Allow comma separated list of types 2020-09-10 11:39:30 -04:00
Xavier Claessens 276c3fcb5a Move verbose_git() and quiet_git() to mesonlib 2020-09-10 11:39:30 -04:00
Xavier Claessens 98d445a070 msubprojects: Support git subprojects with no wrap file
User could have cloned manually a subproject.
2020-09-10 11:39:30 -04:00
Daniel Mensinger e681235e5f
typing: fix code review 2020-09-08 20:15:58 +02:00
Daniel Mensinger 449dd8e72a
typing: fully annotate wrap 2020-09-08 20:15:56 +02:00
Xavier Claessens 2353d67c25 wrap: Raise MesonException when git command fails
This avoid printing long backtrace by default, the user already has the
output of the git command printed for debugging purpose since we don't
redirect stdout/stderr.
2020-07-14 20:49:47 +03:00
Xavier Claessens e1094df77e wrap: Add back filename member in PackageDefinition
It is still used by msubprojects.py and cause issues when updating
wrapdb.
2020-07-04 13:58:36 +03:00
Xavier Claessens 41aefd2145 wrap: Abort if multiple wraps provide the same dep or program 2020-07-01 09:51:57 -04:00
Xavier Claessens 13316f99fe wrap: Refactor to split wraps dictionary into 3 separate dicts
It makes the code cleaner to have 3 separate dictionaries for
packagename, dependency and programs.
2020-07-01 09:51:57 -04:00
Xavier Claessens fba796cf13 Fix typo: coma->comma 2020-07-01 09:51:57 -04:00
Xavier Claessens f08eed37cb find_program: Fallback if a wrap file provide the program name
We don't need the legacy variable name system as for dependency()
fallbacks because meson.override_find_program() is largely used already,
so we can just rely on it.
2020-07-01 09:51:57 -04:00
Xavier Claessens 71804e56eb wrap: Add special 'dependency_names' key in [provide] section
The value for that key must be a coma separated list of dependecy names
provided by that subproject, when no variable name is needed because the
subproject uses override_dependency().
2020-07-01 09:51:57 -04:00
Xavier Claessens 2a7f72885f wrap: Add 'provide' section 2020-07-01 09:51:44 -04:00
Xavier Claessens 4a371c97f4 wrap: Apply patch even in VCS cases 2020-06-30 19:42:43 +03:00
Eli Schwartz 33167d40a2 wrap: add user agent when downloading files
This lets servers know when they're being used by meson. It also avoids
issues where the Independent JPEG Group decided to ban the
"Python-urllib" default user agent.

Fixes https://github.com/mesonbuild/libjpeg/issues/9
2020-06-26 16:07:29 -04:00
Xavier Claessens e353b2e8d4 wrap: Add patch_directory support
Copy a tree instead of extracting an archive.

Closes: #7216
2020-06-21 23:39:12 +03:00
Daniel Mensinger ccdf7f6d34
wrap: Add support for local files via only `*_filename` 2020-04-25 11:43:42 +02:00
Xavier Claessens a6239d5100 wrap: Add fallback urls
It can happen that a server is temporaly down, tarballs often have
many mirrors available so we should be able to add at least one fallback
mirror in wrap files.
2020-04-13 13:29:33 +03:00
Xavier Claessens 5c8dbdcd38 wrap: Fix git clone with commit id in revision
Fixes: #6505.
2020-01-25 13:49:00 +05:30
Nirbheek Chauhan 712b2f08c7 Move git helper out into mesonlib for reuse
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.
2020-01-22 17:29:38 -05:00
Nirbheek Chauhan 06dddf2ef0 wrap: Re-set the console mode after calling git
`git submodule update --recursive` calls git clone recursively, and on
Windows it will undo the console mode we set in mlog and cause ANSI
colors to stop working. We could set it again only when we call that,
but we will definitely miss other instances where this could happen
in the future and regress.
2020-01-22 17:29:38 -05:00
Nirbheek Chauhan e962147d8a wrap: Redirect stdin to DEVNULL when calling git
Without this git messes up the console and ANSI colors stop working on
Windows inside cmd.exe.

This broke in https://github.com/mesonbuild/meson/pull/6139. Also add
the same to all git calls. Missed this when I opened
https://github.com/mesonbuild/meson/pull/6255
2020-01-22 17:29:38 -05:00
Nirbheek Chauhan f09056f903 wrap: Always use a wrapper for running git
We need this for the next commit.
2020-01-22 17:29:38 -05:00
Nirbheek Chauhan 7065cef62f wrap: Look for git only once at startup
No need to repeatedly call `shutil.which`.
2020-01-22 17:29:38 -05:00
Nirbheek Chauhan 2661b1bfb5 wrap: Use uppercase for global constants
This makes things much clearer and follows PEP8.
2020-01-22 17:29:38 -05:00
Xavier Claessens 711969c3b5 wrap: Fix support of file:// URLs
Fixes: #6445
2020-01-17 11:36:37 -05:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Xavier Claessens 5031f4981d dist: Fix --include-subprojects when .wrap file has directory value 2019-12-10 22:19:00 +02:00
Michael Brockus 4b69aea85d Update Python2 syntax to Python3 syntax in Wrap 2019-12-06 15:23:26 +02:00
Michael Hirsch, Ph.D d9b8dce975
wrap: check whitelist subdomain
wrap: add imposter URL test

this test shows that meson wrap subsystem historically allows
imposter URLs like https://wrapdb.mesonwrap.com.evil/v1/foo.zip
while the new code does no.
2019-12-05 23:14:13 -05:00
Michael Hirsch, Ph.D dc19768175
wrap: raise WrapException instead of Python exception when program not available 2019-12-05 23:07:18 -05:00
Michael Hirsch, Ph.D ccefc00a59
use WrapDB domain whitelist, don't fallback to non-SSL when SSL available
In my opinion, we should not fall back to http:// from the SSL HSTS WrapDB URL,
**for systems that have Python SSL** as that is controverting the point
of HSTS + SSL.

For systems that do not have Python SSL, they continue to work with a
colored mlog.warning instead of only a stderr console print.

 attempt to stop masquerade URLS containing wrapdb.mesonbuild.com.evil.stuff.com
2019-12-05 23:07:16 -05:00
Michael Hirsch, Ph.D 298299d711
doc: py35 deprecation comments 2019-12-05 22:19:28 -05:00
Daniel Mensinger e21f5959a5 lgtm: Fix insecure SSL/TLS version by removing dead code 2019-12-05 11:08:12 -05:00
Daniel Mensinger ef19e1ff2d lgtm: fix Incomplete URL substring sanitization 2019-12-05 00:22:10 +02:00
Martin Hostettler bb03cf0dbc wrap: Resolver.get_git: Factor out --depth argument generation and make sure not to pass None as parameter
507cf47507cf47 broke the combination of clone-recursive without depth.
Because it passed depth (as None) to git.

To fix this the depth option is now generated once as a list when depth is set
and else set to an empty list and unpacked into the argument this when
needed. This reduces duplication and allows code to work the same for
both cases.
2019-11-28 13:01:33 +02:00
Michael Hirsch, Ph.D d080917561 wrap.py: catch connection error with WrapException
fixes #6130

wrap: more error verbosity
2019-11-07 22:14:59 +02:00