Skip to content
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

[drake_cmake_external] Add test case to disable solver #370

Merged
merged 9 commits into from
Feb 25, 2025

Conversation

tyler-yankee
Copy link
Collaborator

@tyler-yankee tyler-yankee commented Feb 13, 2025

Addresses #22547. See #22626 for the change on Drake. This change adds a unit test to drake_cmake_external to test by disabling the CSDP solver.

Tested locally by changing the URL pointed to by ExternalProject_Add(drake) to the feature branch on Drake.


This change is Reviewable

Copy link
Collaborator Author

@tyler-yankee tyler-yankee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+@jwnimmer-tri for feature review, please!

Reviewable status: all discussions resolved, LGTM missing from assignee jwnimmer-tri, platform LGTM missing (waiting on @jwnimmer-tri)

Copy link
Collaborator Author

@tyler-yankee tyler-yankee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the CI failure in Jenkins is expected, since it's using Drake master which doesn't yet have the CMake solver opt-out flags.

Reviewable status: all discussions resolved, LGTM missing from assignee jwnimmer-tri, platform LGTM missing (waiting on @jwnimmer-tri)

@jwnimmer-tri
Copy link
Contributor

Note that the CI failure in Jenkins is expected, since it's using Drake master which doesn't yet have the CMake solver opt-out flags.

A nice tool we sometimes use in cases like this is to temporarily add a commit here that re-points Drake to the pull request instead of master, so CI here will shine light. Then after the Drake PR lands, we revert that edit.

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: 2 unresolved discussions, LGTM missing from assignee jwnimmer-tri, platform LGTM missing


drake_cmake_external/drake_external_examples/solver_disabled_test.py line 4 at r2 (raw file):

"""
Provides an example of disabling the open-source CSDP solver.

nit This doesn't quite smell right to me.

It seems more clear would be something along the lines of "Our CMakeLists.txt file disabled the CSDP solver as part of the Drake build. Here, we'll check that the opt-out succeeded."

Code quote:

Provides an example of

drake_cmake_external/CMakeLists.txt line 115 at r2 (raw file):

    -DWITH_USER_FMT:BOOLEAN=ON
    -DWITH_USER_SPDLOG:BOOLEAN=ON
    -DWITH_CSDP:BOOLEAN=OFF

nit A first-time Drake user will not be able to understand why this line is here. We should have an expository comment here or nearby that is sufficient for them to not be confused.

Perhaps something like "The Drake build has options to turn features on/off. See https://drake.mit.edu/from_source.html for the full list. Here, we demonstrate how to set an arbitrary option."?

Copy link
Collaborator Author

@tyler-yankee tyler-yankee left a 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 LGTM missing (waiting on @jwnimmer-tri)


drake_cmake_external/CMakeLists.txt line 115 at r2 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

nit A first-time Drake user will not be able to understand why this line is here. We should have an expository comment here or nearby that is sufficient for them to not be confused.

Perhaps something like "The Drake build has options to turn features on/off. See https://drake.mit.edu/from_source.html for the full list. Here, we demonstrate how to set an arbitrary option."?

Yes, agreed. I added that comment and included a note about it corresponding to one of the open-source dependencies.


drake_cmake_external/drake_external_examples/solver_disabled_test.py line 4 at r2 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

nit This doesn't quite smell right to me.

It seems more clear would be something along the lines of "Our CMakeLists.txt file disabled the CSDP solver as part of the Drake build. Here, we'll check that the opt-out succeeded."

Yes, that makes sense. I replaced that comment.

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 2 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: 1 unresolved discussion, platform LGTM from [jwnimmer-tri] (waiting on @tyler-yankee)


drake_cmake_external/CMakeLists.txt line 98 at r4 (raw file):

ExternalProject_Add(drake
  DEPENDS eigen fmt spdlog
  URL https://github.com/RobotLocomotion/drake/archive/master.tar.gz

Working

Reminder to myself to make sure we revert this before landing the PR.

@jwnimmer-tri
Copy link
Contributor

BTW the new test case is actually failing...

@tyler-yankee
Copy link
Collaborator Author

Yeah, I'm looking into it now. Something weird is going on with the types on the options defined by the function.

@tyler-yankee
Copy link
Collaborator Author

drake_cmake_external/CMakeLists.txt line 119 at r4 (raw file):

    # Here, we demonstrate how to set an arbitrary option
    # for one of the open-source dependencies.
    -DWITH_CSDP:BOOLEAN=OFF

By the way, these options should technically be defined as BOOL, not BOOLEAN. It's a non-breaking syntax error that should only be affecting how it would show up in the CMake GUI. Should this be changed, and if so, in this PR?

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a 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, platform LGTM from [jwnimmer-tri] (waiting on @tyler-yankee)


drake_cmake_external/CMakeLists.txt line 119 at r4 (raw file):

Should this be changed, ....

That's a question for the Kitware side. I don't know enough about CMake to have an opinion here.

... and if so, in this PR?

I'm OK with whatever PR split or non-split you decide.

@tyler-yankee
Copy link
Collaborator Author

drake_cmake_external/CMakeLists.txt line 119 at r4 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

Should this be changed, ....

That's a question for the Kitware side. I don't know enough about CMake to have an opinion here.

... and if so, in this PR?

I'm OK with whatever PR split or non-split you decide.

@BetsyMcPhail: could you take a look at this?

@tyler-yankee
Copy link
Collaborator Author

Provisioning script flaked on one of the Bazel examples in Jenkins, rebuilding ...

@tyler-yankee
Copy link
Collaborator Author

Okay, CI is all happy again. I had a couple of bugs in the new function to work out.

Copy link
Contributor

@BetsyMcPhail BetsyMcPhail left a 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, platform LGTM from [jwnimmer-tri] (waiting on @jwnimmer-tri and @tyler-yankee)


drake_cmake_external/CMakeLists.txt line 119 at r4 (raw file):

Previously, tyler-yankee wrote…

@BetsyMcPhail: could you take a look at this?

I think we should update all of these to use BOOL.

Copy link
Contributor

@BetsyMcPhail BetsyMcPhail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: (modulo the test-only code being removed)

Reviewable status: 1 unresolved discussion, platform LGTM from [jwnimmer-tri, betsymcphail] (waiting on @jwnimmer-tri)

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: 1 unresolved discussion, platform LGTM from [jwnimmer-tri, betsymcphail] (waiting on @tyler-yankee)

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a 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 r8, all commit messages.
Reviewable status: 1 unresolved discussion, platform LGTM from [jwnimmer-tri, betsymcphail] (waiting on @jwnimmer-tri)


drake_cmake_external/CMakeLists.txt line 98 at r4 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

Working

Reminder to myself to make sure we revert this before landing the PR.

Tomorrow morning, hopefully the new nightly build packages will be usable here.

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a 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 [jwnimmer-tri, betsymcphail] (waiting on @tyler-yankee)

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a 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 r9, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, platform LGTM from [jwnimmer-tri, betsymcphail] (waiting on @tyler-yankee)

@jwnimmer-tri jwnimmer-tri merged commit 7cbadd2 into RobotLocomotion:main Feb 25, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants