Hacker News new | ask | show | jobs
by mook 2034 days ago
I've only used Bazel in anger (in a medium-small sized project); I've found it really frustrating because it effectively has two separate languages (inside build files and in custom rules), even though it's both Starlark. It's especially terrible for doing things that Bazel didn't already know about (i.e. running shell commands to generate things, even if you could tell Bazel all the inputs and outputs).

We wanted to switch away from Bazel because of the mismatch; it looked like Pants and Buck had the same issues. At the time Please didn't have sensible documentation so it was skipped. From what they have now it seemed like it's more reasonable in this respect, but I don't actually know yet; perhaps somebody who knows can chime in?

1 comments

What do you mean? Genrules are very good at running she'll commands (or even entire executables).

By custom rules do you mean macros, or full on custom rules?

Genrules are okay for commands, but most things I want to do end up being tiny shell scripts, which isn't a great fit.

I mean full on custom rules, exactly because of the inability for genrule to span more than one command (so we end up having to generate tiny shell scripts and running them).

I've also had issues debugging things any time I've tried to use genrule; the error messages tend to be unhelpful in my experience (though that's been a while and I don't recall the details). Things that look like they'd do what I want would just not work in unhelpful ways, and interrogating the system usually didn't work until there were no errors (at which point I wouldn't need to interrogate it anymore…)

Genrules can run shell scripts though, like most of the time my genrules invoke an arbitrary python script. Shell would work much the same.

What do you mean by a "command"? I'm very confused by the nomenclature here.