This repository was archived by the owner on Mar 3, 2023. It is now read-only.
script: Let bootstrap install apm
with npm ci
#22450
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements for Adding, Changing, or Removing a Feature (from template, click to expand):
Issue or RFC Endorsed by Atom's Maintainers
None, but takes advantage of a PR at
apm
that was approved by maintainers: atom/apm#912Description of the Change
When bootstrapping/building Atom in
ci
mode, setNO_APM_DEDUPE="true"
and installapm
withnpm ci
(rather thannpm install
).This enables faster, more-reproducible installs of
apm
, much like we already do for thescripts/
dependencies and the core Atom dependencies.This only affects bootstrapping/building Atom; This should not make any difference to the built Atom app (except ensuring
apm
's dependencies are pinned to exact versions), and should not make any difference toapm
's behavior as a command-line tool/as a component of Atom.As of apm 2.6.2, apm respects a
NO_APM_DEDUPE
env var on Windows.(It was already supported on Linux and macOS before then.)
When set, this env var disables the deduping
normally performed at the end of apm's postinstall script.
This deduping doesn't work properly when installing apm with
npm ci
,for unknown reasons. (The deduping algorithm deletes many needed
dependencies, without reconstructing a valid tree.)
Now that
apm
supportsNO_APM_DEDUPE
on all platforms,we can safely allow installing
apm
withnpm ci
during the bootstrap script.
Now bootstrapping apm in
ci
mode is faster in two ways:npm ci
is generally faster thannpm install
for clean installs.npm dedupe
run is now skipped inci
mode.npm dedupe
was of dubious value in any casenpm dedupe
command was also surprisingly slowWe also benefit from the stronger reproducibility of
npm ci
compared to
npm install
(guaranteed, version-locked dependencies).Alternate Designs
At the community fork of
apm
, we opted to delete deduping fromapm
'spostinstall
script altogether, so theNO_APM_DEDUPE
env var isn't needed.See: atom-community/apm#71
That can be done at the official
apm
repo too, if desired, but it could even be done after this PR. It need not block this PR.Possible Drawbacks
None.
Verification Process
Ran
script/bootstrap --ci
andscript/build --ci
locally with this change.Result: No broken/missing packages, and the "Installing apm" step of bootstrapping went a bit faster (because
npm ci
is faster thannpm install
for clean installs, and because it didn't spend any time deduping).Ran this branch in Azure Pipelines.
Result: CI passed. https://dev.azure.com/DeeDeeG/b/_build/results?buildId=1127&view=results
Release Notes
N/A