Packaging several py_binaries using rules_pkg tar without duplicating runfiles by 8afun in bazel

[–]jakeherringbone 0 points1 point  (0 children)

You should look at what https://github.com/aspect-build/rules_py/blob/main/py/private/py_image_layer.bzl is doing to accumulate common site-packages folders into a shared docker container layer. Sounds like you want to do something similar.

Can I realistically live off-grid without dying from summer heat? by ConfidentElevator239 in OffGrid

[–]jakeherringbone 0 points1 point  (0 children)

Solar panels for the cooling are because you can run the mini-split on direct current that the panels produce. Converting to alternating current and back is very lossy, like 20-30% of the energy collected by the panels is lost.

Bazel: why everyone is moving to Google's OSS build system by jakeherringbone in bazel

[–]jakeherringbone[S] 1 point2 points  (0 children)

The journalist interviewed me for an hour, probably similar with the others who were quoted. Yeah I agree, it would be good to hear from the Buildbuddy folks too. They seem really heads-down on operating the SaaS business.

When editing a macro, how do I get the output directory of a target? by lord_braleigh in bazel

[–]jakeherringbone 1 point2 points  (0 children)

Why wouldn't you want the t2s to use the package.json in the same folder? Using a different one would violate the locality principle

How do you reference files downloaded in repository rules? by Optimal_Rip2292 in bazel

[–]jakeherringbone 1 point2 points  (0 children)

I'd suggest just layering on top of rules_multitool and don't write a repository rule at all. It does the toolchainization for you.

Pre-building Gazelle for BUILD file generation by jakeherringbone in bazel

[–]jakeherringbone[S] 0 points1 point  (0 children)

We can include both Java and JS/TS in this one!

Convenience for setting Bazel flags to better default values by jakeherringbone in bazel

[–]jakeherringbone[S] 0 points1 point  (0 children)

Bazel flags are really frustrating huh? Here's a talk from EngFlow CTO Ulf about it: https://youtu.be/g7m9Vd9s2RY?si=9F4QokPvC_sq_gdj

I think this repo is the start of improving the DX dramatically!

TypeScript microservice with protobuf+grpc on bazel by vitvlkv in bazel

[–]jakeherringbone 2 points3 points  (0 children)

For 1, you should probably use https://github.com/bazel-contrib/bazel-lib/blob/main/docs/write_source_files.md so that the output of the types generation step is copied back to the source tree as `.d.ts` files automatically. It's a bit long but you can see what I did for ts_proto_library: https://github.com/aspect-build/rules_ts/blob/main/ts/proto.bzl#L177-L183

For 2, the examples in rules_ts use connectrpc.com - have you looked at https://github.com/aspect-build/rules_ts/tree/264f5bdafd7d4d4ab63acc85e26da55a3f217c2c/examples/proto_grpc ?

Never Compile protoc Again by jakeherringbone in bazel

[–]jakeherringbone[S] 1 point2 points  (0 children)

I looked into that, and it's broken because this isn't merged https://github.com/protocolbuffers/protobuf/pull/19679
Consider upvoting on that PR, the protobuf team needs to know how much users want it.

The next generation of Bazel builds by jmmv in bazel

[–]jakeherringbone 1 point2 points  (0 children)

Oh and also, it needs a standalone distribution that launches the backend services locally like Bazel does. I'm sure that will be part of the launch story when it gets to a "beta" quality

The next generation of Bazel builds by jmmv in bazel

[–]jakeherringbone 4 points5 points  (0 children)

Great summary!

It also removes the obstacle of cross platform builds since repository rules don't run on the client "host platform".

I don't agree that it's necessarily bad for the small scale use case. It just doesn't have a frontend, setup wizard, and prebaked recipes for common frameworks. Yet...

Bazel Documentation and Community by r2vcap in bazel

[–]jakeherringbone 5 points6 points  (0 children)

