• Nathan Froyd's avatar
    Bug 1304815 - rearrange Rust crate structure for newer Rust releases; r=ted.mielczarek · e818915f
    Nathan Froyd authored
    In our current Rust world, we have the following dependency structure:
      xul.so --------------------------+
      xul-gtest.so -+--> xul.a --------+-> gkrust
                    +--> gkrust-gtest
    This structure results in link errors with multiply-defined symbols
    between gkrust-gtest and gkrust with newer Rust releases when linking
    xul-gtest.so.  So we have to do something different.
    Our new structure is:
      xul.so --------------------------+
      xul-gtest.so -+--> xul.a --------+-> gkrust --+-> gkrust-shared
                    |                               |
                    +--> gkrust-gtest --------------+
    and we enforce that a given shared library can only have at most one
    Rust library that it depends on.  Said Rust library is assumed to
    include all significant Rust dependencies of the dependent static
    libraries as well.  (In the above structure, gkrust is simply a wrapper
    around gkrust-shared, so gkrust-gtest doesn't have to include gkrust as
    a dependency.)