This repository has been archived by the owner. It is now read-only.

Make install order more consistent for directly dependencies #9274

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@iarna
Member

iarna commented Aug 14, 2015

The install order is determined by:

  1. The location of the thing to be installed relative to the root module.
  2. Dependency order, such that a -> b -> c will install modules as: c, b, a

1 is deterministic, regardless of what's being installed.

But 2 can change the order of things higher in the dep tree. Eg, b, or a
might get sorted earlier if c requires them. This mostly doesn't matter,
but it does mean that if you have two modules with conflicting bins, they
can get installed in different orders. This changes sorts all of the top
level modules to be LAST, in location order (1), and then sorts all the rest
per (2). This ensures that top level modules have a deterministic install
order. (Non top level modules can't have bin conflicts as that's treated
the same as a version conflict and the conflicting module would be hoisted.)

Fixes #8995

  • Needs a test

@iarna iarna added the in-progress label Aug 14, 2015

@iarna iarna added this to the 3.x-next-next milestone Aug 14, 2015

@iarna iarna changed the title from diff-trees: Make install order more consistent for directly dependencies to Make install order more consistent for directly dependencies Aug 19, 2015

Show outdated Hide outdated lib/install/diff-trees.js
var mod = actions[location][1]
if (!mod.package._requiredBy) return true
var deepDeps = mod.package._requiredBy.filter(function (req) {
return req !== '/' && req[0] !== '#'

This comment has been minimized.

@iarna

iarna Aug 19, 2015

Member

put in function

@iarna

iarna Aug 19, 2015

Member

put in function

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Aug 19, 2015

Contributor

Reviewed by me over ScreenHero, with one small suggestion to improve comprehensibility. 🐑

Contributor

othiym23 commented Aug 19, 2015

Reviewed by me over ScreenHero, with one small suggestion to improve comprehensibility. 🐑

iarna added a commit that referenced this pull request Aug 20, 2015

diff-trees: Make install order more consistent for directly dependencies
The install order is determined by:

1) The location of the thing to be installed relative to the root module.
2) Dependency order, such that a -> b -> c will install modules as: c, b, a

1 is deterministic, regardless of what's being installed.

But 2 can change the order of things higher in the dep tree.  Eg, b, or a
might get sorted earlier if c requires them.  This mostly doesn't matter,
but it does mean that if you have two modules with conflicting bins, they
_can_ get installed in different orders.  This changes sorts all of the top
level modules to be LAST, in location order (1), and then sorts all the rest
per (2).  This ensures that top level modules have a deterministic install
order. (Non top level modules can't have bin conflicts as that's treated
the same as a version conflict and the conflicting module would be hoisted.)

PR-URL: #9274
Fixes: #8995

iarna added a commit that referenced this pull request Aug 21, 2015

diff-trees: Make install order more consistent for directly dependencies
The install order is determined by:

1) The location of the thing to be installed relative to the root module.
2) Dependency order, such that a -> b -> c will install modules as: c, b, a

1 is deterministic, regardless of what's being installed.

But 2 can change the order of things higher in the dep tree.  Eg, b, or a
might get sorted earlier if c requires them.  This mostly doesn't matter,
but it does mean that if you have two modules with conflicting bins, they
_can_ get installed in different orders.  This changes sorts all of the top
level modules to be LAST, in location order (1), and then sorts all the rest
per (2).  This ensures that top level modules have a deterministic install
order. (Non top level modules can't have bin conflicts as that's treated
the same as a version conflict and the conflicting module would be hoisted.)

PR-URL: #9274
Fixes: #8995

@iarna iarna added ready and removed in-progress labels Aug 21, 2015

Show outdated Hide outdated lib/install/diff-trees.js
var mod = action[1]
if (added[mod.package._location]) return
added[mod.package._location] = action
mod.package._requiredBy.forEach(function (location) {

This comment has been minimized.

@iarna

iarna Aug 21, 2015

Member

sort _requiredBy

@iarna

iarna Aug 21, 2015

Member

sort _requiredBy

diff-trees: Make install order more consistent for directly dependencies
The install order is determined by:

1) The location of the thing to be installed relative to the root module.
2) Dependency order, such that a -> b -> c will install modules as: c, b, a

1 is deterministic, regardless of what's being installed.

But 2 can change the order of things higher in the dep tree.  Eg, b, or a
might get sorted earlier if c requires them.  This mostly doesn't matter,
but it does mean that if you have two modules with conflicting bins, they
_can_ get installed in different orders.  This changes sorts all of the top
level modules to be LAST, in location order (1), and then sorts all the rest
per (2).  This ensures that top level modules have a deterministic install
order. (Non top level modules can't have bin conflicts as that's treated
the same as a version conflict and the conflicting module would be hoisted.)

iarna added a commit that referenced this pull request Aug 21, 2015

diff-trees: Make install order more consistent for directly dependencies
The install order is determined by:

1) The location of the thing to be installed relative to the root module.
2) Dependency order, such that a -> b -> c will install modules as: c, b, a

1 is deterministic, regardless of what's being installed.

But 2 can change the order of things higher in the dep tree.  Eg, b, or a
might get sorted earlier if c requires them.  This mostly doesn't matter,
but it does mean that if you have two modules with conflicting bins, they
_can_ get installed in different orders.  This changes sorts all of the top
level modules to be LAST, in location order (1), and then sorts all the rest
per (2).  This ensures that top level modules have a deterministic install
order. (Non top level modules can't have bin conflicts as that's treated
the same as a version conflict and the conflicting module would be hoisted.)

PR-URL: #9274
Fixes: #8995
@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Aug 28, 2015

Contributor

Landed as d395a6b. Consistency is one of our top-level goals, so this is a great thing to get in. Thanks once more, Rebecca!

Contributor

othiym23 commented Aug 28, 2015

Landed as d395a6b. Consistency is one of our top-level goals, so this is a great thing to get in. Thanks once more, Rebecca!

@othiym23 othiym23 closed this Aug 28, 2015

@iarna iarna deleted the iarna/make-install-order-more-consistent branch Sep 9, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.