Closed Bug 1379955 Opened 7 years ago Closed 7 years ago

Can't find OnboardingTourType.jsm when rewriting lcov files

Categories

(Testing :: Code Coverage, defect)

Version 3
defect
Not set
normal

Tracking

(firefox56 fixed)

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: marco, Assigned: marco)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Traceback (most recent call last):
  File "python/mozbuild/mozbuild/codecoverage/lcov_rewriter.py", line 731, in <module>
    main()
  File "python/mozbuild/mozbuild/codecoverage/lcov_rewriter.py", line 728, in main
    rewriter.rewrite_file(f, args.output_suffix)
  File "python/mozbuild/mozbuild/codecoverage/lcov_rewriter.py", line 675, in rewrite_file
    assert os.path.isfile(source_file), "Couldn\'t find mapped source file at %s!" % source_file
AssertionError: Couldn\'t find mapped source file at /home/marco/Documenti/FD/mozilla-unified/browser/extensions/onboarding/content/modules/OnboardingTourType.jsm!

The SF entry is "resource://onboarding/modules/OnboardingTourType.jsm".

The module can be found at "browser/extensions/onboarding/OnboardingTourType.jsm".
This is causing the rewriting to fail, as this SF is in a lot of lcov files.

Chris, can you take a look?
Flags: needinfo?(cmanchester)
This is an example lcov file containing OnboardingTourType.jsm.
In the chrome-map.json file we have these entries:

"resource://onboarding/": [
      "dist/bin/browser/features/onboarding@mozilla.org/chrome/content"

and:

"dist/bin/browser/features/onboarding@mozilla.org/chrome/content/": [
      "/home/marco/Documenti/FD/mozilla-unified/browser/extensions/onboarding/content/*",
There's also:

"dist/bin/browser/features/onboarding@mozilla.org/chrome/content/modules/": [
      "/home/marco/Documenti/FD/mozilla-unified/browser/extensions/onboarding/*.jsm",

I suppose the rewriter should have used this entry instead of the one from comment 3.
Attached patch PatchSplinter Review
Using the longest prefix match in _find_install_prefix fixes the issue. Do you believe it could cause other issues to crop up?
Assignee: nobody → mcastelluccio
Status: NEW → ASSIGNED
Attachment #8885281 - Flags: review?(cmanchester)
Comment on attachment 8885281 [details] [diff] [review]
Patch

Review of attachment 8885281 [details] [diff] [review]:
-----------------------------------------------------------------

This makes sense and looks like it will work for now. I guess this could still be an issue if we end up with a jar.mn with something like:

content/modules/ (*.jsm)
content/modules/ (foo/*.jsm)

in this case I think we'd only be able to tell which line was responsible for installing the file by trying each pattern, but I'm not sure that's a concern in practice.
Attachment #8885281 - Flags: review?(cmanchester) → review+
Flags: needinfo?(cmanchester)
Pushed by mcastelluccio@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3b5eec74e7e5
Use longest prefix match when rewriting lcov entries. r=chmanchester
https://hg.mozilla.org/mozilla-central/rev/3b5eec74e7e5
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
This is happening again, I need to figure out why.
Apparently it's happened again because a task was triggered for an old revision of mozilla-central. So it's actually fine.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: