Skip to content

[build-utils] Disable corepack in unsupported Turborepo#12211

Merged
onsclom merged 8 commits intomainfrom
disable-corepack-in-unsupported-turbo
Oct 3, 2024
Merged

[build-utils] Disable corepack in unsupported Turborepo#12211
onsclom merged 8 commits intomainfrom
disable-corepack-in-unsupported-turbo

Conversation

@onsclom
Copy link
Copy Markdown
Contributor

@onsclom onsclom commented Oct 2, 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. [email protected] has COREPACK_HOME in default passthrough, 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. Revert #11871 "Fix corepack packageManager detection on monorepos" #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 [email protected]+ or include COREPACK_HOME in turbo.json#globalPassThroughEnv."

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 2, 2024

🦋 Changeset detected

Latest commit: 488cc27

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@vercel/static-build Patch
@vercel/build-utils Patch
@vercel/hydrogen Patch
@vercel/redwood Patch
@vercel/remix-builder Patch
@vercel/next Patch
vercel Patch
@vercel/client Patch
@vercel/gatsby-plugin-vercel-builder Patch
@vercel/node Patch
@vercel-internals/types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@socket-security
Copy link
Copy Markdown

socket-security bot commented Oct 2, 2024

Copy link
Copy Markdown
Contributor

@jeffsee55 jeffsee55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome tests!

@onsclom onsclom merged commit a6227a5 into main Oct 3, 2024
@onsclom onsclom deleted the disable-corepack-in-unsupported-turbo branch October 3, 2024 21:50
onsclom added a commit that referenced this pull request Oct 4, 2024
…12219)

Reverting #12099

This change was originally reverted because Turborepo did not handle
corepack correctly. Now #12211
mitigates this problem.

---------

Co-authored-by: Trek Glowacki <[email protected]>
onsclom pushed a commit that referenced this pull request Oct 7, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](#12219))

## [email protected]

### Patch Changes

- [cli] Remove documented `--next` option from `target ls`
([#12221](#12221))

- [cli] Add tracking event for Vercel CLI version
([#12212](#12212))

- [cli] Don't send telemetry if debugging
([#12228](#12228))

- [cli] set telemetry enabled to false with VERCEL_TELEMETRY_DISABLED
([#12229](#12229))

- [cli] use `ms` for timeout values
([#12220](#12220))

- Add tracking events for platform, arch, and cpu_count.
([#12190](#12190))

- Add support for telemetry debugging via VERCEL_TELEMETRY_DEBUG.
Telemetry collection is not currently enabled and when it is, will be a
major version bump for the CLI.
([#12209](#12209))

- [cli] Remove incorrect --output docs for `vercel certs`
([#12230](#12230))

- Updated dependencies
\[[`a6227a56d7feec77b5355d2cd5fc07f151021d73`](a6227a5),
[`e312d610177b28cf1592b18ca85b8d4e088ffc05`](e312d61)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`a6227a56d7feec77b5355d2cd5fc07f151021d73`](a6227a5),
[`e312d610177b28cf1592b18ca85b8d4e088ffc05`](e312d61)]:
    -   @vercel/[email protected]

## @vercel/functions@1.4.2

### Patch Changes

- [functions] decode city name
([#12234](#12234))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`a6227a56d7feec77b5355d2cd5fc07f151021d73`](a6227a5),
[`e312d610177b28cf1592b18ca85b8d4e088ffc05`](e312d61)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](#12219))

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](#12219))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`a6227a56d7feec77b5355d2cd5fc07f151021d73`](a6227a5),
[`e312d610177b28cf1592b18ca85b8d4e088ffc05`](e312d61)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](#12219))

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](#12219))

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](#12219))

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`a6227a56d7feec77b5355d2cd5fc07f151021d73`](a6227a5),
[`e312d610177b28cf1592b18ca85b8d4e088ffc05`](e312d61)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
…12219)

Reverting vercel/vercel#12099

This change was originally reverted because Turborepo did not handle
corepack correctly. Now vercel/vercel#12211
mitigates this problem.

---------

Co-authored-by: Trek Glowacki <[email protected]>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](vercel/vercel#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](vercel/vercel#12219))

## [email protected]

### Patch Changes

- [cli] Remove documented `--next` option from `target ls`
([#12221](vercel/vercel#12221))

- [cli] Add tracking event for Vercel CLI version
([#12212](vercel/vercel#12212))

- [cli] Don't send telemetry if debugging
([#12228](vercel/vercel#12228))

- [cli] set telemetry enabled to false with VERCEL_TELEMETRY_DISABLED
([#12229](vercel/vercel#12229))

- [cli] use `ms` for timeout values
([#12220](vercel/vercel#12220))

- Add tracking events for platform, arch, and cpu_count.
([#12190](vercel/vercel#12190))

- Add support for telemetry debugging via VERCEL_TELEMETRY_DEBUG.
Telemetry collection is not currently enabled and when it is, will be a
major version bump for the CLI.
([#12209](vercel/vercel#12209))

- [cli] Remove incorrect --output docs for `vercel certs`
([#12230](vercel/vercel#12230))

- Updated dependencies
\[[`10f939c5c9637f7fdc12b417fcd1dbed7ae336f4`](vercel/vercel@10f939c),
[`1aa81addc6336dbdf3daf5aa3aa86b8dc46b67d2`](vercel/vercel@1aa81ad)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`10f939c5c9637f7fdc12b417fcd1dbed7ae336f4`](vercel/vercel@10f939c),
[`1aa81addc6336dbdf3daf5aa3aa86b8dc46b67d2`](vercel/vercel@1aa81ad)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- [functions] decode city name
([#12234](vercel/vercel#12234))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`10f939c5c9637f7fdc12b417fcd1dbed7ae336f4`](vercel/vercel@10f939c),
[`1aa81addc6336dbdf3daf5aa3aa86b8dc46b67d2`](vercel/vercel@1aa81ad)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](vercel/vercel#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](vercel/vercel#12219))

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](vercel/vercel#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](vercel/vercel#12219))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`10f939c5c9637f7fdc12b417fcd1dbed7ae336f4`](vercel/vercel@10f939c),
[`1aa81addc6336dbdf3daf5aa3aa86b8dc46b67d2`](vercel/vercel@1aa81ad)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](vercel/vercel#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](vercel/vercel#12219))

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](vercel/vercel#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](vercel/vercel#12219))

## @vercel/[email protected]

### Patch Changes

- Disable corepack when Turborepo does not support `COREPACK_HOME`
([#12211](vercel/vercel#12211))

- Fix corepack `packageManager` detection on monorepos
([#12219](vercel/vercel#12219))

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`10f939c5c9637f7fdc12b417fcd1dbed7ae336f4`](vercel/vercel@10f939c),
[`1aa81addc6336dbdf3daf5aa3aa86b8dc46b67d2`](vercel/vercel@1aa81ad)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

3 participants