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
build: use cross platform workspace_status_command #27431
Conversation
tools/bazel_stamp_vars.js
Outdated
// See https://github.com/bazelbuild/bazel/issues/5958 | ||
// Note: git operations, especially git status, take a long time inside mounted docker volumes | ||
// in Windows or OSX hosts (https://github.com/docker/for-win/issues/188). | ||
// To bypass this script use `--workspace_status_command=`, in the command line or in a rc file. |
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.
can remove this line, the workspace_status_command is opt-in now
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.
Done
tools/bazel_stamp_vars.js
Outdated
// in Windows or OSX hosts (https://github.com/docker/for-win/issues/188). | ||
// To bypass this script use `--workspace_status_command=`, in the command line or in a rc file. | ||
const execSync = require('child_process').execSync; | ||
const _exec = (str => execSync(str).toString().trim()); |
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.
nit: style guide in google3 is to prefer
function _exec() {}
over
const _exec = () => {}
since they are equivalent and the former was the previous idiom
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.
Done
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.
Wow, sounds like a bad guideline to me 😁
It is more verbose and not 100% equivalent 😞
Is the preference to also use functions and protypes instead of classes? 😛
tools/bazel_stamp_vars.js
Outdated
console.error('Running', process.argv.join(' ')); | ||
|
||
function onError() { | ||
console.log('Failed to execute:,', process.argv.join(' ')); |
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.
should these be printed to stderr instead?
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.
Done
tools/bazel_stamp_vars.js
Outdated
console.log(`No git tags found, can't stamp the build.`); | ||
console.log('Either fetch the tags:'); | ||
console.log(' git fetch git@github.com:angular/angular.git --tags'); | ||
console.log('or build without stamping by giving an empty workspace_status_command:'); |
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.
I think this needs an update since workspace_status_command is now opt-in
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.
Updated to just ask the user to fetch the tags.
f918cac
to
76a1b92
Compare
76a1b92
to
0812d36
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The
workspace_status_command
is a .sh script and thus does not properly run on windows.What is the new behavior?
The command is a node script instead. This is the workaround suggested in bazelbuild/bazel#4802.
Does this PR introduce a breaking change?
Other information
cc @alexeagle