-
Notifications
You must be signed in to change notification settings - Fork 92
Update the non-toolchain examples to bzlmod #684
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure") | ||
|
|
||
| def _cc_configure_impl(module_ctx): | ||
| nixpkgs_cc_configure( | ||
| name = "nixpkgs_config_cc", | ||
| repository = "@nixpkgs", | ||
| register = False, | ||
| ) | ||
|
|
||
| cc_configure = module_extension( | ||
| implementation = _cc_configure_impl, | ||
| ) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| import %workspace%/../../.bazelrc.remote-cache | ||
|
|
||
| build --host_platform=@rules_nixpkgs_core//platforms:host | ||
| build --crosstool_top=@nixpkgs_config_cc//:toolchain | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having crosstool_top used seems weird. Should it not be selected by default by the toolchain selection engine ? Or is this intended as a demo on how to force a specific toolchain ? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| module(name = "rules_nixpkgs_flakes_example") | ||
|
|
||
| bazel_dep(name = "rules_nixpkgs_core") | ||
| local_path_override( | ||
| module_name = "rules_nixpkgs_core", | ||
| path = "../../core", | ||
| ) | ||
|
|
||
| bazel_dep(name = "rules_nixpkgs_cc") | ||
| local_path_override( | ||
| module_name = "rules_nixpkgs_cc", | ||
| path = "../../toolchains/cc", | ||
| ) | ||
|
|
||
| bazel_dep(name = "platforms", version = "1.0.0") | ||
| bazel_dep(name = "rules_cc", version = "0.2.14") | ||
|
|
||
| nix_repo = use_extension("@rules_nixpkgs_core//extensions:repository.bzl", "nix_repo") | ||
| nix_repo.flake( | ||
| name = "nixpkgs", | ||
| lock_file = "//:flake.lock", | ||
| file_deps = ["//:flake.lock"], | ||
| ) | ||
| use_repo(nix_repo, "nixpkgs") | ||
|
|
||
| # | ||
| # Toolchains | ||
| # | ||
|
|
||
| cc_configure = use_extension("//:extension.bzl", "cc_configure") | ||
| use_repo(cc_configure, "nixpkgs_config_cc") | ||
| use_repo(cc_configure, "nixpkgs_config_cc_toolchains") | ||
| use_repo(cc_configure, "nixpkgs_config_cc_info") | ||
|
|
||
| register_toolchains("@nixpkgs_config_cc_toolchains//:all") |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure") | ||
|
|
||
| def _cc_configure_impl(module_ctx): | ||
| nixpkgs_cc_configure( | ||
| name = "nixpkgs_config_cc", | ||
| repository = "@nixpkgs", | ||
| attribute_path = "clang_16", | ||
| register = False, | ||
| ) | ||
|
|
||
| cc_configure = module_extension( | ||
| implementation = _cc_configure_impl, | ||
| ) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| USE_BAZEL_VERSION=7.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we absolutely have to define our own module extension to use cc toolchains ?
I feel like that extensions pertains to rules_nixpkgs_cc itself, with tags for the config. But maybe it is not implemented yet ?