diff options
author | kira78 <kira78@users.noreply.github.com> | 2021-07-04 20:37:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-04 17:37:35 -0700 |
commit | 4f49fa8315024014727ebe5347f506beb56b668e (patch) | |
tree | 290a4768f0675ba87d0f1dd6dca24b8f1412b26d /mesonbuild/dependencies/dev.py | |
parent | 0d0f2cdafd7597ff84baf7a4790f3f016fe2337f (diff) | |
download | meson-4f49fa8315024014727ebe5347f506beb56b668e.zip meson-4f49fa8315024014727ebe5347f506beb56b668e.tar.gz meson-4f49fa8315024014727ebe5347f506beb56b668e.tar.bz2 |
dependencies: Deterministic LLVM compile and link arg ordering (#8959)
* dependencies: Deterministic LLVM compile and link arg ordering
In LLVMDependencyConfigTool, the members compile_args and required_modules are
either converted to or stored as sets, which do not have a stable ordering. This
results in nondeterministic builds, particularly with required_modules causing
the order in which the LLVM libraries are linked in to the output binaries to
change across independent builds. As any guarantee about ordering for
compile_args is lost by being converted from a list to a set and back, and the
modules added to required_modules was even already sorted once, sort both when
converting them to lists.
* Use mesonlib.OrderedSet instead of sorting the sets.
Co-authored-by: Kaelyn Takata <kaelyn.alexi@protonmail.com>
Diffstat (limited to 'mesonbuild/dependencies/dev.py')
-rw-r--r-- | mesonbuild/dependencies/dev.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index 0ab8332..7300e2f 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -219,7 +219,7 @@ class LLVMDependencyConfigTool(ConfigToolDependency): # the C linker works fine if only using the C API. super().__init__(name, environment, kwargs, language='cpp') self.provided_modules: T.List[str] = [] - self.required_modules: T.Set[str] = set() + self.required_modules: mesonlib.OrderedSet[str] = mesonlib.OrderedSet() self.module_details: T.List[str] = [] if not self.is_found: return @@ -230,7 +230,7 @@ class LLVMDependencyConfigTool(ConfigToolDependency): opt_modules = stringlistify(extract_as_list(kwargs, 'optional_modules')) self.check_components(opt_modules, required=False) - cargs = set(self.get_config_value(['--cppflags'], 'compile_args')) + cargs = mesonlib.OrderedSet(self.get_config_value(['--cppflags'], 'compile_args')) self.compile_args = list(cargs.difference(self.__cpp_blacklist)) if version_compare(self.version, '>= 3.9'): |