Closed Bug 1666883 Opened 8 months ago Closed 8 months ago

running "mach install-moz-phab" fails with missing RECORD file


(Firefox Build System :: General, defect)



(firefox83 fixed)

83 Branch
Tracking Status
firefox83 --- fixed


(Reporter: willkg, Assigned: mhentges)


(Blocks 1 open bug)



(1 file)

I ran mach install-moz-phab just now and it failed like this:

 ./mach install-moz-phab
 0:00.54 Installing moz-phab
Collecting MozPhab
  Downloading (69kB)
     |████████████████████████████████| 71kB 2.0MB/s 
Requirement already satisfied, skipping upgrade: distro in /home/willkg/.pyenv/versions/3.7.5/lib/python3.7/site-packages (from MozPhab) (1.4.0)
Collecting glean-sdk>=31.0.0 (from MozPhab)
  Downloading (1.5MB)
     |████████████████████████████████| 1.5MB 6.0MB/s 
Collecting sentry-sdk>=0.14.3 (from MozPhab)
  Downloading (120kB)
     |████████████████████████████████| 122kB 8.9MB/s 
Requirement already satisfied, skipping upgrade: setuptools in /home/willkg/.pyenv/versions/3.7.5/lib/python3.7/site-packages (from MozPhab) (41.2.0)
Requirement already satisfied, skipping upgrade: cffi>=1 in /home/willkg/.local/lib/python3.7/site-packages (from glean-sdk>=31.0.0->MozPhab) (1.13.2)
Collecting glean-parser==1.28.5 (from glean-sdk>=31.0.0->MozPhab)
  Downloading (57kB)
     |████████████████████████████████| 61kB 11.0MB/s 
Requirement already satisfied, skipping upgrade: certifi in /home/willkg/.local/lib/python3.7/site-packages (from sentry-sdk>=0.14.3->MozPhab) (2019.11.28)
Requirement already satisfied, skipping upgrade: urllib3>=1.10.0 in /home/willkg/.local/lib/python3.7/site-packages (from sentry-sdk>=0.14.3->MozPhab) (1.25.7)
Requirement already satisfied, skipping upgrade: pycparser in /home/willkg/.local/lib/python3.7/site-packages (from cffi>=1->glean-sdk>=31.0.0->MozPhab) (2.19)
Collecting diskcache>=4 (from glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Collecting appdirs>=1.4 (from glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Requirement already satisfied, skipping upgrade: Click>=7 in /home/willkg/.pyenv/versions/3.7.5/lib/python3.7/site-packages (from glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab) (7.0)
Collecting jsonschema>=3.0.2 (from glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Collecting yamllint>=1.18.0 (from glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Collecting PyYAML>=3.13 (from glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
Collecting Jinja2>=2.10.1 (from glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Collecting attrs>=17.4.0 (from jsonschema>=3.0.2->glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Collecting importlib-metadata; python_version < "3.8" (from jsonschema>=3.0.2->glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Requirement already satisfied, skipping upgrade: six>=1.11.0 in /home/willkg/.pyenv/versions/3.7.5/lib/python3.7/site-packages (from jsonschema>=3.0.2->glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab) (1.13.0)
Collecting pyrsistent>=0.14.0 (from jsonschema>=3.0.2->glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
Collecting pathspec>=0.5.3 (from yamllint>=1.18.0->glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Collecting MarkupSafe>=0.23 (from Jinja2>=2.10.1->glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Collecting zipp>=0.5 (from importlib-metadata; python_version < "3.8"->jsonschema>=3.0.2->glean-parser==1.28.5->glean-sdk>=31.0.0->MozPhab)
  Using cached
Installing collected packages: diskcache, appdirs, attrs, zipp, importlib-metadata, pyrsistent, jsonschema, PyYAML, pathspec, yamllint, MarkupSafe, Jinja2, glean-parser, glean-sdk, sentry-sdk, MozPhab
  Running install for MozPhab ... done
Successfully installed Jinja2-2.11.2 MarkupSafe-1.1.1 MozPhab-0.1.90 PyYAML-5.3.1 appdirs-1.4.4 attrs-20.2.0 diskcache-5.0.3 glean-parser-1.28.5 glean-sdk-33.0.0 importlib-metadata-2.0.0 jsonschema-3.2.0 pathspec-0.8.0 pyrsistent-0.17.3 sentry-sdk-0.17.8 yamllint-1.24.2 zipp-3.2.0
WARNING: You are using pip version 19.2.3, however version 20.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Error running mach:


The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file install-moz-phab| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error

The details of the failure are as follows:

FileNotFoundError: [Errno 2] No such file or directory: '/home/willkg/.local/lib/python3.7/site-packages/MozPhab-0.1.90-py3.7.egg-info/RECORD'

  File "/home/willkg/mozilla/src/mozilla-unified/tools/phabricator/", line 99, in install_moz_phab
    package_files = [file.split(',')[0] for file in dist.get_metadata_lines('RECORD')]
  File "/home/willkg/.pyenv/versions/3.7.5/lib/python3.7/site-packages/pkg_resources/", line 1432, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/home/willkg/.pyenv/versions/3.7.5/lib/python3.7/site-packages/pkg_resources/", line 1420, in get_metadata
    value = self._get(path)
  File "/home/willkg/.pyenv/versions/3.7.5/lib/python3.7/site-packages/pkg_resources/", line 1616, in _get
    with open(path, 'rb') as stream:
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit

The contents of that directory:

> ls ~/.local/lib/python3.7/site-packages/MozPhab-0.1.90-py3.7.egg-info/
dependency_links.txt  entry_points.txt  installed-files.txt  PKG-INFO  requires.txt  SOURCES.txt  top_level.txt
Component: General → moz-phab
Product: Core → Conduit
Component: moz-phab → General
Product: Conduit → Firefox Build System
Assignee: nobody → mhentges

Agh, pip with (edit: a fresh install of) python 3.7 doesn't add the RECORD file, huh. I'll dig in here. Thanks for the report!
The only work that happens after that error is that it runs moz-phab install-certificate. If you run that manually, then you should be good.

EDIT: looks like pip 19.2.3 puts the list of the package's files in installed-files.txt, while pip 20+ puts it in RECORD.

Thank you!

Programmatically detecting the moz-phab location by looking at pip
egg/dist files is easily subject to breakage if pip changes its internal
file structure, as it did from pip 19 to pip 20.

So, instead, call the (more stable) pip CLI directory and parse the

Pushed by
install-moz-phab should use pip CLI, not internal file r=firefox-build-system-reviewers,rstewart
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.