Live data from Hacker News

Please – A Cross-Language Build System

please.build

91–100 of 122 posts

Re: Please – A Cross-Language Build System

#91

Is there a problem with cmake? Why are people still inventing new build systems?

cmake cons (IMHO):

- the archaic custom scripting language (that's its main problem)

- there are many ways to do the same thing, resulting in each (non-trivial) build script looking different

- for the above reason, importing dependencies written by somebody else is non-trivial, and its often better to rewrite the cmake scripts completely

- it lacks some 'integration features' found in more modern systems like Rust's cargo: (1) proper dependency/package management (2) run targets (3) switching between build configurations should be easier (not just release/debug, also different build target platforms)

cmake pros (also IMHO):

- can generate IDE project files (that's what most new build systems completely ignore)

- very good cross-compilation support

- describing a simple build is reasonably simple

- broad support for build tools and IDEs

Re: Please – A Cross-Language Build System

#92
post #71
post #56

Why do all these build systems have magic built-in rules and special syntax? Custom languages, etc. makefiles without any magic are comprehensible, but people quickly add magic :(

gnumake has at least a half-dozen magic built-in rules, no?

A bit more than a half dozen, but mostly inconsequential:

https://www.gnu.org/software/make/manual/html_node/Catalogue...

Re: Please – A Cross-Language Build System

#93
post #56

Why do all these build systems have magic built-in rules and special syntax? Custom languages, etc. makefiles without any magic are comprehensible, but people quickly add magic :(

Both gnumake and bmake have lots of tooling, partly magic, at least for compiling C code.

Re: Please – A Cross-Language Build System

#94
When it comes to a build system with Python-like syntax, I prefer Waf (https://github.com/waf-project/waf) to the rest of the competing solutions. It's written in Python, provides excellent support for many build scenarios, but can be extended with Python scripts without any restrictions, and has minimal dependencies (literally, you can supply Waf packed binary with your project and it'll work on all major platforms that have Python).

Re: Please – A Cross-Language Build System

#95
post #45

Why would I use this instead of Nix?

Do people use Nix for building and deploying project dependencies? Example project? Can you consume the result in a format that isn't all Nix-y symlinked?

nixpkgs contains tools for building Docker-compatible container images with `dockerTools`, and also AppImage-style standalone executables with `nix-bundle`.

My project, as well as many other projects, ships its own default.nix for builds. Linking an example would deanonymize this account a little too much, but there's plenty of examples out there.

Re: Please – A Cross-Language Build System

#96

Apologies in advance for shitting on this, but PLEASE STOP BUILDING BUILD SYSTEMS. We already have a serious incompatibility problem with projects using autotools vs CMake vs Meson vs gyp vs Boost.Build vs SCons vs BUCK vs... and now we throw Please onto the pile. It sucks when you find a smallish library and discover it uses an esoteric build system whose dependencies dwarf the library themselves (cough Yoga). The O…

>contribute to or extend

I don't think it's that simple. Sure, I could spend time figuring out the GNU Make source code. I could somehow shove a C preprocessor into it and make it automatically generate dependencies based on include directives. I could make it depend on clang. Will the make maintainers accept my patch if I send it their way, though? Somehow I doubt it. What if I changed the make language to make it easy and unambiguous to write paths with spaces and other problematic characters in them? Do you think the maintainers are going to accept a patch that will most definitely break existing makefiles that work perfectly fine just because I fixed a major limitation of the program? We're talking about a tool whose grammar requires that commands be prefixed with a tab just because the author experimented with that rule and then couldn't change it because about a dozen friends were already using it. Fixing make is simply not possible at this point. If you try, it will just become yet another incompatible tool, some kind of make derivative that will have to be maintained independently. At this point, why limit yourself to make? Might as well rethink the whole thing.

As far as GNU/Linux distributions go, make and autotools are the default. If you're using anything else, it's gonna be a build time dependency that people are going to have to install in order to build your program. So you look at the other tools and you find they don't quite do what you want either. They only do about 80% of what you want, and getting it to do the remaining 20% makes you really wish the tool was an actual programming language instead of a limited build script. Is it any wonder people roll their own?

Also, I believe people should work on what they personally like. There is no obligation to contribute to some project just because it's "standard". It's an interesting problem that's difficult to solve, so it's not weird to see lots of people offering their executable opinions on how things should be done. If programmers don't like what's available out there, they are welcome to try and come up with something better. Who knows what will happen? Maybe the new wheel will turn out to be better than the current one. Maybe it won't. It might introduce new ideas that will influence new designs. These ideas might even make their way into other systems.

Re: Please – A Cross-Language Build System

#97
post #55

Earlier quoted context omitted.

Why should I have to install the jdk for a build tool when I’m not using Java myself?

Are you opposed to java, or to installing being more than one step?

I’m opposed to tools bringing along the equivalent of an entire operating system, with a massive attack surface, versioning issues, separate package management, and everything else along for the ride.

A self-contained binary has everything it needs to function and is typically much smaller. If I’m not using Java for my work, then I don’t want to be encumbered with having to think about it, or stay up to speed with releases and everything else.

I like to see projects with as few dependencies as possible, even when statically linked. Bringing in the JDK when it’s not needed is tiresome.

Re: Please – A Cross-Language Build System

#98
post #71
post #56

Why do all these build systems have magic built-in rules and special syntax? Custom languages, etc. makefiles without any magic are comprehensible, but people quickly add magic :(

gnumake has at least a half-dozen magic built-in rules, no?

I said, makefiles without the magic :)

If you only use plain rules and maybe simple pattern rules, avoid configure step, etc. Makefiles are simple, pretty and very generic.

Why do all other build systems have so much magic?

Why not declare rules and input/output in a pure functional manner?

Re: Please – A Cross-Language Build System

#99
post #22

Please bazel, buck or pants?

Since Bazel is a version of the thing everybody is copying (Google’s internal build system Blaze) I would say Bazel is most likely the best of the bunch. I’ve used Buck; it’s slow. I haven’t tried Pants.

I've used blaze for 2.5 years, best build system ever, but haven't used at all "pants please or buck"

Re: Please – A Cross-Language Build System

#100

Is there a problem with cmake? Why are people still inventing new build systems?

Because make is awkward and not very developer friendly, and it relies on shell scripting, which is arguably even more awkward, hard to learn, and developer-unfriendly. Also, make is very barebones and "close to the metal". Good modern build systems provide libraries of common tasks so you don't have to reinvent the wheel; they can handle parallelism well; and can fall back on makefiles where needed. They let you get…

I think you missed the fact that he's talking about Cmake not make. While Cmake can generate make scripts, it can also create IDE projects and some other outputs like Ninja files.
Post reply on HN