Closed Bug 1622687 Opened 5 years ago Closed 5 years ago

toolkit/crashreporter/: Make it flake8 compliant

Categories

(Developer Infrastructure :: Lint and Formatting, task)

task
Not set
normal

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: Sylvestre, Assigned: sumagnadas, Mentored)

References

Details

(Keywords: good-first-bug, Whiteboard: [lang=python])

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1622676 +++

Filling as a good first bug to learn workflows.

As the change is easy, it is mostly to learn how to contribute to Firefox.

To work on this, remove this line:
https://searchfox.org/mozilla-central/source/.flake8#55-56

To run the linter:
$ ./mach lint -l flake8 toolkit/crashreporter/

To run the autofix:
$ ./mach lint -l flake8 --fix toolkit/crashreporter/

Then, the remaining thing should be fixed by hand.

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/tools/docs/contribute/how_to_contribute_firefox.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

Assignee: nobody → sumagnadas
Status: NEW → ASSIGNED
Pushed by nfroyd@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/78a429af0ec5 Fixed files in toolkit/crashreporter to make it flake8 compliant. r=froydnj

Backed out changeset 78a429af0ec5 (Bug 1622687) for build bustage

Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&searchStr=windows%2C2012%2Cx64%2Cdebug%2Cbuild-win64-fuzzing%2Fdebug%2C%28bf%29&revision=78a429af0ec5b3602056b36a6e0e03d14f92a5e2

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=295439823&repo=autoland&lineNumber=39823

Backout link: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&searchStr=windows%2C2012%2Cx64%2Cdebug%2Cbuild-win64-fuzzing%2Fdebug%2C%28bf%29&revision=60dc189e64d2bb1dac44ecd85c6c4fc696af6230

