diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-11-24 17:49:12 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-11-24 17:49:12 +0200 |
commit | 06c7cef26ebe8b34658791adf4d6e7fcd02b173b (patch) | |
tree | c4b0e2fb370d9f86f500158ccd2efa60d710abee | |
parent | 1caf7e6f4a6896ba46278ef3f2b5249355e2b293 (diff) | |
download | meson-06c7cef26ebe8b34658791adf4d6e7fcd02b173b.zip meson-06c7cef26ebe8b34658791adf4d6e7fcd02b173b.tar.gz meson-06c7cef26ebe8b34658791adf4d6e7fcd02b173b.tar.bz2 |
Do not cache paths of found external libraries. Closes #312.
-rw-r--r-- | coredata.py | 1 | ||||
-rw-r--r-- | interpreter.py | 12 |
2 files changed, 8 insertions, 5 deletions
diff --git a/coredata.py b/coredata.py index 3c7744f..5bbb439 100644 --- a/coredata.py +++ b/coredata.py @@ -155,7 +155,6 @@ class CoreData(): self.cross_compilers = {} self.deps = {} self.ext_progs = {} - self.ext_libs = {} self.modules = {} def init_builtins(self, options): diff --git a/interpreter.py b/interpreter.py index cb29c16..3da71a1 100644 --- a/interpreter.py +++ b/interpreter.py @@ -1527,9 +1527,14 @@ class Interpreter(): if not isinstance(required, bool): raise InvalidArguments('"required" argument must be a boolean.') libname = args[0] - if libname in self.coredata.ext_libs and\ - self.coredata.ext_libs[libname].found(): - return ExternalLibraryHolder(self.coredata.ext_libs[libname]) + # We do not cache found libraries because they can come + # and go between invocations wildly. As an example we + # may find the 64 bit version but need instead the 32 bit + # one that is not installed. If we cache the found path + # then we will never found the new one if it get installed. + # This causes a bit of a slowdown as libraries are rechecked + # on every regen, but since it is a fast operation it should be + # ok. if 'dirs' in kwargs: search_dirs = kwargs['dirs'] if not isinstance(search_dirs, list): @@ -1544,7 +1549,6 @@ class Interpreter(): result = self.environment.find_library(libname, search_dirs) extlib = dependencies.ExternalLibrary(libname, result) libobj = ExternalLibraryHolder(extlib) - self.coredata.ext_libs[libname] = extlib if required and not libobj.found(): raise InvalidArguments('External library "%s" not found.' % libname) return libobj |