summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2020-04-30 17:00:27 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-01 20:52:37 +0000
commitcffa7cad378f1cc0c7a21ec43cf4cc2ec8a5bf3f (patch)
treecf5a44863ac4f475ced24f9d83967b2ab161d509 /site_scons
parentf0fd129b5a9df4db2d6800f20773c878da36af1b (diff)
downloadmongo-cffa7cad378f1cc0c7a21ec43cf4cc2ec8a5bf3f.tar.gz
SERVER-47865 Fix invalid subst where a variable was passed where a node is required
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/auto_install_binaries.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/site_scons/site_tools/auto_install_binaries.py b/site_scons/site_tools/auto_install_binaries.py
index a3e7290c0a1..34955be7767 100644
--- a/site_scons/site_tools/auto_install_binaries.py
+++ b/site_scons/site_tools/auto_install_binaries.py
@@ -393,8 +393,14 @@ def auto_install_pseudobuilder(env, target, source, **kwargs):
continue
# We must do an early subst here so that the _aib_debugdir
- # generator has a chance to run while seeing 'source'.
- target_for_source = env.Dir(env.subst('$DESTDIR/$TARGET', target=target_for_source, source=s))
+ # generator has a chance to run while seeing 'source'. We need
+ # to do two substs here. The first is to expand an variables
+ # in `target_for_source` while we can see `source`. This is
+ # needed for things like _aib_debugdir. Then, we need to do a
+ # second subst to expand DESTDIR, interpolating
+ # `target_for_source` in as $TARGET. Yes, this is confusing.
+ target_for_source = env.subst(target_for_source, source=s)
+ target_for_source = env.Dir(env.subst('$DESTDIR/$TARGET', target=target_for_source))
aib_additional_directory = getattr(s.attributes, "aib_additional_directory", None)
if aib_additional_directory is not None: