-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix(run): add cwd/node_modules/.bin to run command search path #7151
fix(run): add cwd/node_modules/.bin to run command search path #7151
Conversation
…nds. Fixes run in workspaces. This fixes a bug that was introduced in yarnpkg#6850 where the bin path was being built only from `config.lockfileFolder`. However in workspaces, bins may not be hoisted to the workspace root, causing bins to not be found. This change adds `config.cwd` to the bin search path, so the `yarn run` command will look in a workspace package's node_modules, as well as the workspace root. fixes yarnpkg#7126
|
Can this be prioritized please? It is totally broken right now for workspaces mono repos. |
Can this please get prioritized/merged? This is a huge issue in mono-repos |
@rally25rs can you update this PR to resolve the conflicts? In my project, I'm currently pinned on Yarn 1.14 because of the regression caused by #6850. I'd love to get back to current if we could get this PR through. The change seems ready to go if we got the conflicts fixed and could get review on it. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks legit, thanks @rally25rs! Merge at will.
I'll resolve it this evening and get this merged. Thanks @arcanis and @jasonmobley |
@arcanis the "yarn acceptance tests" had 1 failing test, only on node 8, however those tests pass locally on node 8 for me. Is there a way to re-run that test and see if it was just a hiccup in the CI test? I didn't see a "rerun" button anywhere for that test suite. |
For some reason I cannot log into Azure, it makes an infinite loop of signin in and immediately signing out ... 🤷♀️ The timeout doesn't look critical to me, let's merge. I'll make a patch release later this week. |
How does this work with |
|
Not my question. To me it looks like the current code will look in |
* fix(run): change run command to check cwd/node_modules/.bin for commands. Fixes run in workspaces. This fixes a bug that was introduced in #6850 where the bin path was being built only from `config.lockfileFolder`. However in workspaces, bins may not be hoisted to the workspace root, causing bins to not be found. This change adds `config.cwd` to the bin search path, so the `yarn run` command will look in a workspace package's node_modules, as well as the workspace root. fixes #7126 * modify chagelog
…kg#7151) * fix(run): change run command to check cwd/node_modules/.bin for commands. Fixes run in workspaces. This fixes a bug that was introduced in yarnpkg#6850 where the bin path was being built only from `config.lockfileFolder`. However in workspaces, bins may not be hoisted to the workspace root, causing bins to not be found. This change adds `config.cwd` to the bin search path, so the `yarn run` command will look in a workspace package's node_modules, as well as the workspace root. fixes yarnpkg#7126 * modify chagelog
…kg#7151) * fix(run): change run command to check cwd/node_modules/.bin for commands. Fixes run in workspaces. This fixes a bug that was introduced in yarnpkg#6850 where the bin path was being built only from `config.lockfileFolder`. However in workspaces, bins may not be hoisted to the workspace root, causing bins to not be found. This change adds `config.cwd` to the bin search path, so the `yarn run` command will look in a workspace package's node_modules, as well as the workspace root. fixes yarnpkg#7126 * modify chagelog
Summary
This fixes a bug that was introduced in #6850 where the bin path was being built only from
config.lockfileFolder
. However in workspaces, bins may not be hoisted to the workspace root,causing bins to not be found. This change adds
config.cwd
to the bin search path, so theyarn run
command will look in a workspace package's node_modules, as well as the workspace root.fixes #7126
Test plan
Changed as existing test that placed a bin at both the workspace root and in a package. Split into 2 tests, one with the bin only at the workspace root, the other with the bin only in the package. This way we are testing that we can detect the bin in either location.