Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(turbo): COREPACK_HOME to default passthrough #9151

Conversation

tknickman
Copy link
Member

Description

Add COREPACK_HOME to default passthrough list

Testing Instructions

Copy link

vercel bot commented Sep 16, 2024

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 Sep 16, 2024 4:17pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Sep 16, 2024 4:17pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Sep 16, 2024 4:17pm
examples-gatsby-web ⬜️ Ignored (Inspect) Sep 16, 2024 4:17pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Sep 16, 2024 4:17pm
examples-native-web ⬜️ Ignored (Inspect) Sep 16, 2024 4:17pm
examples-svelte-web ⬜️ Ignored (Inspect) Sep 16, 2024 4:17pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Sep 16, 2024 4:17pm
examples-vite-web ⬜️ Ignored (Inspect) Sep 16, 2024 4:17pm

@chris-olszewski chris-olszewski merged commit 8749399 into main Sep 16, 2024
40 checks passed
@chris-olszewski chris-olszewski deleted the tomknickman/turbo-4027-add-corepack_home-to-default-pass-through branch September 16, 2024 17:26
onsclom added a commit to vercel/vercel that referenced this pull request Oct 3, 2024
## Problem

Turborepo does not pass `COREPACK_HOME` to internal libraries. This
means Turborepo projects using corepack may run into `EEXIST: file
already exists` errors. [turbo@2.1.3 has `COREPACK_HOME` in default
passthrough](vercel/turborepo#9151), but we need
to handle older existing Turborepo projects better for a couple reasons:

1. New Turborepo projects can be created today that use corepack, and
they can hit this confusing `EEXIST` error.

2. We want to fix corepack detection in monorepos without breaking
existing Turborepo projects again.
  a. #12099

## Solution

When a Turborepo project does not support `COREPACK_HOME`, we disable
corepack. Projects that need corepack disabled have the following
criteria:
- Use turbopack (detected by having `turbo` in
`package.json#devDependencies`)
- Use a turbo version lower than 2.1.3 (using the minimum of the range
in `package.json#devDependencies.turbo`)
- Do not include `COREPACK_HOME` in `turbo.json#globalPassThroughEnv`

In the case we disable corepack, we display a helpful warning telling
users how to fix their project:

"Warning: Disabling corepack because it may break your project. To use
corepack, either upgrade to `turbo@2.1.3+` or include `COREPACK_HOME` in
`turbo.json#globalPassThroughEnv`."
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.

2 participants