-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Skip Bazel prefetch in prerequisite installation #22575
Skip Bazel prefetch in prerequisite installation #22575
Conversation
+@jwnimmer-tri for feature review, please! |
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.
Reviewed all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee jwnimmer-tri(platform), needs at least two assigned reviewers, missing label for release notes (waiting on @tyler-yankee)
setup/ubuntu/source_distribution/install_prereqs_user_environment.sh
line 23 at r1 (raw file):
with_bazel=0 ;; # Ignore other source distribution arguments.
Trying to keeping this list in sync with the set of options allowed by other scripts is too brittle, especially since we have zero CI coverage for most of these flags.
Instead, this should should offer a specific argument like --prefetch_bazel
and only run the bazel version
when that argument is supplied.
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Okay, fixed. |
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: 2 unresolved discussions, LGTM missing from assignee jwnimmer-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @tyler-yankee)
setup/ubuntu/install_prereqs.sh
line 106 at r2 (raw file):
user_env_script_args= if [[ "${source_distribution_args[@]}" == *"--developer"* ]] || \ [[ "${source_distribution_args[@]}" == *"--with-bazel"* ]]; then
This is not correct in the presence of args like --without-bazel
. The argument-processing loop above needs to set user_env_script_args=
directly, just like it does the binary and source args.
setup/ubuntu/source_distribution/install_prereqs_user_environment.sh
line 44 at r2 (raw file):
if [[ "${prefetch_bazel}" -eq 1 ]]; then (cd "${workspace_dir}" && bazel version) fi
nit Missing newline at end of file.
20429dd
to
bfeafb1
Compare
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.
Reviewable status: 2 unresolved discussions, LGTM missing from assignee jwnimmer-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @tyler-yankee)
setup/ubuntu/install_prereqs.sh
line 106 at r2 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
This is not correct in the presence of args like
--without-bazel
. The argument-processing loop above needs to setuser_env_script_args=
directly, just like it does the binary and source args.
Fixed.
setup/ubuntu/source_distribution/install_prereqs_user_environment.sh
line 44 at r2 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
nit Missing newline at end of file.
Fixed.
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.
Reviewed all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee jwnimmer-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @tyler-yankee)
setup/ubuntu/install_prereqs.sh
line 49 at r3 (raw file):
;; # Do NOT install bazelisk. --without-bazel)
This case needs to turn off the prefetch (when this flag comes after the --with-bazel).
bfeafb1
to
dc0b509
Compare
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Sorry, I wasn't understanding what you meant before. This change should fix, pending CI checks. |
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.
Reviewed 1 of 2 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: 2 unresolved discussions, LGTM missing from assignee jwnimmer-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @tyler-yankee)
setup/ubuntu/install_prereqs.sh
line 49 at r3 (raw file):
Previously, tyler-yankee wrote…
Sorry, I wasn't understanding what you meant before. This change should fix, pending CI checks.
If I run setup/install_prereqs --with-bazel --without-bazel --with-bazel
the user env command line ends up as:
sudo -u jwnimmer bash setup/ubuntu/source_distribution/install_prereqs_user_environment.sh '' --prefetch-bazel
Note the first argument is an empty string, and so when the user env script runs its while-loop to process the arguments, it stops at the first argument because its empty and fails to prefetch.
It might be easier to set prefetch_bazel=0
and prefetch_bazel=1
while handling the options here, and then turn that into the flag at the last moment when calling the user env script.
setup/ubuntu/install_prereqs.sh
line 51 at r4 (raw file):
--without-bazel) source_distribution_args+=(--without-bazel) # remove prefetch argument if already given
BTW In our C++ style guide we specify that comments must use correct punctuation and grammar, which means that if a comment is a complete sentence then it should be capitalized and end with a period. Even though this is bash code, we still follow that general rule across our whole project.
Suggestion:
Remove prefetch argument if already given.
dc0b509
to
c29865d
Compare
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.
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: LGTM missing from assignee jwnimmer-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @tyler-yankee)
This follows from #22461. When installing
--without-bazel
, we need to skip a step ininstall_prereqs_user_environment
which does a prefetch of the bazelisk download of bazel.This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)