Add `./mach vendor node` to vendor `node_modules` needed during the build
Categories
(Firefox Build System :: General, task)
Tracking
(firefox157+ fixed)
People
(Reporter: ahochheiden, Assigned: ahochheiden)
References
(Blocks 3 open bugs)
Details
Attachments
(10 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Bug 2025793 made newtab bundling depend on node_modules during the build. In our CI, the node_modules were supplied via toolchain and npm ci was added as a local fallback. The problem is that downstream builders are not covered. They have no network access, and don't consume our toolchains. The simplest fix is to just vendor the necessary node_modules in the tree, which will work for all paths.
| Assignee | ||
Comment 1•2 months ago
|
||
| Assignee | ||
Comment 2•2 months ago
|
||
I used ./mach vendor python as a template for this. We strip everything we
don't need, including anything that varies by host, so vendoring on any
platform yields identical results.
| Assignee | ||
Comment 3•2 months ago
|
||
third_party/node/node_modules is generated by ./mach vendor node.
The toolkit/content/license.html change was done manually.
| Assignee | ||
Comment 4•2 months ago
|
||
Nothing is installed during the build now, and it can run without network access.
Webpack's inputs are recorded and hashed rather than returned as dependencies,
since the FasterMake backend never includes the dependency files it writes.
| Assignee | ||
Comment 5•2 months ago
|
||
The node-licenses lint normally reinstalls node_modules with npm. For
pnpm-managed vendored trees, it checks the existing tree instead and reports
an error when it is missing.
| Comment hidden (Intermittent Failures Robot) |
Updated•1 month ago
|
| Assignee | ||
Comment 8•1 month ago
|
||
webpack 5.109 no longer provides terser-webpack-plugin, so the minifier is
declared and imported under its own name. The emitted bundles change.
| Assignee | ||
Comment 9•1 month ago
|
||
| Comment hidden (Intermittent Failures Robot) |
| Assignee | ||
Comment 12•1 month ago
|
||
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
Updated•1 month ago
|
| Comment hidden (Intermittent Failures Robot) |
Updated•1 month ago
|
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Assignee | ||
Comment 22•1 month ago
|
||
Documentation, tests, type declarations, source maps, bin shims and the
bookkeeping pnpm keeps for itself are all pruned. License text stays, and a
README stays only when a package has no license text of its own.
Packages restricted by os, cpu or libc are pruned too, because whether
pnpm installs them depends on the vendoring host. The executable bit is
cleared because a Windows checkout cannot carry it. ./mach vendor node should
yield identical output on every host platform.
| Assignee | ||
Comment 23•1 month ago
|
||
A pnpm other than the one package.json names can resolve the same manifest
differently, so its version is checked before anything runs. A consumer
manifest that pins another version of a vendored package would build against
something other than it declares, so after any requested add or remove the
versions have to agree before the lock file is resolved and the tree installed.
Consumers are listed in CONSUMER_MANIFESTS, newtab alone for now. Two
consumers that want different versions of one package fail this check rather
than getting two copies. Once consumers keep their build dependencies apart
from their test dependencies, third_party/node can become a pnpm workspace
with the consumers as its packages and the check can go.
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
Comment 28•1 month ago
|
||
| Comment hidden (Intermittent Failures Robot) |
Comment 30•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/f2e7b69bf9ed
https://hg.mozilla.org/mozilla-central/rev/91fec5ba39ad
https://hg.mozilla.org/mozilla-central/rev/e3ac66486a44
https://hg.mozilla.org/mozilla-central/rev/0afb735f0c5c
https://hg.mozilla.org/mozilla-central/rev/ea8218b9e9e9
https://hg.mozilla.org/mozilla-central/rev/64e16150b730
https://hg.mozilla.org/mozilla-central/rev/668e494beeef
https://hg.mozilla.org/mozilla-central/rev/5fd880e0eec1
https://hg.mozilla.org/mozilla-central/rev/5713dbdae4ab
https://hg.mozilla.org/mozilla-central/rev/d85da6e65e08
| Comment hidden (Intermittent Failures Robot) |
Updated•1 month ago
|
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
Description
•