Bug 1753520: Compare config paths using pathlib r=firefox-build-system-reviewers,glandium

If previous config file paths were generated with a different
driveletter casing than the current context, then each file's contents
are replaced with `null`.

MozillaBuild 3.4 used a lowercase drive letter, and MozillaBuild 4.0
will use an uppercase drive letter.
So, using 3.4's existing objdir, and doing an incremental build with
4.0 will cause the `null` contents issue.

Adjust the files to be their `Path().resolve()`'d counterparts, so
they're string-comparable and the subset-calculation works correctly.

Differential Revision: https://phabricator.services.mozilla.com/D137807
This commit is contained in:
Mitchell Hentges 2022-02-18 14:21:37 +00:00
parent 1e51040ed8
commit 222e16e8b1

View File

@ -11,6 +11,7 @@ import json
from collections.abc import Iterable
from collections import OrderedDict
from pathlib import Path
from types import ModuleType
import mozpack.path as mozpath
@ -242,10 +243,11 @@ class PartialConfigDict(object):
self._dict = {}
existing_files = self._load_config_track()
existing_files = {Path(f) for f in existing_files}
new_files = set()
for k, v in six.iteritems(values):
new_files.add(self._write_file(k, v))
new_files.add(Path(self._write_file(k, v)))
for filename in existing_files - new_files:
# We can't actually os.remove() here, since make would not see that the