<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated>2026-10-16T03:31:53Z</updated>
  <generator>https://njump.me</generator>

  <title>Nostr notes by Adin Ćebić (Unofficial)</title>
  <author>
    <name>Adin Ćebić (Unofficial)</name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://njump.me/npub1pfcxlj93elettnq3nsvcl33pwn4k8qch9mv2nccyzmypln8udc5qu06yrj.rss" />
  <link href="https://njump.me/npub1pfcxlj93elettnq3nsvcl33pwn4k8qch9mv2nccyzmypln8udc5qu06yrj" />
  <id>https://njump.me/npub1pfcxlj93elettnq3nsvcl33pwn4k8qch9mv2nccyzmypln8udc5qu06yrj</id>
  <icon>https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f427.png</icon>
  <logo>https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f427.png</logo>




  <entry>
    <id>https://njump.me/nevent1qqs0d4uk3kwjn6kzhrg5ppr949xp99q2f77ury75neh5apfpl7rne8czyq98qm7gk88l9dwvzxwpnr7xy96wkcurzuhd320rqstvs87vl3hzs5l9r2u</id>
    
      <title type="html">Validating Bazel Rule Attributes Oftentimes, it is necessary to ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs0d4uk3kwjn6kzhrg5ppr949xp99q2f77ury75neh5apfpl7rne8czyq98qm7gk88l9dwvzxwpnr7xy96wkcurzuhd320rqstvs87vl3hzs5l9r2u" />
    <content type="html">
      Validating Bazel Rule Attributes&lt;br/&gt;&lt;br/&gt;Oftentimes, it is necessary to validate rule attributes to prevent misuse of a rule. While attributes can be validated as part of the main rule implementation function, there is perhaps a better way to do it.&lt;br/&gt;Rule initializer&lt;br/&gt;This is yet another lesser-known feature of Bazel, where we can declare an initializer function that runs when a rule is instantiated. In my opinion, this is the ideal place to validate inputs.&lt;br/&gt;Take this fictitious rule, where we want to make sure that it only accepts certain modes:&lt;br/&gt;def _init(name, mode = &amp;#34;safe&amp;#34;, **kwargs):&lt;br/&gt;if mode not in [&amp;#34;safe&amp;#34;, &amp;#34;fast&amp;#34;]:&lt;br/&gt;fail(&amp;#34;mode must be &amp;#39;safe&amp;#39; or &amp;#39;fast&amp;#39;; got %r&amp;#34; % mode)&lt;br/&gt;return {&amp;#34;mode&amp;#34;: mode}&lt;br/&gt;def _impl(ctx):&lt;br/&gt;out = ctx.actions.declare_file(ctx.label.name &#43; &amp;#34;.txt&amp;#34;)&lt;br/&gt;ctx.actions.write(out, ctx.attr.mode &#43; &amp;#34;\n&amp;#34;)&lt;br/&gt;return [DefaultInfo(files = depset([out]))]&lt;br/&gt;validated_file = rule(&lt;br/&gt;implementation = _impl,&lt;br/&gt;initializer = _init,&lt;br/&gt;attrs = {&lt;br/&gt;&amp;#34;mode&amp;#34;: attr.string(),&lt;br/&gt;},&lt;br/&gt;)&lt;br/&gt;Passing an unsupported mode will result in a failure during the loading phase, before Bazel even gets to analyzing the target.&lt;br/&gt;This is an important distinction compared to validating attributes in the rule implementation function, which runs during the analysis phase. With an initializer, invalid inputs are caught earlier, when the rule is instantiated in a BUILD file.&lt;br/&gt;Another interesting detail is that initializers can also modify attribute values by returning a dictionary containing the attributes to override. Attributes that are not returned remain unchanged. In our example, we simply return the validated mode value.&lt;br/&gt;Notice that we also define the default value of mode in the initializer rather than in attr.string(). Initializers run before attribute defaults are applied, so a default specified in the initializer takes precedence. The **kwargs parameter allows us to ignore other public attributes that we don’t need to validate.&lt;br/&gt;Experimental status&lt;br/&gt;The initializer parameter is still marked as experimental in Bazel’s API documentation. However, this designation is outdated.&lt;br/&gt;The --experimental_rule_extension_api flag has been enabled by default since Bazel 8, meaning the feature is no longer restricted to allowlisted users by default. Fabian, a trusted Bazel contributor, has also opened a PR to remove the outdated experimental designation from the documentation.&lt;br/&gt;So despite what the current documentation suggests, feel free to use it.&lt;br/&gt;Conclusion&lt;br/&gt;While there are a couple of ways to validate inputs in a Bazel rule, I think this one deserves to be used more widely since it feels like the right tool for the job.&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://adincebic.com/2026/11/01/validating-bazel-rule-attributes.html&#34;&gt;https://adincebic.com/2026/11/01/validating-bazel-rule-attributes.html&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;#rss #feeds #linksharing #qwibbit
    </content>
    <updated>2026-11-02T02:37:46Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs8l5u2qdzrppt3kl0wjf082ywjcxml2t9zqu5ss89ge6j5zgw6deczyq98qm7gk88l9dwvzxwpnr7xy96wkcurzuhd320rqstvs87vl3hzslcuf7q</id>
    
      <title type="html">What Bazel Thinks Has Changed Very often, engineers I support ask ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs8l5u2qdzrppt3kl0wjf082ywjcxml2t9zqu5ss89ge6j5zgw6deczyq98qm7gk88l9dwvzxwpnr7xy96wkcurzuhd320rqstvs87vl3hzslcuf7q" />
    <content type="html">
      What Bazel Thinks Has Changed&lt;br/&gt;&lt;br/&gt;Very often, engineers I support ask me how they can inspect what Bazel thinks has changed between builds. While it’s true that they could generate execution logs and compare them, they often don’t have those enabled, and diffing the logs can be tricky given how large they can get.&lt;br/&gt;Yes, there’s the BuildBuddy CLI, which can help with that, but there’s another way to peek into Bazel’s state and see which files Bazel detected as changed when deciding what needs to be re-evaluated.&lt;br/&gt;Enter DiffAwareness&lt;br/&gt;This is a neat trick for inspecting Bazel’s server log to see what changes Bazel detected.&lt;br/&gt;After running a build, we can use grep, rg, or any other tool to inspect the log.&lt;br/&gt;For example:&lt;br/&gt;bazel build //:app&lt;br/&gt;Now, let’s say the build has finished. Whether Bazel actually re-ran any actions (or invoked the compiler) is a different question. We can inspect which file changes Bazel detected by running:&lt;br/&gt;rg &amp;#39;DiffAwareness found&amp;#39; &amp;#34;$(bazel info server_log)&amp;#34;&lt;br/&gt;This will show the changes Bazel detected since the previous evaluation, with the log listing at most 10 individual changed paths per diff-awareness event.&lt;br/&gt;Here, we’re simply using rg to search Bazel’s server log. Nothing fancy.&lt;br/&gt;One important distinction: these are files Bazel detected as changed, not necessarily files that caused an action to re-run. Bazel may still determine that no actions need to be executed.&lt;br/&gt;Conclusion&lt;br/&gt;This isn’t something I use all that much, and to be frank, I don’t find it particularly useful day to day. But it’s nice to have in the toolbox when debugging builds, investigating unexpected rebuilds, or even debugging Bazel itself.&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://adincebic.com/2026/10/25/what-bazel-thinks-has-changed.html&#34;&gt;https://adincebic.com/2026/10/25/what-bazel-thinks-has-changed.html&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;#bazelthinks #whetherbazel&lt;br/&gt;&lt;br/&gt;#rss #feeds #linksharing #qwibbit
    </content>
    <updated>2026-10-26T02:37:21Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsg2p2npjn8c57f2t7n3guwrsy5ck72shdrrl7554vazq5g53n0h2qzyq98qm7gk88l9dwvzxwpnr7xy96wkcurzuhd320rqstvs87vl3hzsk0vlj0</id>
    
      <title type="html">BazelCon 2026: My Notes and Observations I always find BazelCon ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsg2p2npjn8c57f2t7n3guwrsy5ck72shdrrl7554vazq5g53n0h2qzyq98qm7gk88l9dwvzxwpnr7xy96wkcurzuhd320rqstvs87vl3hzsk0vlj0" />
    <content type="html">
      BazelCon 2026: My Notes and Observations&lt;br/&gt;&lt;br/&gt;I always find BazelCon to be an exceptional experience, and this year was no exception. From the things I learned by randomly talking to people, to meeting familiar faces and learning from the talks and BOF sessions, it is simply an incredible experience.&lt;br/&gt;Today I want to go over some things I observed and what I am looking forward to in Bazel 10.&lt;br/&gt;AI is everywhere&lt;br/&gt;Nowadays, when we are all using AI agents every day, I find that using AI is becoming just like using any other tool. There was no talk about doomsday scenarios, but rather encouragement to use AI even more.&lt;br/&gt;On more than one occasion, people would say “point your agent at the documentation” instead of reading the documentation yourself.&lt;br/&gt;Also, EngFlow’s report on how much people are using AI was eye-opening. It’s not like I didn’t expect it, but seeing the numbers really puts things into perspective.&lt;br/&gt;IDEs as we know them are going away&lt;br/&gt;It seems that nobody is focusing on IDEs as much as we did before. For example, we’ve seen the use of rules_xcodeproj going down in some large organizations in favor of more lightweight alternatives like VS Code.&lt;br/&gt;I feel like the next opportunity for IDEs is a more integrated code review experience and better code navigation.&lt;br/&gt;Investing heavily in better autocomplete seems wasteful since fewer people are relying on it as their primary way of writing code. Sure, it is always good to have it in some shape or form, but I don’t expect it to be the main focus of IDE improvements in the coming years.&lt;br/&gt;Bazel 10&lt;br/&gt;Bazel 10 continues the effort of moving language-specific functionality out of the core and into Starlark extensions.&lt;br/&gt;There are also a lot of welcome performance improvements, some of which are being accelerated by the use of AI.&lt;br/&gt;Project Skymetal&lt;br/&gt;This is an effort to replace parts of Bazel’s Java implementation with native code, currently focusing on Rust.&lt;br/&gt;It is going to take some time, as the Bazel team won’t simply replace all Java with Rust overnight. Instead, the plan is to migrate component by component, using JNI to bridge Java and Rust.&lt;br/&gt;Early results are promising, but I expect we’ll get a better picture of how it plays out once more of the codebase has been migrated.&lt;br/&gt;Skycache&lt;br/&gt;Skycache is basically an attempt to remotely cache Bazel’s analysis state, which is becoming more expensive to compute over time, especially in larger monorepos.&lt;br/&gt;This effort started last year, and by the looks of it, it is gaining more traction. In fact, Google is already experimenting with an early implementation internally, though their results do not automatically translate to analysis caching for everybody, as Google relies on infrastructure such as its cloud-based filesystem.&lt;br/&gt;Stripping native flags&lt;br/&gt;Rulesets like those for Apple platforms have historically relied on Bazel’s native flags for CPU selection and various other things.&lt;br/&gt;The effort to remove these language-specific flags from Bazel core is continuing, with equivalents being provided through Starlark-based configuration, including the apple_support module.&lt;br/&gt;Talks and other relevant information&lt;br/&gt;Snapshotting Bazel server state&lt;br/&gt;This is an interesting approach to snapshotting the entire Bazel server state so that we don’t have to pay the analysis cost every time.&lt;br/&gt;Of course, this can be fragile, but I believe it can be useful if done carefully.&lt;br/&gt;Hermetic LLVM&lt;br/&gt;Hermetic LLVM got a lot of attention during this BazelCon, and I think it is well deserved.&lt;br/&gt;David and Corentin did an amazing job of providing a fully hermetic C/C&#43;&#43; toolchain, which has always been a challenge in Bazel.&lt;br/&gt;Hopefully, this finally puts the issue to rest.&lt;br/&gt;rules_rs&lt;br/&gt;Similar to Hermetic LLVM, rules_rs is getting a lot of well-deserved attention due to its fast Cargo dependency resolution and strong emphasis on hermeticity.&lt;br/&gt;Sandbox on macOS&lt;br/&gt;Of course, it is well known that Bazel sandboxing on macOS is not as performant as on Linux, so folks over at Aspect have been working on providing a way to plug in a custom sandboxing binary.&lt;br/&gt;Hopefully, someone finds a way to finally make sandboxing on macOS as fast as it is on Linux.&lt;br/&gt;Any to Bazel&lt;br/&gt;This is a quick note on any2bazel, a tool developed by EngFlow that aims to help humans and AI agents migrate projects to Bazel.&lt;br/&gt;It uses a deterministic approach to compare what the original build system actually compiles and links against what Bazel produces. This helps guide agents toward a correct migration, because simply getting a green build is not enough.&lt;br/&gt;Apple Birds of a Feather&lt;br/&gt;The last time we had an Apple BOF was in Mountain View, California.&lt;br/&gt;This time, there was a lot of discussion about excessive disk usage in tests when statically linking dependencies. The quick fix is to use dynamic frameworks, but that comes at the cost of slower startup times and potentially other issues.&lt;br/&gt;Another popular topic was Linux-to-macOS remote build execution (RBE), where Linux is used as the CI runner and macOS machines as remote executors. This effectively allows us to initiate builds from Linux while executing Apple-specific build actions on macOS.&lt;br/&gt;There was also a discussion about building Apple targets directly on Linux, but the potential licensing issues make this approach unappealing to large organizations.&lt;br/&gt;Of course, the Apple BOF would not be complete without mentioning Swift explicit modules support in rules_swift. Thank you, Keith, for doing the work!&lt;br/&gt;Conclusion&lt;br/&gt;There you have it. Yet another incredible BazelCon behind us, and I am already looking forward to the next one.&lt;br/&gt;P.S. I know I haven’t covered a lot of ground here, but these are just my quick notes and observations.&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://adincebic.com/2026/10/18/bazelcon-my-notes-and-observations.html&#34;&gt;https://adincebic.com/2026/10/18/bazelcon-my-notes-and-observations.html&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;#bazel #code #java #rust #ides #google #skycache&lt;br/&gt;&lt;br/&gt;#rss #feeds #linksharing #qwibbit
    </content>
    <updated>2026-10-19T02:47:14Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqstmvxj0qr4nktzy04vgllu3ccumh9724lysnlnnwdfagryqe3rekgzyq98qm7gk88l9dwvzxwpnr7xy96wkcurzuhd320rqstvs87vl3hzswrnjk0</id>
    
      <title type="html">Fine-Grained Swift Warning Control with Bazel Features Ever since ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqstmvxj0qr4nktzy04vgllu3ccumh9724lysnlnnwdfagryqe3rekgzyq98qm7gk88l9dwvzxwpnr7xy96wkcurzuhd320rqstvs87vl3hzswrnjk0" />
    <content type="html">
      Fine-Grained Swift Warning Control with Bazel Features&lt;br/&gt;&lt;br/&gt;Ever since Swift gained the ability to control warnings via diagnostic groups in SE-0443, we’ve been able to promote specific diagnostic groups to errors.&lt;br/&gt;However, passing these flags via copts on swift_library targets isn’t always convenient. To apply them globally, we’d either need to modify every swift_library target, pass them via the command line, configure them in .bazelrc, or use Bazel macros to apply them automatically. All of these approaches have their downsides, such as accidentally applying the flags to external repositories, introducing additional complexity through macros, or making it difficult to opt out for specific targets.&lt;br/&gt;In the past, I’ve written about Bazel’s features mechanism, as well as how to suppress warnings in external repositories.&lt;br/&gt;Bazel feature-based approach&lt;br/&gt;In rules_swift 4.2.0, we added a way to control these warnings using Bazel’s features mechanism in #1960.&lt;br/&gt;Simply build a target while passing --features, like so:&lt;br/&gt;bazel build //... --features=swift.werror.DeprecatedDeclaration&lt;br/&gt;And all warnings belonging to the DeprecatedDeclaration diagnostic group will be reported as compiler errors.&lt;br/&gt;This approach is extremely flexible, as it allows per-target control via the features attribute, repository-wide configuration via REPO.bazel, which only applies to the current Bazel repository, and, of course, configuration via the command line or .bazelrc.&lt;br/&gt;Furthermore, we can take advantage of Bazel’s feature negation mechanism by prefixing feature names with -, allowing us to opt out of specific features when needed.&lt;br/&gt;For example, if we’ve enabled swift.werror.DeprecatedDeclaration globally but want to opt out for a specific target, we can simply negate the feature in its features attribute:&lt;br/&gt;swift_library(&lt;br/&gt;name = &amp;#34;legacy_library&amp;#34;,&lt;br/&gt;srcs = [&amp;#34;Legacy.swift&amp;#34;],&lt;br/&gt;features = [&amp;#34;-swift.werror.DeprecatedDeclaration&amp;#34;],&lt;br/&gt;)&lt;br/&gt;This way, deprecated declaration warnings will remain warnings for legacy_library, while still being treated as errors for the rest of the project.&lt;br/&gt;Conclusion&lt;br/&gt;There we have it: a simple and clean way to control Swift warnings with Bazel.&lt;br/&gt;P.S. I wish Swift would give us a way to suppress warnings per diagnostic group. If that ever comes to fruition, I’ll be the first to add a feature-based approach to rules_swift.&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://adincebic.com/2026/10/11/finegrained-swift-warning-control-with.html&#34;&gt;https://adincebic.com/2026/10/11/finegrained-swift-warning-control-with.html&lt;/a&gt;
    </content>
    <updated>2026-10-16T02:39:10Z</updated>
  </entry>

</feed>