# HG changeset patch
# User Nathan Froyd <froydnj@mozilla.com>
# Date 1591823220 0
# Node ID 7bc89fd272217c7a94ae32184c1d9c99f78e1bd4
# Parent  167519caa6fea866d42b3ec4818255df816dcf13
Bug 1642032 - ignore d3dcompiler_47.dll in dependentlibs determination; r=firefox-build-system-reviewers,rstewart

We moved the installation of shared libraries, such as
`d3dcompiler_47.dll` to the `misc` tier with the idea of making sure
they weren't taken into account during the computation of the
`dependentlibs.list`.  Unfortunately, `dependentlibs.list` is itself
computed during `misc`, so we have an unfortunate race condition where
sometimes libraries might wind up in the list and sometimes they won't.

For this particular case, we can follow what we already do for ICU and
ignore the library, especially since we're dynamically loading the
library anyway.

Differential Revision: https://phabricator.services.mozilla.com/D79147

diff --git a/toolkit/library/dependentlibs.py b/toolkit/library/dependentlibs.py
--- a/toolkit/library/dependentlibs.py
+++ b/toolkit/library/dependentlibs.py
@@ -107,18 +107,20 @@ def dependentlibs(lib, libpaths, func):
         if dep in deps or os.path.isabs(dep):
             continue
         for dir in libpaths:
             deppath = os.path.join(dir, dep)
             if os.path.exists(deppath):
                 deps.update(dependentlibs(deppath, libpaths, func))
                 # Black list the ICU data DLL because preloading it at startup
                 # leads to startup performance problems because of its excessive
-                # size (around 10MB).
-                if not dep.startswith("icu"):
+                # size (around 10MB).  Same thing with d3dcompiler_47.dll, but
+                # to a lesser extent, and we were going to dynamically load it
+                # anyway.
+                if not dep.startswith(("icu", "d3dcompiler_47")):
                     deps[dep] = deppath
                 break
 
     return deps
 
 def gen_list(output, lib):
     libpaths = [os.path.join(substs['DIST'], 'bin')]
     binary_type = get_type(lib)
