yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.39k stars 1.11k forks source link

[Bug?]: Unable to build plugins from sources #4329

Open lehni opened 2 years ago

lehni commented 2 years ago

Self-service

Describe the bug

In order to already use the fix for #4179, I'd like to build yarn 3 from the sources. but sadly this fails for both the plugins I'm currently using: plugin-workspace-tools and plugin-interactive-tools. Both fail with the following error message:

Usage Error: Couldn't find a script named "build:plugin-***"

To reproduce

yarn set version from sources --skip-plugins
yarn plugin import from sources workspace-tools
yarn plugin import from sources interactive-tools

Output

➤ YN0000: Fetching the latest commits

  $ git fetch origin --depth=1 master --force
  $ git reset --hard FETCH_HEAD
  $ git clean -dfx

➤ YN0000: Building a fresh plugin-workspace-tools

Usage Error: Couldn't find a script named "build:plugin-workspace-tools".

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...
➤ YN0001: Child yarn reported an error
➤ YN0001:   Exit Code: 1
➤ YN0000: Failed with errors in 5s 583ms
➤ YN0000: Fetching the latest commits

  $ git fetch origin --depth=1 master --force
  $ git reset --hard FETCH_HEAD
  $ git clean -dfx

➤ YN0000: Building a fresh plugin-interactive-tools

Usage Error: Couldn't find a script named "build:plugin-interactive-tools".

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...
➤ YN0001: Child yarn reported an error
➤ YN0001:   Exit Code: 1
➤ YN0000: Failed with errors in 6s 263ms

Environment

System:
    OS: macOS 12.3.1
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
  Binaries:
    Node: 16.14.2 - /private/var/folders/yn/tgxtk5997sd3mht4mvyzd4gw0000gn/T/xfs-5a4d2f6c/node
    Yarn: 3.2.0-git.20220406.hash-2efb4d4 - /private/var/folders/yn/tgxtk5997sd3mht4mvyzd4gw0000gn/T/xfs-5a4d2f6c/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm

Additional context

I've also tried yarn plugin import without from sources, but this too fails:

yarn plugin import workspace-tools
➤ YN0000: Downloading https://github.com/yarnpkg/berry/raw/@yarnpkg/cli/3.2.0-git.20220406.hash-2efb4d4/packages/plugin-workspace-tools/bin/%40yarnpkg/plugin-workspace-tools.js
➤ YN0035: The remote server failed to provide the requested resource
➤ YN0035:   Response Code: 404 (Not Found)
➤ YN0035:   Request Method: GET
➤ YN0035:   Request URL: https://github.com/yarnpkg/berry/raw/@yarnpkg/cli/3.2.0-git.20220406.hash-2efb4d4/packages/plugin-workspace-tools/bin/%40yarnpkg/plugin-workspace-tools.js
➤ YN0000: Failed with errors in 0s 608ms
yarn plugin import interactive-tools
➤ YN0000: Downloading https://github.com/yarnpkg/berry/raw/@yarnpkg/cli/3.2.0-git.20220406.hash-2efb4d4/packages/plugin-interactive-tools/bin/%40yarnpkg/plugin-interactive-tools.js
➤ YN0035: The remote server failed to provide the requested resource
➤ YN0035:   Response Code: 404 (Not Found)
➤ YN0035:   Request Method: GET
➤ YN0035:   Request URL: https://github.com/yarnpkg/berry/raw/@yarnpkg/cli/3.2.0-git.20220406.hash-2efb4d4/packages/plugin-interactive-tools/bin/%40yarnpkg/plugin-interactive-tools.js
➤ YN0000: Failed with errors in 0s 637ms
arcanis commented 2 years ago

As a workaround remove them from your .yarnrc.yml file and run set version. Starting from Yarn 4 (currently in master), they are now builtins.

lehni commented 2 years ago

When I do that, I get:

➤ YN0000: Saving the new release in .yarn/releases/yarn-sources.cjs

➤ YN0000: Building a fresh plugin-constraints

Usage Error: Couldn't find a script named "build:plugin-constraints".

Also, removing the installed plugins from .yarnrc.yml doesn't cause them to be removed from .yarn/plugins, I've cleared that manually after the above error occured, but it didn't actually change anything.