Comments (2)
This sounds good to me (except maybe if we can find a better name for current_module
).
The implementation is quite simple (file in question: https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleExtensionContext.java), so contributions are welcome.
from bazel.
In the module extensions I have worked on so far, the usual pattern has been:
def _impl(module_ctx):
collected_data = ...
for mod in module_ctx.module:
if mod.is_root:
do_stuff(collected_data)
do_other_stuff(collected_data)
I can see the new helpers being useful in smaller module extensions, but I think that many (most?) extensions will want to do something (even if just validation) with all modules, not just root and "current" module. The new symbols would get us into a situation where do_something(module_ctx.root_module)
, if mod.is_root: do_something(mod)
and if mod == module_ctx.root_module: do_something(mod)
are all different ways to do the same thing.
I am a bit worried that introducing new API that doesn't provide any truly new information could end up making module_ctx
more confusing.
from bazel.
Related Issues (20)
- [bazel.build] Problem with /start/cpp HOT 1
- NullPointerException in RepositoryDelegatorFunction HOT 4
- Skymeld deadlock in `registerAndPlantMissingSymlinks` HOT 3
- NPE with bazel mod show_repo '<root>' HOT 1
- [bazel.build] Problem with /remote/bep
- Remove mnemonic dependency from sandbox multiplex workers
- `--experimental_remote_cache_ttl=0s` causes `--remote_download_outputs=toplevel` (Build without the Bytes) to rerun actions HOT 2
- Exceptions 25% of builds - windows 7.2.0rc2 HOT 3
- Process wrappers should be statically linked against musl HOT 1
- Local_test_resources doesn't actually restrict concurrency when `--local_test_jobs` is specified HOT 5
- --fission yes does not work when using nested cc_library
- Kleaf broken with Bazel 7.2.0-rc2 HOT 10
- Status of Bazel 8.0.0-pre.20240523.3 HOT 1
- [7.2.0] Kleaf broken with Bazel 7.2.0-rc2 HOT 1
- Incomplete stacktrace in `bazel mod show_repo` HOT 3
- incompatible_stop_exporting_language_modules exception logic is broken
- Failure in `proto_lang_toolchain` with Bazel 7.2.0rc1 HOT 9
- [7.2.0] Failure in `proto_lang_toolchain` with Bazel 7.2.0rc1 HOT 4
- No ability to pass `copts` to `cc_proto_library` HOT 1
- About The local.bzl File HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bazel.