-
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 the location for yarn-error.log and add a test case #2870
fix the location for yarn-error.log and add a test case #2870
Conversation
It seems that CircleCI is timing out on On Travis all succeeded, but the 1 job on OS X is failing. That might be a mac related issue. |
On all CI's, the integration test is timing out. However, our own test case is not the culprit any longer. The last commit fixes the path issue on OS X. |
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.
Yarn puts the error log into CWD the same way npm does.
Why would we want it in cache folder?
@@ -362,7 +362,7 @@ config.init({ | |||
binLinks: commander.binLinks, | |||
modulesFolder: commander.modulesFolder, | |||
globalFolder: commander.globalFolder, | |||
cacheRootFolder: commander.cacheFolder, | |||
cacheFolder: commander.cacheFolder, |
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.
This is done on purpose afaik.
@arcanis we probably need to add a comment here.
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.
This probably does need a change to either _cacheRootFolder
or cacheFolder
since cacheRootFolder
does not exist in the configOptions export type. The reason for this change was the cache folder location not changing when setting it with the --cache-folder
command (see #2881).
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.
Yep the specific line where this is used is here: https://github.com/yarnpkg/yarn/blob/master/src/config.js#L241
In order to prevent BC break we decided to keep using cacheFolder
in the public interface instead of cacheRootFolder
, but it seems I forgot one. Good catch @clanghout!
Since the release of npm v4.2.0 the error logs are placed in the cache folder instead of the CWD:
source: npm release v4.2.0. |
Using |
Still it seems weird to have the error in the cache folder. |
I guess doing same as npm with |
Summary
In order to change the folder where
yarn-error.log
is placed, we changed the path fromconfig.cwd
toconfig.cacheFolder
. In the process of testing we also discovered a bug with specifying a cache folder from the command line.The test executes a command that will error a
yarn-error.log
and verifies that this log is created in the specified cache folder.Fixes #2719
Test plan
Run
yarn test
or by hand: run the command
yarn tag rm non-existing-pkg non-existing-tag
and press enter, then verify that the reporter put the error log in the cache folder.