Backed out changeset f1d785de7ab3 (bug 1661153) for causing symbols bustages. a=backout.

This commit is contained in:
Cosmin Sabou 2020-12-03 00:49:17 +02:00
Родитель 2a7961a0ac
Коммит fc64a95f3a
5 изменённых файлов: 25 добавлений и 1 удалений

Просмотреть файл

@ -605,7 +605,20 @@ class PackageFrontend(MachCommandBase):
"sha256": h.hexdigest(),
}
if record.unpack and not no_unpack:
unpack_file(local)
# Try to unpack the file. If we get an exception importing
# zstandard when calling unpack_file, we can try installing
# zstandard locally and trying again
try:
unpack_file(local)
except ImportError as e:
# Need to do this branch while this code is still exercised
# by Python 2.
if six.PY3 and e.name != "zstandard":
raise
elif six.PY2 and e.message != "No module named zstandard":
raise
self._ensure_zstd()
unpack_file(local)
os.unlink(local)
if not downloaded:

Просмотреть файл

@ -400,6 +400,7 @@ class ArtifactJob(object):
for filename in reader.entries:
yield filename, reader[filename]
elif filename.endswith(".tar.zst") and self._mozbuild is not None:
self._mozbuild._ensure_zstd()
import zstandard
ctx = zstandard.ZstdDecompressor()

Просмотреть файл

@ -913,6 +913,13 @@ class MozbuildObject(ProcessExecutionMixin):
logging.INFO if not verbose else logging.DEBUG
)
def _ensure_zstd(self):
try:
import zstandard # noqa: F401
except (ImportError, AttributeError):
self.activate_virtualenv()
self.virtualenv_manager.install_pip_package("zstandard>=0.9.0,<=0.13.0")
class MachCommandBase(MozbuildObject):
"""Base class for mach command providers that wish to be MozbuildObjects.

Просмотреть файл

@ -624,6 +624,7 @@ class TaskClusterImagesProvider(MachCommandBase):
"or mozilla-inbound)",
)
def load_image(self, image_name, task_id, tag):
self._ensure_zstd()
from taskgraph.docker import load_image_by_name, load_image_by_task_id
if not image_name and not task_id:

Просмотреть файл

@ -90,6 +90,8 @@ def main():
import gzip
import tarfile
import tempfile
config._ensure_zstd()
import zstandard
def prepare_zip_from(archive, tmpdir):