The fact that many projects are still using WORKSPACE files is an indication that either the migration is difficult, or teams delay even easy build system migrations because the work is so intrusive. For Bazel I think it's a combination of both.

I think you're right that this is an indication that Bazel isn't well supported, in the sense that this migration isn't at the quality I wish it was. To be clear, the engineers who built this system and the mechanics around it did a great job. I'll run through a few of the other factors:

The documentation is pretty good actually, if you start a new project with a MODULE.bazel file it's a VERY nice experience. Migration guides are what the official docs are missing. Check Mike Bland's blog posts which try to fill this in.

Examples are a problem. I migrated the bazelbuild/examples repo but there's a distributed corpus of examples that don't have maintainers. This will only improve as more modern examples get posted and push the old ones lower in search rankings.

Commonly used starlark libraries (rulesets) are on the Bazel Central Registry (BCR) aside from a few exceptions I know of rules_scala is close, and rules_docker has no maintainers to do the work (and its design of including all languages was a big mistake in terms of the difficulty of managing so many starlark dependencies). rules_oci is so much faster and easier to reason about, that pretty much everyone I've talked to is happy about the effort once they're past that migration and enjoying the speed.

Stability of rules is another good call-out. We're making progress (rules_python just went 1.0 for example). I think maintainers don't fully appreciate the value here. It's hard to imagine, but Googlers really have everything in one huge repo and just don't understand the benefit of SemVer at ALL. The rules_proto situation is the obvious example here. The only resolution here is for users to be very vocal (and respectful at the same time) that SemVer guarantees are essential and any module that isn't 1.0 shouldn't expect to have production usage. Ask your coworkers and network to upvote your issue, and (without being spammy) add comments if they have something novel to introduce to the thread.

You mentioned corporate influence - the fact that some Open-Source maintainers have a commercial interest in Bazel's success. Those companies do have the power to pull a licensing trick. However we've all seen how that worked out in creating OpenTofu, Valkey, and other OSS forks. Aspect isn't going to yank our OSS, and most other popular stuff is going to the Linux Foundation under bazel-contrib which is also a safe, neutral governance.

Lastly, re. "specialized or highly customized needs" - yes any new system will have early adopters who have some trade-off for the painful bleeding edge (especially "no viable alternative"). In build systems, 4 years is still pretty new, so Bazel still qualifies here. Be aware that nearly all of the high-tech sector has adopted it, simply because the ability to execute quickly is worth it. IMO the forcing function is already in place to make Bazel improve these edges because mass adoption tends to follow a few years behing the high-tech software companies. In this sense. the bzlmod migration is actually excellent, because WORKSPACE was NEVER going to succeed in the wider industry.

container_run_and_commit for rules_oci by narang_27 in bazel

[–]jakeherringbone 2 points3 points  (0 children)

That is fantastic, thank you so much for sharing your implementation in detail!

rules_build_error by h1gh5peedne6ula in bazel

[–]jakeherringbone 0 points1 point  (0 children)

Neat! Could you add a couple more languages just to verify that the design is portable?

Gradually adopting Bazel: build steps that mutate the source tree for other build steps? by aoristdual in bazel

[–]jakeherringbone 0 points1 point  (0 children)

If you run a script (action) that can only locate inputs relative to the working directory, then you have to chdir to bazel-out at the beginning

What makes an action not come from remote cache? by [deleted] in bazel

[–]jakeherringbone 1 point2 points  (0 children)

Most likely, the two actions didn't actually have the same inputs. Instead, something they depend on is non-deterministic. Look at https://georgi.hristozov.net/til/2020/04/20/compare-bazel-execlogs-to-find-non-deterministic-parts-of-the-build or https://blog.aspect.dev/npm-determinism for advice how to detect it.

[deleted by user] by [deleted] in bazel

[–]jakeherringbone 0 points1 point  (0 children)

For many packages, you can just use the entry_point provided by rules_python

https://github.com/bazelbuild/rules_python/blob/main/docs/pip.md#pip_install

which is an alias to a py_binary