Closed Bug 1880586 Opened 9 months ago Closed 9 months ago

newtab npm bundle command generates different bundle on windows

Categories

(Firefox :: Messaging System, defect, P1)

defect
Points:
1

Tracking

()

RESOLVED FIXED
125 Branch
Iteration:
125.1 - Feb 19 - Mar 1
Tracking Status
firefox-esr115 --- unaffected
firefox122 --- unaffected
firefox123 --- unaffected
firefox124 --- wontfix
firefox125 --- fixed

People

(Reporter: aminomancer, Assigned: aminomancer)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

D201139 seems to have introduced a regression where building the newtab bundle on windows yields a different result than on mac/linux.
You can test it with cd browser/components/newtab && "../../../mach" npm install
Reverting the changes to the webpack config and resourceUriPlugin.js before bundling also eliminates the diff.

I ran a bisection to double check: Bug 1878731, https://phabricator.services.mozilla.com/D201139

The issue seems to be because the ResourceUriPlugin produces wrong URLs on windows, mixing forward slashes and back slashes, because it substitutes a windows path (forward slashes) for a substring of a URL (back slashes):

// resourceUriPlugin.js:ResourceUriPlugin::apply

// before the patch
pathname :>>  C:\mozilla-git\mozilla-unified-2\browser\components\newtab\common\Actions.sys.mjs
pathname :>>  C:\mozilla-git\mozilla-unified-2\browser\components\newtab\common\Dedupe.sys.mjs

// after the patch
pathname :>>  C:\mozilla-git\mozilla-unified-2\browser\components\newtab\common/Actions.sys.mjs
pathname :>>  C:\mozilla-git\mozilla-unified-2\browser\components\newtab\common/Dedupe.sys.mjs

Since the try-runner.js runs on linux, any time we submit a patch from windows, it will get backed out (see bug 1880371 for example), unless we first discard the changes to activity-stream.bundle.js

A simple fix is to reform the path from the URL before using it. path.join knows how to handle slashes on Windows.

Assignee: nobody → shughes
Status: NEW → ASSIGNED

Set release status flags based on info from the regressing bug 1878731

Set release status flags based on info from the regressing bug 1878731

Severity: -- → S3
Iteration: --- → 125.1 - Feb 19 - Mar 1
Points: --- → 1
Flags: needinfo?(sdowne)
Priority: -- → P1
Pushed by shughes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0a7089e73d4c Fix newtab webpack resource URI discrepancy on Windows. r=omc-reviewers,emcminn,thecount
See Also: → 1881165
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
Flags: needinfo?(sdowne)

The patch landed in nightly and beta is affected.
:aminomancer, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox124 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(shughes)
Flags: needinfo?(shughes)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: