-
Notifications
You must be signed in to change notification settings - Fork 52
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
Conditional sudo use in scripts (and README consistency) #362
base: main
Are you sure you want to change the base?
Conversation
9123909
to
4b10196
Compare
The one file that isn't converted to the new system here is |
+@BetsyMcPhail 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.
In the Linux portion of drake_cmake_installed/setup/install_prereqs
, the same maybe_sudo
logic should be applied.
Reviewed 17 of 18 files at r1, all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee betsymcphail, platform LGTM missing (waiting on @tyler-yankee)
drake_bazel_external/.github/setup
line 6 at r1 (raw file):
set -euxo pipefail maybe_sudo=
All of the files in the .github subdirectories are only called by CI. We control the CI environment so don't need to do the maybe_sudo
check.
0ef9f14
to
c675165
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.
Fixed.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee betsymcphail, platform LGTM missing (waiting on @BetsyMcPhail)
drake_bazel_external/.github/setup
line 6 at r1 (raw file):
Previously, BetsyMcPhail (Betsy McPhail) wrote…
All of the files in the .github subdirectories are only called by CI. We control the CI environment so don't need to do the
maybe_sudo
check.
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 8 of 8 files at r2, all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee betsymcphail, platform LGTM missing (waiting on @tyler-yankee)
drake_cmake_installed/setup/install_prereqs
line 92 at r2 (raw file):
echo -e "\ndrake VERSION.TXT: $(cat /opt/drake/share/doc/drake/VERSION.TXT)\n" /opt/drake/share/drake/setup/install_prereqs
When this is run locally, does this require sudo on Ubuntu?
c675165
to
60d5e26
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 r3, all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee betsymcphail, platform LGTM missing (waiting on @tyler-yankee)
drake_cmake_installed/setup/install_prereqs
line 92 at r2 (raw file):
Previously, BetsyMcPhail (Betsy McPhail) wrote…
When this is run locally, does this require sudo on Ubuntu?
I should have been more clear. I believe this will require sudo on Ubuntu but NOT on Mac. This PR needs a rebase after the /opt changes, which may make the changes in this file more clear.
Previously, BetsyMcPhail (Betsy McPhail) wrote…
Sorry, forgot to hit "send" on my comment from earlier. My changes should achieve this. I'll rebase this shortly so it's ready to go. |
451b2af
to
c92e2b5
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 11 of 11 files at r4, all commit messages.
Reviewable status: complete! all discussions resolved, platform LGTM from [betsymcphail] (waiting on @tyler-yankee)
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.
+@jwnimmer-tri - would you prefer to platform review this or assign it to the on-call reviewer?
Reviewable status: all discussions resolved, LGTM missing from assignee jwnimmer-tri, platform LGTM from [betsymcphail] (waiting on @jwnimmer-tri)
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 7 of 18 files at r1, 11 of 11 files at r4, all commit messages.
Reviewable status: 5 unresolved discussions, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @tyler-yankee)
drake_cmake_installed/setup/install_prereqs
line 6 at r4 (raw file):
# All rights reserved. # # Redistribution and use in source and binary forms, with or without
BTW Yuck, I guess I missed this file in #361.
I just went back through the history of this file and the only non-relicenseable commit in its ancestry was #181, and I'll say it's been sufficiently rewritten since then that the commit is no longer relevant.
So either in this PR, or in a separate one, please delete this license text and replace with our standard SPDX MIT-0 line.
drake_cmake_installed/setup/install_prereqs
line 41 at r4 (raw file):
exit 1 fi maybe_sudo= # assign empty for later call to install source prereqs
It seems to me like assigning the empty string should happen prior to the case ...
beginning, since we need it to be defined no matter which branch was taken.
drake_cmake_installed/setup/install_prereqs
line 76 at r4 (raw file):
tar -xf drake.tar.gz -C $HOME ${maybe_sudo} apt-get update
nit This line is (was) redundant. We already apt-updated on line 56, above.
drake_cmake_installed/setup/install_prereqs
line 88 at r4 (raw file):
# Install the source prereqs ${maybe_sudo} ${HOME}/drake/share/drake/setup/install_prereqs
See https://drake.mit.edu/from_source.html#building-with-cmake.
This command has bitrotted (no longer matches our documentation). The correct command is drake/setup/install_prereqs
(without sudo).
drake_cmake_external/setup/install_prereqs
line 26 at r4 (raw file):
# Install the source prereqs ${maybe_sudo} drake-master/setup/ubuntu/install_prereqs.sh
See https://drake.mit.edu/from_source.html#building-with-cmake.
This command has bitrotted (no longer matches our documentation). The correct command is drake/setup/install_prereqs
(without sudo).
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: 5 unresolved discussions, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @jwnimmer-tri and @tyler-yankee)
drake_cmake_external/setup/install_prereqs
line 26 at r4 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
See https://drake.mit.edu/from_source.html#building-with-cmake.
This command has bitrotted (no longer matches our documentation). The correct command is
drake/setup/install_prereqs
(without sudo).
Do the bazel_external
and bazel_external_legacy
examples need a similar update?
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: 5 unresolved discussions, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @BetsyMcPhail and @tyler-yankee)
drake_cmake_external/setup/install_prereqs
line 26 at r4 (raw file):
Previously, BetsyMcPhail (Betsy McPhail) wrote…
Do the
bazel_external
andbazel_external_legacy
examples need a similar update?
Our https://drake.mit.edu/from_source.html section for bazel actually just points to the DEE code as the source of truth, so there isn't any defect with things being out of sync.
I'm thinking to just leave alone the bazel side for now, since it already has some TODOs with bazelisk which I'd rather just all solve at the same time.
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: 5 unresolved discussions, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @jwnimmer-tri and @tyler-yankee)
drake_cmake_external/setup/install_prereqs
line 26 at r4 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Our https://drake.mit.edu/from_source.html section for bazel actually just points to the DEE code as the source of truth, so there isn't any defect with things being out of sync.
I'm thinking to just leave alone the bazel side for now, since it already has some TODOs with bazelisk which I'd rather just all solve at the same time.
Sounds good to me.
c92e2b5
to
a3c2827
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: 5 unresolved discussions, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @jwnimmer-tri)
drake_cmake_external/setup/install_prereqs
line 26 at r4 (raw file):
Previously, BetsyMcPhail (Betsy McPhail) wrote…
Sounds good to me.
Fixed (and verified locally).
drake_cmake_installed/setup/install_prereqs
line 41 at r4 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
It seems to me like assigning the empty string should happen prior to the
case ...
beginning, since we need it to be defined no matter which branch was taken.
Good catch, this is cleaner; fixed.
drake_cmake_installed/setup/install_prereqs
line 76 at r4 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
nit This line is (was) redundant. We already apt-updated on line 56, above.
Fixed.
drake_cmake_installed/setup/install_prereqs
line 88 at r4 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
See https://drake.mit.edu/from_source.html#building-with-cmake.
This command has bitrotted (no longer matches our documentation). The correct command is
drake/setup/install_prereqs
(without sudo).
Here, install_prereqs
gets the latest nightly release of Drake. From the top-level, drake/setup/install_prereqs
doesn't exist, and calling drake/share/drake/setup/install_prereqs
requires running as root.
Previously, tyler-yankee wrote…
Leaving the bazel side alone for now means temporarily removing it from the |
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 r5, all commit messages.
Reviewable status: 2 unresolved discussions, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @BetsyMcPhail and @tyler-yankee)
drake_cmake_external/setup/install_prereqs
line 26 at r4 (raw file):
Previously, tyler-yankee wrote…
Leaving the bazel side alone for now means temporarily removing it from the
file_sync
. Currently,drake_bazel_external/setup/install_prereqs
anddrake_cmake_external/setup/install_prereqs
should be identical.
I'm okay with de-sync. Or, if doing the same change to the bazel side actually succeeds, I'm okay changing bazel, too. (I only wanted to avoid complicated, novel changes on the bazel side.)
drake_cmake_installed/setup/install_prereqs
line 88 at r4 (raw file):
Previously, tyler-yankee wrote…
Here,
install_prereqs
gets the latest nightly release of Drake. From the top-level,drake/setup/install_prereqs
doesn't exist, and callingdrake/share/drake/setup/install_prereqs
requires running as root.
Oops, right, this is cmake_installed not cmake_external. Withdrawn.
a3c2827
to
e22e3c0
Compare
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
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 9 of 9 files at r6, all commit messages.
Reviewable status: complete! all discussions resolved, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @tyler-yankee)
e22e3c0
to
3d55001
Compare
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Changing the bazel script and running |
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 r7, all commit messages.
Reviewable status: complete! all discussions resolved, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @tyler-yankee)
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: 1 unresolved discussion, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @tyler-yankee)
a discussion (no related file):
The Jenkins error looks real.
Part of the problem is that the DEE examples that use bazel need to opt-in to installing it now. The new prereqs script has it off by default ...
... so we need --with-bazel
in the DEE install_prereqs script (for the bazel_external only, not for the cmake_external).
The problem with cmake_external is actually a latent but in Drake's setup script. The prefetching ...
... should be skipped if we're operating in --without-bazel
mode.
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Thanks for explaining those. Fixed the bazel examples (hopefully Jenkins is happy), and I can work on fixing the Drake script separately. |
d8c6c79
to
76b8c6c
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 10 of 10 files at r8, all commit messages.
Reviewable status: complete! all discussions resolved, platform LGTM from [betsymcphail, jwnimmer-tri] (waiting on @tyler-yankee)
This addresses #359, and serves as a follow-up to #357.
This change is