-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
lib: log as yes/no whether build dir was created #2370
lib: log as yes/no whether build dir was created #2370
Conversation
This bit of logging apparently expected to be given a boolean, but was receiving either a path or undefined based on the result of fs.mkdir. Now it prints either "Yes" or "No", rather than printing either a path or "undefined", respectively.
I think the path is more helpful? undefined might be ugly but is it worth fixing it for just that case? |
Logging the path is very helpful, but it is already logged immediately before, so printing it again is redundant.
I think that's a subjective decision for the maintainers to make. But I think the current logging is confusing, in a way that seems like an accident or oversight. (When printing If maintainers prefer it to print something more-easily understood, like I have done in this PR, they can click a button to merge this. (Okay they also have to figure out the P.S. Now that I am thinking explicitly about maintainers' time... I have hidden away the long explanation in the PR body behind a |
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.
LGTM, given the earlier log.verbose('build dir', 'attempting to create "build" dir: %s', buildDir)
a few lines above.
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.
ah overlooked that you said it is dupe printing it, you've got a point :)
Checklist
npm install && npm test
passesDescription of change
When logging
"build" dir needed to be created?
, put "Yes" or "No" instead of[path that was created]
orundefined
.There is a bit of verbose logging in the package that informs the user whether the build dir needed to be created (as opposed to having already been there from a previous
node-gyp configure
run).This bit of logging apparently expected to be given a boolean, but was receiving either a path or
undefined
based on the result offs.mkdir()
. So it was logging either the path of the build dir that was just created orundefined
, somewhat nonsensically if you don't know what's going on behind the scenes.Now it prints either "Yes" or "No".
Before:
gyp verb build dir "build" dir needed to be created? /Users/[user]/[package-name]/build
,gyp verb build dir "build" dir needed to be created? undefined
After:
gyp verb build dir "build" dir needed to be created? Yes
,gyp verb build dir "build" dir needed to be created? No
Note: The CI failure was a timeout on a single Ubuntu run. All other runs passed. This happens to me seemingly at random/as flakiness. I don't think it is caused by this tiny PR. CI passed for this commit at my fork: https://github.com/DeeDeeG/node-gyp/actions/runs/739328726 I believe it would pass here if re-run.