diff options
author | Richard Samuels <richard.l.samuels@gmail.com> | 2022-04-22 17:49:50 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-22 18:17:44 +0000 |
commit | 5409de7a1771ce9e03700355a2d07e6a0045ff44 (patch) | |
tree | d940bf7990517d0f9626811b589968ee95ee3793 /site_scons | |
parent | c8e87a7de952d4dfeee3141f62dbebc6c8697187 (diff) | |
download | mongo-5409de7a1771ce9e03700355a2d07e6a0045ff44.tar.gz |
SERVER-65347 Fix scan_for_transitive_install scanned cache and flake8-bugbear B006
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/auto_install_binaries.py | 4 | ||||
-rw-r--r-- | site_scons/site_tools/distsrc.py | 8 | ||||
-rw-r--r-- | site_scons/site_tools/ninja.py | 5 |
3 files changed, 12 insertions, 5 deletions
diff --git a/site_scons/site_tools/auto_install_binaries.py b/site_scons/site_tools/auto_install_binaries.py index 38427d8ef41..acc248c5229 100644 --- a/site_scons/site_tools/auto_install_binaries.py +++ b/site_scons/site_tools/auto_install_binaries.py @@ -226,8 +226,8 @@ def scan_for_transitive_install(node, env, _path): if component is None: return [] - scanned = getattr(node.attributes, "AIB_SCANNED", []) - if scanned: + scanned = getattr(node.attributes, "AIB_SCANNED", None) + if scanned is not None: return scanned # Access directly by keys because we don't want to accidentally diff --git a/site_scons/site_tools/distsrc.py b/site_scons/site_tools/distsrc.py index 95c24c42696..95200775bfd 100644 --- a/site_scons/site_tools/distsrc.py +++ b/site_scons/site_tools/distsrc.py @@ -92,11 +92,13 @@ class DistSrcTarArchive(DistSrcArchive): self, filename, file_contents, - mtime=time.time(), + mtime=None, mode=0o644, uname="root", gname="root", ): + if mtime is None: + mtime = time.time() file_metadata = tarfile.TarInfo(name=filename) file_metadata.mtime = mtime file_metadata.mode = mode @@ -142,11 +144,13 @@ class DistSrcZipArchive(DistSrcArchive): self, filename, file_contents, - mtime=time.time(), + mtime=None, mode=0o644, uname="root", gname="root", ): + if mtime is None: + mtime = time.time() self.archive_file.writestr(filename, file_contents) def append_file(self, filename, localfile): diff --git a/site_scons/site_tools/ninja.py b/site_scons/site_tools/ninja.py index 8505ce8e7ba..0b0d3ed88bf 100644 --- a/site_scons/site_tools/ninja.py +++ b/site_scons/site_tools/ninja.py @@ -1003,9 +1003,12 @@ def get_command_env(env): return command_env -def gen_get_response_file_command(env, rule, tool, tool_is_dynamic=False, custom_env={}): +def gen_get_response_file_command(env, rule, tool, tool_is_dynamic=False, custom_env=None): """Generate a response file command provider for rule name.""" + if custom_env is None: + custom_env = {} + # If win32 using the environment with a response file command will cause # ninja to fail to create the response file. Additionally since these rules # generally are not piping through cmd.exe /c any environment variables will |