Skip to content

Conversation

solsson
Copy link
Contributor

@solsson solsson commented Apr 20, 2018

With CI builds or local round trips we want the following layers cached

  • Production dependency changes
  • Dev dependency changes
  • Source changes (including source in monorepo deps)

Still WIP. We should port the tests from https://github.com/solsson/npm-monorepo-example to build-contracts here.

@solsson
Copy link
Contributor Author

solsson commented Apr 21, 2018

Ready for merge + publish, but how do we adopt the tests? Can we run them in build-contract's build-contract?

@solsson solsson force-pushed the build-cache-optimization branch from 9798d29 to 71a1717 Compare April 22, 2018 04:00
solsson added a commit to solsson/npm-monorepo-example that referenced this pull request Apr 23, 2018
@solsson
Copy link
Contributor Author

solsson commented May 1, 2018

Built solsson/build-contract:build-cache-optimization@sha256:24f3f491df810a506aefe4d1a7c39731bf8c41f268c091b0a58e35479cee162c

@solsson
Copy link
Contributor Author

solsson commented May 2, 2018

@atamon You'll probably - unless we take a hard look at our .npmignores - bump into in-cluster builds having an issue with npm-ci.

npm-monorepo deps cause output like:

Unhandled rejection Error: Integrity check failed:
  Wanted: sha512-ZE1Y5ZFtMTTFek2fV+OzCCYkz7QGdAN4qocAF7BngFwbmppkhNODMrZJjL7k/V6J7GX7HGrA4dpOi57HqI6sNA==
   Found: sha512-eCIbNfUaEr+baeIZJhnrVarMvQ9izV5m4X5SkQXRQVbvINqzSywKM7YhnNVWzOpF1HBBitWGE4YxtGm3AC+DVg==
    at checksumError (/usr/local/lib/node_modules/npm/node_modules/cacache/lib/content/write.js:155:13)

A workaround is to monkeypatch package-lock.json. Not a big deal security-wise for monorepo deps, but annoying enough.

solsson added 2 commits May 2, 2018 05:32
so that build-contract terminates,
though no longer with colors in the error message.
@solsson
Copy link
Contributor Author

solsson commented May 2, 2018

In-docker (not only in-cluster) build-contract also fails due to monorepo npm pack not executing the prepare script:

npm WARN lifecycle ...~prepare: cannot run in wd

@solsson solsson merged commit 5f266d3 into master May 3, 2018
solsson added a commit that referenced this pull request May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant