From 18b99b3bc319f84db78ff489d6ca5e0cc0273bcc Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 9 Jun 2020 22:40:23 +0200 Subject: compilers: corretify deduplication direction so: when building compile args, meson is deduplicating flags. When a compiler argument is appended, a later appearance of a dedup'ed is going to remove a earlier one. If the argument is prepended, the element *before* the new one is going to be removed. And that is where the problem reported in https://github.com/mesonbuild/meson/pull/7119 is coming in. In the revision linked there, the order of replacement in the prepend case was revesered. With this patch, we restore this behaviour again. --- mesonbuild/compilers/compilers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers/compilers.py') diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 50e2188..f427262 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -481,10 +481,10 @@ class CompilerArgs(collections.abc.MutableSequence): post_flush_set = set() #The two lists are here walked from the front to the back, in order to not need removals for deduplication - for a in reversed(self.pre): + for a in self.pre: dedup = self._can_dedup(a) if a not in pre_flush_set: - pre_flush.appendleft(a) + pre_flush.append(a) if dedup == 2: pre_flush_set.add(a) for a in reversed(self.post): -- cgit v1.1