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

bzlmod examples and documentation updates #18030

Open
chrislovecnm opened this issue Apr 11, 2023 · 1 comment
Open

bzlmod examples and documentation updates #18030

chrislovecnm opened this issue Apr 11, 2023 · 1 comment
Assignees
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests help wanted Someone outside the Bazel team could own this P2 We'll consider working on this in future. (Assignee optional) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: documentation (cleanup)

Comments

@chrislovecnm
Copy link

Page link:

https://bazel.build/external/overview#bzlmod

Problem description (include actual vs expected text, if applicable):

Problem Statement

We have multiple things that have changed when using bzlmod that I have struggled to learn. Through updating and working with the rules_python examples and working on a Python tutorial, I have some experiences that I would like to share. Migration is challenging, no matter what we do. I aim to inform users why we are migrating to bzlmod and give them the documentation and example to help their journey.

Recommendations

  • Improve the documentation on our primary website.
    • Improve the level of detail in the documentation and walk a user through the changes.
    • The site needs to spell out why users should do this. We plan to deprecate WORKSPACE files, and we should tell them that.
    • Document what extensions are, how to use extensions, and maybe when and how to write your extensions.
  • Have each rule set have a reasonably complex example.
  • Have each rule set include documentation in their README.md around bzlmod.
    • how to configure a MODULE.bzl file and the changes from using a WORKSPACE file.
    • the current support for bzlmod
  • Provide documentation that links to examples and documentation in an issue or a document that helps users understand where each rule is at with bzlmod support

My experience

Here are some notes from my experience with using bzlmod.

  • The syntax has changed with bzlmod. I am used to configuring a WORKSPACE file but need more documentation for the syntax used within the MODULES.bzl file.
  • We have some examples using bzlmod, but the documentation within those examples is a bit light. Also, finding those examples takes a lot of work.
  • The principle of what an extension is and how to use them needs to be well documented.
  • We have depreciated using various parts of bazel. For instance, native.register_toolchain is no longer available.
  • Certain error messages with bzlmod are misleading. For example, when you try to enable downloading of a toolchain within an extension, the error tells you to use a BUILD file.
  • We need a list of where various modules are for adopting bzlmod.
  • Using a WORKSPACE.bzl needs to be better documented.
  • How to use other modules (sub-modules) within a mono repo needs to be better documented.
  • Extensions need to be documented on how to use them. We have extensions with parameters, but we need to demonstrate how to use those parameters.

Resources

https://bazel.build/external/overview#bzlmod
bazelbuild/rules_rust#1528
https://docs.google.com/document/d/1JtXIVnXyFZ4bmbiBCr5gsTH4-opZAFf5DMMb-54kES0/edit#heading=h.5mcn15i0e1ch

Where do you see this issue? (include link to specific section of the page, if applicable)

No response

Any other information you'd like to share?

No response

@chrislovecnm chrislovecnm added team-Documentation Documentation improvements that cannot be directly linked to other team labels type: documentation (cleanup) untriaged labels Apr 11, 2023
@meteorcloudy meteorcloudy added area-Bzlmod Bzlmod-specific PRs, issues, and feature requests team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. and removed untriaged labels Apr 11, 2023
@meteorcloudy meteorcloudy added the P1 I'll work on this now. (Assignee required) label Apr 11, 2023
@meteorcloudy meteorcloudy added the help wanted Someone outside the Bazel team could own this label May 2, 2023
@rickeylev
Copy link
Contributor

FYI, a commit just went in to add a Best Practices section to the Module extensions page: https://bazel.build/external/extension#best_practices

So there's now at least a place to collect learnings about writing extensions

@meteorcloudy meteorcloudy added P2 We'll consider working on this in future. (Assignee optional) and removed P1 I'll work on this now. (Assignee required) labels Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests help wanted Someone outside the Bazel team could own this P2 We'll consider working on this in future. (Assignee optional) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: documentation (cleanup)
Projects
None yet
Development

No branches or pull requests

7 participants