Skip to content

RFC: Rename workspace from io_bazel_rules_rust to rules_rust #499

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

Closed
UebelAndre opened this issue Nov 20, 2020 · 7 comments · Fixed by #500
Closed

RFC: Rename workspace from io_bazel_rules_rust to rules_rust #499

UebelAndre opened this issue Nov 20, 2020 · 7 comments · Fixed by #500

Comments

@UebelAndre
Copy link
Collaborator

According to https://docs.bazel.build/versions/master/skylark/deploying.html#workspace these rules should be named rules_rust. I think they should be renamed. Maybe for backwards compatibility the rust_workspace macro could define a bind for users to ease the transition but I'd definitely like to see this changed.

What are the concerns in doing this?

@mfarrugi
Copy link
Collaborator

+1

I imagine for most cases a sd 'io_bazel_rules_rust' 'rules_rust' **/* would suffice.

@UebelAndre
Copy link
Collaborator Author

I've opened #500 for the conversion. Given that there are no releases (which I think there should be, per #415) I'm unsure how the transition should be communicated. I did the same thing rules_python did in bazel-contrib/rules_python#212 by in the way of messaging for users within the code.

@acmcarther
Copy link
Collaborator

This should probably not be merged. This ruleset is named "io_bazel" to be consistent with the other rules defined in the bazelbuild org.

See rules go: https://github.com/bazelbuild/rules_go. Their workspace is named "io_bazel_rules_go". I don't know the history behind this naming scheme, but I do know that rules_go has "high-tier" support internally, so we should follow their lead on things.

I'm going to mirror this into the issue.

@UebelAndre
Copy link
Collaborator Author

UebelAndre commented Dec 22, 2020

This should probably not be merged. This ruleset is named "io_bazel" to be consistent with the other rules defined in the bazelbuild org.

See rules go: https://github.com/bazelbuild/rules_go. Their workspace is named "io_bazel_rules_go". I don't know the history behind this naming scheme, but I do know that rules_go has "high-tier" support internally, so we should follow their lead on things.

I'm going to mirror this into the issue.

This is in direct violation of the documentation in https://docs.bazel.build/versions/master/skylark/deploying.html#workspace

If your rules belong to the bazelbuild organization, you must use rules_ (e.g. rules_mockascript)

I would assert either that documentation needs to change or this PR should be merged in a reasonable time.

@damienmg
Copy link
Collaborator

Yep this documentation is pretty recent and I found some more context in bazel-dev@. Historically we took the decision to recommend reverse qualified domain name as naming convention (like Go) but it seems they prefer shorter name and use github orgs for rules.

Bazel initial domain was bazel.io. A few month after new TLD appeared and .build was a natural home for a build system.

damienmg pushed a commit that referenced this issue Jan 27, 2021
Generated by running
```bash
LANG=C sed -i '' -e 's/io_bazel_rules_rust/rules_rust/' $(find . -type f -not -path "./.git/*")
```

There's some small amount of sorting in here as well (based on the new name)

Closes #499

Blocked by google/cargo-raze#298 and google/cargo-raze#304
@vincent-herlemont
Copy link

I have this error and there is no occurrences of io_bazel_rules_rust in all my project. An idea of investigation ?

ERROR: Failed to load Starlark extension '@io_bazel_rules_rust//rust:rust.bzl'.
Cycle in the workspace file detected. This indicates that a repository is used prior to being defined.
The following chain of repository dependencies lead to the missing definition.
 - @io_bazel_rules_rust
This could either mean you have to add the '@io_bazel_rules_rust' repository with a statement like `http_archive` in your WORKSPACE file (note that transitive dependencies are not added automatically), or move an existing definition earlier in your WORKSPACE file.

@UebelAndre
Copy link
Collaborator Author

Perhaps you're loading a some file from something that expects the old name? Does Bazel not tell you where that load is happening?

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 a pull request may close this issue.

5 participants