turbo icon indicating copy to clipboard operation
turbo copied to clipboard

fix(turborepo): add berry support for built meta when pruning

Open vinnymac opened this issue 1 year ago • 5 comments

Description

Add support for yarn berry built option for dependencies meta to turbo prune.

Without this change, yarn install --immutable fails because built is added after turbo accidentally removes it, triggering the following error.

The lockfile would have been modified by this install, which is explicitly forbidden.

Testing Instructions

  • Add a dependenciesMeta for a package and set it to built: false.
  • Run yarn to generate a new lockfile
  • Use turbo prune to produce a slim lockfile
  • Run yarn install --immutable on that small lockfile

vinnymac avatar Jun 20 '24 16:06 vinnymac

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2024 6:46pm
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2024 6:46pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 6:46pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 6:46pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 6:46pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 6:46pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 6:46pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 6:46pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 6:46pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 6:46pm

vercel[bot] avatar Jun 20 '24 16:06 vercel[bot]

@vinnymac is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 20 '24 16:06 vercel[bot]

Thanks for the PR! I think this looks good to me, but I'll be doing some additional testing just because yarn install --immutable is quite strict.

chris-olszewski avatar Jun 20 '24 18:06 chris-olszewski

Allow CI Workflow Run

  • [ ] approve CI run for commit: 8186f10d44471fca37279e15cd5b4019871ef58c

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

ijjk avatar Jun 20 '24 19:06 ijjk

@chris-olszewski fixed an issue with this change where I somehow forgot to support more than one dependency meta setting for a single dependency 😅. This should do the job now, let me know what you think.

vinnymac avatar Jul 30 '24 17:07 vinnymac

@vinnymac @chris-olszewski Just want to check in with you both to see if we want to finish up this PR? I'm doing some housekeeping to close out stale items in the repo (but would love to see this get merged!)

anthonyshew avatar Nov 07 '24 03:11 anthonyshew

@vinnymac @chris-olszewski Just want to check in with you both to see if we want to finish up this PR? I'm doing some housekeeping to close out stale items in the repo (but would love to see this get merged!)

This is in a good place, just needs a review first so it can move forward. @chris-olszewski did you want any changes here?

vinnymac avatar Dec 11 '24 02:12 vinnymac

I needed to manually cherrypick the commits to https://github.com/vercel/turborepo/pull/9605 as for whatever reason trying to rebase past https://github.com/vercel/turborepo/pull/8813 was causing git to fail.

Thank you for your contribution and sorry for the delay on getting this merged.

chris-olszewski avatar Dec 11 '24 16:12 chris-olszewski