Skip to content

Commit

Permalink
Merge pull request #1256 from embroider-build/avoid-race
Browse files Browse the repository at this point in the history
Fix an order bug in linkNonCopiedDeps
  • Loading branch information
ef4 authored Sep 26, 2022
2 parents 031fd6c + 8d75e42 commit 05fcd5e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/compat/src/compat-addons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,18 @@ export default class CompatAddons implements Stage {
// shell for its real module namespace.
copySync(join(destination, 'package.json'), join(newPkg.root, 'package.json'));
}
}
});

// this has to be a separate pass over the packages because
// linkNonCopiedDeps resolves dependencies, so we want all the packages
// already in their new places before they start trying to resolve each
// other.
[...this.packageCache.moved.values()].forEach((newPkg, index) => {
if (
!this.didBuild || // always copy on the first build
(newPkg.mayRebuild && changedMap.get(movedAddons[index]))
) {
// for engines, this isn't the mangled destination (we don't need
// resolvable node_modules there), this is the empty shell of their real
// location
Expand Down

0 comments on commit 05fcd5e

Please sign in to comment.