Closed Bug 1594795 Opened 5 years ago Closed 5 years ago

`./mach browsertime --setup` fails to find directory ImageMagick

Categories

(Testing :: Performance, defect, P1)

Version 3
defect

Tracking

(firefox72 fixed)

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: mayhemer, Assigned: sparky)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

$ ./mach browsertime --setup
 0:00.92 Using artifact from local cache: c:\Users\user\.mozbuild\cache\browsertime\e064617c1f90f40a-ImageMagick-7.0.8-39-portable-Q16-x64.zip
 0:00.92 Unpacking temporary location c:\Users\user\.mozbuild\cache\browsertime\e064617c1f90f40a-ImageMagick-7.0.8-39-portable-Q16-x64.zip
Error running mach:

    ['browsertime', '--setup']

The error occurred in the implementation of the invoked mach command.

This should never occur and is likely a bug in the implementation of that
command.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file| 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
message.

The details of the failure are as follows:

Exception: Cannot find an extracted directory: c:/Users/user/.mozbuild/browsertime\ImageMagick-7.0.8

  File "c:\Mozilla\src\mozilla-central2\tools/browsertime/mach_commands.py", line 427, in browsertime
    return self.setup(should_clobber=clobber)
  File "c:\Mozilla\src\mozilla-central2\tools/browsertime/mach_commands.py", line 218, in setup
    raise Exception("Cannot find an extracted directory: %s" % path)

Looks like content of e064617c1f90f40a-ImageMagick-7.0.8-39-portable-Q16-x64.zip is extracted directly to c:/Users/user/.mozbuild/browsertime instead of c:/Users/user/.mozbuild/browsertime/ImageMagick-7.0.8.

After fixing that I'm getting:

$ ./mach browsertime --setup
 0:00.93 Using artifact from local cache: c:\Users\user\.mozbuild\cache\browsertime\e064617c1f90f40a-ImageMagick-7.0.8-39-portable-Q16-x64.zip
 0:00.93 Unpacking temporary location c:\Users\user\.mozbuild\cache\browsertime\e064617c1f90f40a-ImageMagick-7.0.8-39-portable-Q16-x64.zip
 0:05.46 Downloading artifact to local cache: c:\Users\user\.mozbuild\cache\browsertime\82b23243a2a03427-ffmpeg-4.1.1-win64-static.zip
 0:06.74 Downloading... 0.0 %
...
 0:39.96 Downloading... 100.0 %
 0:39.97 Unpacking temporary location c:\Users\user\.mozbuild\cache\browsertime\82b23243a2a03427-ffmpeg-4.1.1-win64-static.zip
 0:43.20 Installing browsertime node module from c:/Mozilla/src/mozilla-central2/tools/browsertime/package.json
Installing browsertime for mach using "c:\Users\user\.mozbuild\node\npm.CMD install --loglevel=error"...
Error running mach:

    ['browsertime', '--setup']

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| 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
message.

The details of the failure are as follows:

TypeError: environment can only contain strings

  File "c:\Mozilla\src\mozilla-central2\tools/browsertime/mach_commands.py", line 427, in browsertime
    return self.setup(should_clobber=clobber)
  File "c:\Mozilla\src\mozilla-central2\tools/browsertime/mach_commands.py", line 257, in setup
    no_optional=automation)
  File "c:/Mozilla/src/mozilla-central2/tools/lint/eslint\setup_helper.py", line 145, in package_setup
    result = call_process(package_name, cmd, append_env={'PATH': os.pathsep.join(path)})
  File "c:/Mozilla/src/mozilla-central2/tools/lint/eslint\setup_helper.py", line 169, in call_process
    subprocess.check_call(cmd, cwd=cwd, stdout=fnull, env=env)
  File "c:\Mozilla\mozilla-build\python\lib\subprocess.py", line 185, in check_call
    retcode = call(*popenargs, **kwargs)
  File "c:\Mozilla\mozilla-build\python\lib\subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "c:\Mozilla\mozilla-build\python\lib\subprocess.py", line 394, in __init__
    errread, errwrite)
  File "c:\Mozilla\mozilla-build\python\lib\subprocess.py", line 644, in _execute_child
    startupinfo)
Blocks: rel=preload

I have also seen this on macOS

Summary: `./mach browsertime --setup` fails on Windows: cannot find directory ImageMagick → `./mach browsertime --setup` fails to find directory ImageMagick
Priority: -- → P1

This patch fixes local ./mach browsertime issues on Windows.

First issue that is fixed is that the archive is extracted into the browsertime folder instead of a separate folder for imagemagick within the browsertime folder. Now, it is extracted into it's own folder whose name depends on the fetches path entry. Second issue fixed is that the environment was being contaminated with bad strings because of the GECKODRIVER_BASE_URL addition - using str on the entries solves this issue.

Finally, convert and compare were not passing in the visualmetrics.py check call. This is because ImageMagick expects to find the path to them within ProgramFiles on windows. Since we don't have them there, we have to add an entry in the PATH environment variable to point to the imagemagick directory to get around this.

There is also an issue with the macosx imagemagick directory which was being extracted as 7.0.9, but we expected 7.0.8. The imagemagick version used is modified to the correct version with the expected directory.

Thanks for fixing this! Confirming this fixes setup when applied on today mozilla central. Didn't run browsertime itself yet, tho.

Attachment #9108245 - Attachment description: Bug 1594795 - Fix local browsertime issues on Windows. r?#perftest,barret,stephendonner → Bug 1594795 - Fix local browsertime issues on Windows and MacOS. r?#perftest,barret,stephendonner
Pushed by gmierz2@outlook.com:
https://hg.mozilla.org/integration/autoland/rev/72fd29e8c8ee
Fix local browsertime issues on Windows and MacOS. r=perftest-reviewers,barret,stephendonner,davehunt
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Assignee: nobody → gmierz2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: