diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-25 06:32:26 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-25 06:57:30 +0530 |
commit | d5975cc683f5c03a2060ee28bb467732909cfb97 (patch) | |
tree | 30d218f94a2fa94eadfd6326ceeb042becb0c592 /mesonbuild/interpreter.py | |
parent | a60d688973e8903015f6e4b157332c5c98562f55 (diff) | |
download | meson-d5975cc683f5c03a2060ee28bb467732909cfb97.zip meson-d5975cc683f5c03a2060ee28bb467732909cfb97.tar.gz meson-d5975cc683f5c03a2060ee28bb467732909cfb97.tar.bz2 |
wrap: Implement special wrap modes for use by packagers
Special wrap modes:
nofallback: Don't download wraps for dependency() fallbacks
nodownload: Don't download wraps for all subproject() calls
Subprojects are used for two purposes:
1. To download and build dependencies by using .wrap files if they
are not provided by the system. This is usually expressed via
dependency(..., fallback: ...).
2. To download and build 'copylibs' which are meant to be used by
copying into your project. This is always done with an explicit
subproject() call.
--wrap-mode=nofallback will never do (1)
--wrap-mode=nodownload will do neither (1) nor (2)
If you are building from a release tarball, you should be able to
safely use 'nodownload' since upstream is expected to ship all
required sources with the tarball.
If you are building from a git repository, you will want to use
'nofallback' so that any 'copylib' wraps will be download as
subprojects.
Note that these options do not affect subprojects that are git
submodules since those are only usable in git repositories, and you
almost always want to download them.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index f9c1579..6e8cf1a 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -20,7 +20,7 @@ from . import mlog from . import build from . import optinterpreter from . import compilers -from .wrap import wrap +from .wrap import wrap, WrapMode from . import mesonlib from .mesonlib import FileMode, Popen_safe from .dependencies import InternalDependency, Dependency @@ -1499,7 +1499,7 @@ class Interpreter(InterpreterBase): if dirname in self.subprojects: return self.subprojects[dirname] subproject_dir_abs = os.path.join(self.environment.get_source_dir(), self.subproject_dir) - r = wrap.Resolver(subproject_dir_abs) + r = wrap.Resolver(subproject_dir_abs, self.coredata.wrap_mode) try: resolved = r.resolve(dirname) except RuntimeError as e: @@ -1911,6 +1911,11 @@ requirements use the version keyword argument instead.''') return fbinfo def dependency_fallback(self, name, kwargs): + if self.coredata.wrap_mode in (WrapMode.nofallback, WrapMode.nodownload): + mlog.log('Not looking for a fallback subproject for the dependency', + mlog.bold(name), 'because:\nAutomatic wrap-based fallback ' + 'dependency downloading is disabled.') + return None dirname, varname = self.get_subproject_infos(kwargs) # Try to execute the subproject try: |