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

refactor: extract rules_ros2_workspace_deps #254

Merged
merged 3 commits into from
Feb 4, 2024

Conversation

lalten
Copy link
Contributor

@lalten lalten commented Jan 28, 2024

Extracted from / in preparation for #238

No functional or version changes in this one. Only the WORKSPACE incantation changes.

WORKSPACE Outdated
load("//repositories:repositories.bzl", "ros2_repositories")
load("//repositories:repositories.bzl", "ros2_repositories", "rules_ros2_workspace_deps")

rules_ros2_workspace_deps()
Copy link
Owner

@mvukov mvukov Jan 29, 2024

Choose a reason for hiding this comment

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

Can we call this within ros2_repositories()? ... and skip those calls in the workspace files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well yes that's possible, but it would have to be changed back for Bzlmod -- #238 continues to use ros_repositories() for ROS 2 repos, but all the other repos like googletest, asio, websocketpp, ... should be comoing from bzlmod directly.
I think it makes sense to have them separate.

If we really want to keep full backwards compatibility and not require WORKSPACE users to update which setup method is used, we can keep the ros2_repositories name and split out the ROS 2 repos into another macro that will be called directly by the Bzlmod extension. Not a huge fan of this option though because I think the ros2_repositories name would be a misleading.

@mvukov
Copy link
Owner

mvukov commented Jan 30, 2024

I'd move console_bridge, foxglove_bridge and probably also mcap to ros2_repositories() as those are ros-related. WDYT?

@lalten lalten force-pushed the reorg-repositories-bzl branch from e17809b to 4ae7ff8 Compare February 1, 2024 19:34
@lalten lalten requested a review from mvukov February 1, 2024 19:34
@lalten lalten force-pushed the reorg-repositories-bzl branch 3 times, most recently from 02e22d2 to 4b7016b Compare February 1, 2024 20:11
"""Imports external/third-party repositories.
"""
def rules_ros2_workspace_deps():
"""Import http_archive dependencies for the WORKSPACE version of rules_ros2."""
Copy link
Owner

Choose a reason for hiding this comment

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

"""Imports dependent third-party repositories for the non-blzmod (hence, workspace-) version of the repository.

In particular, imports third-party package repositories excluding ROS 2 packages. ROS 2-specific repositories are imported with `ros2_repositories()` macro.
"""

def ros2_repositories():
"""Imports external/third-party repositories.
"""
def rules_ros2_workspace_deps():
Copy link
Owner

Choose a reason for hiding this comment

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

Well, let's be consistent. I'd name this e.g. ros2_workspace_repositories(). IMO, this is still a bit ambiguous compared to ros_repositories, but the docs should do the explanation. IMHO, the suffix should be _repositories, not _deps. We use _deps for configuration of repositories.

Another alternative is to keep this as ros2_repositories and rename the other one as ros2_package_repositories() (which could be more specific).

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't care too much, the best move would be to migrate to Bzlmod and then just drop Workspace altogether :D

@lalten lalten force-pushed the reorg-repositories-bzl branch from 4b7016b to 73f0629 Compare February 3, 2024 11:13
@mvukov mvukov merged commit bf06331 into mvukov:main Feb 4, 2024
6 checks passed
@lalten lalten deleted the reorg-repositories-bzl branch February 4, 2024 12:20
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.

2 participants