From 0b66a106e3a30a3e751a1e71765ad281f23c33a6 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 16 May 2019 10:42:56 -0700 Subject: coredata: fix bugs reading PKG_CONFIG_PATH There are two distinct bugs here: 1) if PKG_CONFIG_PATH is unset then the variable will be set to [''], which causes it to have the wrong behavior in some truthiness tests 2) We read PKG_CONFIG_PATH on invocations after the first, which causes it to overwrite the value saved into the coredata.dat file. Putting the two bugs together it means that -Dpkg_config_path doesn't work with `meson configure` --- mesonbuild/coredata.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index b8f0578..6c357ce 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -510,8 +510,11 @@ class CoreData: # Some options default to environment variables if they are # unset, set those now. These will either be overwritten - # below, or they won't. - options['pkg_config_path'] = os.environ.get('PKG_CONFIG_PATH', '').split(':') + # below, or they won't. These should only be set on the first run. + if env.first_invocation: + p_env = os.environ.get('PKG_CONFIG_PATH') + if p_env: + options['pkg_config_path'] = p_env.split(':') for k, v in env.cmd_line_options.items(): if subproject: -- cgit v1.1