[task 2020-03-30T19:44:08.978Z] 19:44:08     INFO -  z:/build/fetches/clang/bin/lld-link.exe -out:TestPoisonArea.exe -pdb:TestPoisonArea.pdb @z:/build/workspace/obj-build/mfbt/tests/TestPoisonArea_exe.list -SUBSYSTEM:CONSOLE,6.01 -STACK:8388608  -LARGEADDRESSAWARE -RELEASE -DEBUG -guard:cf,nolongjmp      user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib
[task 2020-03-30T19:44:08.978Z] 19:44:08     INFO -  lld-link: warning: ignoring unknown argument '-RELEASE'
[task 2020-03-30T19:44:08.978Z] 19:44:08     INFO -  mozmake.EXE[4]: Leaving directory 'z:/build/workspace/obj-build/mfbt/tests'
[task 2020-03-30T19:44:09.250Z] 19:44:09     INFO -  mozmake.EXE[4]: Entering directory 'z:/build/workspace/obj-build/browser/app/winlauncher/test'
[task 2020-03-30T19:44:09.250Z] 19:44:09     INFO -  z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe z:/build/build/src/config/nsinstall.py -t -m 755 'TestSafeThreadLocal.exe' '../../../../dist/bin'
[task 2020-03-30T19:44:09.250Z] 19:44:09     INFO -  mozmake.EXE[4]: Leaving directory 'z:/build/workspace/obj-build/browser/app/winlauncher/test'
[task 2020-03-30T19:44:09.421Z] 19:44:09     INFO -  mozmake.EXE[4]: Entering directory 'z:/build/workspace/obj-build/browser/app/winlauncher/test'
[task 2020-03-30T19:44:09.421Z] 19:44:09     INFO -  z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe z:/build/build/src/config/nsinstall.py -t -m 755 'TestSameBinary.exe' '../../../../dist/bin'
[task 2020-03-30T19:44:09.421Z] 19:44:09     INFO -  mozmake.EXE[4]: Leaving directory 'z:/build/workspace/obj-build/browser/app/winlauncher/test'
[task 2020-03-30T19:44:09.896Z] 19:44:09     INFO -  mozmake.EXE[4]: Entering directory 'z:/build/workspace/obj-build/mfbt/tests'
[task 2020-03-30T19:44:09.896Z] 19:44:09     INFO -  z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe z:/build/build/src/config/nsinstall.py -t -m 644 'TestAlgorithm.exe' '../../dist/cppunittests'
[task 2020-03-30T19:44:09.896Z] 19:44:09     INFO -  mozmake.EXE[4]: Leaving directory 'z:/build/workspace/obj-build/mfbt/tests'
[task 2020-03-30T19:44:09.921Z] 19:44:09     INFO -  mozmake.EXE[4]: Entering directory 'z:/build/workspace/obj-build/mfbt/tests'
[task 2020-03-30T19:44:09.921Z] 19:44:09     INFO -  z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe z:/build/build/src/config/nsinstall.py -t -m 644 'TestArray.exe' '../../dist/cppunittests'
[task 2020-03-30T19:44:09.921Z] 19:44:09     INFO -  mozmake.EXE[4]: Leaving directory 'z:/build/workspace/obj-build/mfbt/tests'
[task 2020-03-30T19:44:10.247Z] 19:44:10     INFO -  mozmake.EXE[4]: Entering directory 'z:/build/workspace/obj-build/mfbt/tests'
[task 2020-03-30T19:44:10.247Z] 19:44:10     INFO -  z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe z:/build/build/src/config/nsinstall.py -t -m 644 'TestArrayUtils.exe' '../../dist/cppunittests'
[task 2020-03-30T19:44:10.247Z] 19:44:10     INFO -  mozmake.EXE[4]: Leaving directory 'z:/build/workspace/obj-build/mfbt/tests'
[task 2020-03-30T19:44:10.407Z] 19:44:10     INFO -  mozmake.EXE[4]: Entering directory 'z:/build/workspace/obj-build/mfbt/tests'
[task 2020-03-30T19:44:10.407Z] 19:44:10     INFO -  z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe z:/build/build/src/config/nsinstall.py -t -m 644 'TestAtomics.exe' '../../dist/cppunittests'
[task 2020-03-30T19:44:10.407Z] 19:44:10     INFO -  mozmake.EXE[4]: Leaving directory 'z:/build/workspace/obj-build/mfbt/tests'
[task 2020-03-30T19:44:11.259Z] 19:44:11     INFO -  mozmake.EXE[4]: Entering directory 'z:/build/workspace/obj-build/build/win32/crashinjectdll'
[task 2020-03-30T19:44:11.260Z] 19:44:11     INFO -  z:/build/workspace/obj-build/_virtualenvs/init_py3/Scripts/python.exe -m mozbuild.action.dumpsymbols z:/build/workspace/obj-build/build/win32/crashinjectdll/crashinjectdll.dll z:/build/workspace/obj-build/build/win32/crashinjectdll/crashinjectdll.dll_syms.track
[task 2020-03-30T19:44:11.260Z] 19:44:11    ERROR -  Traceback (most recent call last):
[task 2020-03-30T19:44:11.260Z] 19:44:11     INFO -    File "z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py", line 1024, in <module>
[task 2020-03-30T19:44:11.260Z] 19:44:11     INFO -      main()
[task 2020-03-30T19:44:11.260Z] 19:44:11     INFO -    File "z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py", line 1003, in main
[task 2020-03-30T19:44:11.260Z] 19:44:11     INFO -      file_mapping = make_file_mapping(manifests)
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -    File "z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py", line 395, in make_file_mapping
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -      abs_dest = realpath(os.path.join(destination, dst))
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -    File "z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py", line 275, in realpath
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -      path = str(path, sys.getfilesystemencoding())
[task 2020-03-30T19:44:11.261Z] 19:44:11    ERROR -  TypeError: str() takes at most 1 argument (2 given)
[task 2020-03-30T19:44:11.261Z] 19:44:11    ERROR -  Traceback (most recent call last):
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -    File "C:\mozilla-build\python3\Lib\runpy.py", line 193, in _run_module_as_main
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -      "__main__", mod_spec)
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -    File "C:\mozilla-build\python3\Lib\runpy.py", line 85, in _run_code
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -      exec(code, run_globals)
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -    File "z:\build\build\src\python\mozbuild\mozbuild\action\dumpsymbols.py", line 106, in <module>
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -      sys.exit(main(sys.argv[1:]))
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -    File "z:\build\build\src\python\mozbuild\mozbuild\action\dumpsymbols.py", line 102, in main
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -      args.count_ctors)
[task 2020-03-30T19:44:11.261Z] 19:44:11     INFO -    File "z:\build\build\src\python\mozbuild\mozbuild\action\dumpsymbols.py", line 83, in dump_symbols
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -      out_files = subprocess.check_output(args, universal_newlines=True)
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -    File "C:\mozilla-build\python3\Lib\subprocess.py", line 336, in check_output
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -      **kwargs).stdout
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -    File "C:\mozilla-build\python3\Lib\subprocess.py", line 418, in run
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -      output=stdout, stderr=stderr)
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -  subprocess.CalledProcessError: Command '['z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe', 'z:/build/build/src\\toolkit\\crashreporter\\tools\\symbolstore.py', '-c', '--vcs-info', '-i', '--install-manifest=z:/build/workspace/obj-build\\_build_manifests\\install\\dist_include,z:/build/workspace/obj-build\\dist\\include', '-s', 'z:/build/build/src', 'z:/build/fetches/dump_syms/dump_syms.exe', 'z:/build/workspace/obj-build\\dist\\crashreporter-symbols', 'z:\\build\\workspace\\obj-build\\build\\win32\\crashinjectdll\\crashinjectdll.dll']' returned non-zero exit status 1.
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -  Running: z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py -c --vcs-info -i --install-manifest=z:/build/workspace/obj-build\_build_manifests\install\dist_include,z:/build/workspace/obj-build\dist\include -s z:/build/build/src z:/build/fetches/dump_syms/dump_syms.exe z:/build/workspace/obj-build\dist\crashreporter-symbols z:\build\workspace\obj-build\build\win32\crashinjectdll\crashinjectdll.dll
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -  z:/build/build/src/config/rules.mk:738: recipe for target 'crashinjectdll.dll_syms.track' failed
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -  mozmake.EXE[4]: *** [crashinjectdll.dll_syms.track] Error 1
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -  mozmake.EXE[4]: Leaving directory 'z:/build/workspace/obj-build/build/win32/crashinjectdll'
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -  z:/build/build/src/config/recurse.mk:74: recipe for target 'build/win32/crashinjectdll/syms' failed
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -  mozmake.EXE[3]: *** [build/win32/crashinjectdll/syms] Error 2
[task 2020-03-30T19:44:11.262Z] 19:44:11     INFO -  mozmake.EXE[3]: *** Waiting for unfinished jobs....
[task 2020-03-30T19:44:11.341Z] 19:44:11     INFO -  mozmake.EXE[4]: Entering directory 'z:/build/workspace/obj-build/build/win32'
[task 2020-03-30T19:44:11.341Z] 19:44:11     INFO -  z:/build/workspace/obj-build/_virtualenvs/init_py3/Scripts/python.exe -m mozbuild.action.dumpsymbols z:/build/workspace/obj-build/dist/bin/crashinject.exe z:/build/workspace/obj-build/build/win32/crashinject.exe_syms.track
[task 2020-03-30T19:44:11.341Z] 19:44:11    ERROR -  Traceback (most recent call last):
[task 2020-03-30T19:44:11.341Z] 19:44:11     INFO -    File "z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py", line 1024, in <module>
[task 2020-03-30T19:44:11.341Z] 19:44:11     INFO -      main()
[task 2020-03-30T19:44:11.341Z] 19:44:11     INFO -    File "z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py", line 1003, in main
[task 2020-03-30T19:44:11.341Z] 19:44:11     INFO -      file_mapping = make_file_mapping(manifests)
[task 2020-03-30T19:44:11.341Z] 19:44:11     INFO -    File "z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py", line 395, in make_file_mapping
[task 2020-03-30T19:44:11.341Z] 19:44:11     INFO -      abs_dest = realpath(os.path.join(destination, dst))
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -    File "z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py", line 275, in realpath
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -      path = str(path, sys.getfilesystemencoding())
[task 2020-03-30T19:44:11.342Z] 19:44:11    ERROR -  TypeError: str() takes at most 1 argument (2 given)
[task 2020-03-30T19:44:11.342Z] 19:44:11    ERROR -  Traceback (most recent call last):
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -    File "C:\mozilla-build\python3\Lib\runpy.py", line 193, in _run_module_as_main
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -      "__main__", mod_spec)
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -    File "C:\mozilla-build\python3\Lib\runpy.py", line 85, in _run_code
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -      exec(code, run_globals)
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -    File "z:\build\build\src\python\mozbuild\mozbuild\action\dumpsymbols.py", line 106, in <module>
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -      sys.exit(main(sys.argv[1:]))
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -    File "z:\build\build\src\python\mozbuild\mozbuild\action\dumpsymbols.py", line 102, in main
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -      args.count_ctors)
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -    File "z:\build\build\src\python\mozbuild\mozbuild\action\dumpsymbols.py", line 83, in dump_symbols
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -      out_files = subprocess.check_output(args, universal_newlines=True)
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -    File "C:\mozilla-build\python3\Lib\subprocess.py", line 336, in check_output
[task 2020-03-30T19:44:11.342Z] 19:44:11     INFO -      **kwargs).stdout
[task 2020-03-30T19:44:11.343Z] 19:44:11     INFO -    File "C:\mozilla-build\python3\Lib\subprocess.py", line 418, in run
[task 2020-03-30T19:44:11.343Z] 19:44:11     INFO -      output=stdout, stderr=stderr)
[task 2020-03-30T19:44:11.343Z] 19:44:11     INFO -  subprocess.CalledProcessError: Command '['z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe', 'z:/build/build/src\\toolkit\\crashreporter\\tools\\symbolstore.py', '-c', '--vcs-info', '-i', '--install-manifest=z:/build/workspace/obj-build\\_build_manifests\\install\\dist_include,z:/build/workspace/obj-build\\dist\\include', '-s', 'z:/build/build/src', 'z:/build/fetches/dump_syms/dump_syms.exe', 'z:/build/workspace/obj-build\\dist\\crashreporter-symbols', 'z:\\build\\workspace\\obj-build\\dist\\bin\\crashinject.exe']' returned non-zero exit status 1.
[task 2020-03-30T19:44:11.343Z] 19:44:11     INFO -  Running: z:/build/workspace/obj-build/_virtualenvs/init/Scripts/python.exe z:/build/build/src\toolkit\crashreporter\tools\symbolstore.py -c --vcs-info -i --install-manifest=z:/build/workspace/obj-build\_build_manifests\install\dist_include,z:/build/workspace/obj-build\dist\include -s z:/build/build/src z:/build/fetches/dump_syms/dump_syms.exe z:/build/workspace/obj-build\dist\crashreporter-symbols z:\build\workspace\obj-build\dist\bin\crashinject.exe
Flags: needinfo?(nfroyd)

Ah, so these files are run as Python2, and our flake8 (I believe) runs as Python3. So the files would have to be converted to Python3 first.

Flags: needinfo?(nfroyd)

So what now?

Attachment #9136538 - Attachment description: Bug 1622687 - Fixed files in toolkit/crashreporter to make it flake8 compliant. r=froydnj → Bug 1622687 - toolkit/crashreporter/: Make it flake8 compliant
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla76 → ---
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c4b9a9cfe199 toolkit/crashreporter/: Make it flake8 compliant r=gsvelto,rstewart
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: