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

Enable bzlmod #27

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Enable bzlmod #27

wants to merge 2 commits into from

Conversation

sluongng
Copy link
Contributor

@sluongng sluongng commented May 21, 2024

Enable bzlmod for BuildBuddy toolchain

@sluongng sluongng changed the title sluongng/bzlmod enable Enable bzlmod May 21, 2024
Comment on lines +3 to +10
bazel_dep(name = "buildbuddy_toolchain", repo_name = "buildbuddy")
local_path_override(
module_name = "buildbuddy_toolchain",
path = "../../",
)

buildbuddy = use_extension("@buildbuddy//:extensions.bzl", "buildbuddy")
use_repo(buildbuddy, "buildbuddy_toolchain")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The naming here could be quite confusing to new users. Any suggestion? 🤔
We have:

  • The module name, which is buildbuddy_toolchain but is then renamed to buildbuddy -> this is essentially our git repo.
  • The extension name, which is buildbuddy.
  • The repository that was created by the extension, which is named buildbuddy_toolchain -> this contains the actual platform and toolchain definitions.

@marvin-hansen
Copy link

marvin-hansen commented Jun 13, 2024

You may consider to add some parameters for configuration.
For example:

// Load rules from BCR
bazel_dep(name = "buildbuddy_toolchain", version = "0.1")

buildbuddy = use_extension("@buildbuddy//:extensions.bzl", "buildbuddy")
buildbuddy.toolchain(llvm = true)
use_repo(buildbuddy, "buildbuddy_toolchain")

// Do wee need to call register_toolchains???

I don't think the naming is too much different from what's out there. Is it perfect, no, but given
that nearly all bzlmod rules follow this pattern, I would say it's not an issue. Also, for the most part
people just copy & paste the declaration from the release page.

I would be open to test this rules once merged because I am converting my main repo to bzlmod and this is the last rule on my list.

@marvin-hansen marvin-hansen mentioned this pull request Jun 13, 2024
@realtimetodie
Copy link

Hello @sluongng,

thank you for working on this

@realtimetodie
Copy link

@siggisim

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.

None yet

4 participants