By "replacement", I mean picking up a random open source project and being able to do the equivalent of:
./configure
make
make install
To be able to build and run the app directly from sources, when needed.
Right now, it's a mess, the "replacement" is:
curl whatever.io | sudo bash
As someone who's learned programming through self-study, the broad swath of tooling out there can be a bit of a barrier to picking up new languages and concepts, especially when the concepts related to building and delivering software are occluded by some of the opinionated decisions all the different tool sets make about how building projects should work.
Learning a new language and new concepts already takes a good deal of time, which may be a valuable resource if you're not in any official program of study and making use of free moments. This is only exacerbated by the frequent need to learn a whole new tooling ecosystem along with any new language you decide to pick up. A sort of rosetta stone of package management and build tooling would be a godsend.
Use bazel to describe and build the projects incrementally. The more languages are supported the less project-specific build systems have to be learned.
Use Nix and nixpkgs to pull external dependencies (and bazel).
I've been meaning to try and write a somewhat saner build system to replace the Auto* hell, at least for C and C++. I'm focused on other things right now but I've been studying and collecting information about the architecture of many other build systems for a while, and some of them are so much ahead of those used in open source projects it's not even funny. At the very least I'll be writing a lengthy blog post with my findings.
So far, I've avoided having to incorporate the JDK into my stack. Having to bring it in just for a build tool, keeping it up-to-date on developer configurations, just feels like a royal pain.
I realize it's never gonna happen, but having bazel rewritten in Go or C++ or anything else that produces a single binary would be awesome.
https://github.com/bazelbuild/rules_typescript
I don't see why this wouldn't be extensible to other languages with similar build systems. In practice, I find it useful to think of Bazel as a scripting languages that works when commands generate reproducible output files.
Scripts for dependencies, scripts for building, scripts for packaging, and often with their own special snowflake syntaxes for each.
Go has room for improvement to be sure, but I love that I can jump into any project and run `go build`, `go test`, `go install`, etc and they do the right thing. Even if you don't know the language, it's easy to figure out what's happening because the language itself is basically just a vanilla imperative language with a GC.
Not enough languages devote enough care to their tooling, in my opinion.
For that, Bazel needs someone to write all the necessary configs, and make them available out-of-the box, with sane presets baked-in.
You can look at Angular team's working on integrating Bazel into their build process, here's the repo: https://github.com/alexeagle/angular-bazel-example
There's:
- build.bazel
- Workspace
And then there are rules that have to be included and/or developed:
- nodejs rules, https://github.com/bazelbuild/rules_nodejs
- sass rules https://github.com/bazelbuild/rules_sass
- typescript rules: https://github.com/bazelbuild/rules_typescript
etc.
And those rules have to be not only loaded, but specific steps from those rules have to be invoked (see WORKSPACE).
I'd say there still still a lot of configuration involved in setting up all the moving pieces. Will it get better? Hopefully (there are just not enough good/decent build tools).
Right now there are a handful of (mostly Google) projects that you should be able to clone and bazel build after only having installed bazel.
To build bazel itself: # install bazel w/ system package manager git clone https://bazel.googlesource.com/bazel && cd bazel && bazel build //src:bazel
Okay, i, the original developer, somehow obtain Tool X, and tell it to do a number on my project. It works out or is told what build tool i'm using, and generates a portable shell script in the project root. Later, you, the developer who has picked up my random open source project, can run it:
./xmake
Or on Windows: ./xmake.bat
That then uses some almost-definitely-available HTTP client (curl on Linux, some PowerShell access to a .net client on Windows) to obtain the binaries necessary to run the project's build tool, caches them somewhere sensible so it won't need to download them again next time, then sets up whatever environment is needed to run the build tool, and runs it.For example, if i have a Gradle build, it will download a JDK, unpack it somewhere, export JAVA_HOME, and run ./gradlew build. That will then download Gradle itself and run it, which will download the dependencies and build the project.
If i have a Cargo build, it will download the appropriate version of Rust, then run Cargo.
The top-level script could support a number of standard targets - 'all' (the default), 'assemble' (just compile and link the main code), 'test', 'package' (put everything in a zip file somewhere), etc. In each case, these would translate to the appropriate invocation of the real build tool. Where a build tool doesn't have the concept (does Cargo do packaging in a zip?), the top-level script could provide a shim.
Does that make sense?
If a target language already has tooling to install specific versions of its SDK, then the top-level script should chain to that, instead of duplicating its functionality. That means rustup for Rust, ruby-install for Ruby, and probably SDKMAN! for Java (obscure, but it exists).
Where a language doesn't have such a tool, perhaps it could be shoehorned into an existing one. SDKMAN! is nominally language-agnostic, so perhaps that.
Probably the biggest stumbling block is C/C++. They don't even have a standard build tool, let alone a standard SDK version manager. What tools do exist often assume that they can use system versions of compilers, libraries, etc, rather than ones from a particular installation. Still, i've written enough C++ build scripts to convince myself that this would be possible, even if was a bit painful.
Actually no, there is a difference, the former never works properly for any sizable project, while the later does, because for the later the user just wants to install the app so all the script usually does is to download some binaries.
Having a common build environment is impossible because you need a common way to manage dependencies and that will never, ever happen, for better or worse.
Also, I think the pants folks are considering a Rust rewrite.
sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python
That's a fair few things, but it doesn't see that awful. None of those dependencies seem exotic. I wonder if they could get rid of Python by using Jython on top of the JDK.
The current long pole in the tent is Windows. Bazel brings along its own JVM - so there isn't any Java or Java dependency difficulty (as some other posters have suggested). But the install instructions direct you to provide some dependencies first, by hand. Of course in the long term a little while spent installing is no big deal... but each new adopter has to get through the short term on the way to the long term.
Hopefully a future Bazel installer will "just work" on Windows as a single installation with no instructions.
(I tried building Bazel and its dependencies completely from source for Guix.)
I also write Java/C++ and .NET/C++ regarding some of the project stack descriptions I am usually working on.
Also the best magazine reference for C and C++ developers, now sadly gone, "The C User's Journal" eventually was renamed to "The C/C++ User's Journal" when they saw the increase in C++ readers and respective article submissions.
Speaking as someone who has made their own build system, as dumb as that is.
> Built-in support for C, C++, D, Java, Fortran, Yacc, Lex, Qt and SWIG, and building TeX and LaTeX documents. Easily extensible through user-defined Builders for other languages or file types.
Godot https://godotengine.org/ uses SCons and it's great; easy, quick and reliable.