I wonder if Bazel takes off across many languages. It wouldn't hurt to have a modern autotools & co. replacement across ecosystems. I don't think it's doable, considering the fact that we have language specific package managers and build tools, but you never know. 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…
I doubt Bazel will take off for most open source projects due to being written in Java, but I do share the sentiment. 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…
Bazel can now build Haskell
41–50 of 54 posts
Re: Bazel can now build Haskell
#42Earlier quoted context omitted.
I doubt Bazel will take off for most open source projects due to being written in Java, but I do share the sentiment. 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…
The java dependency is my biggest hangup wrt to incorporating it into my own environment. 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…
Re: Bazel can now build Haskell
#43Earlier quoted context omitted.
I doubt Bazel will take off for most open source projects due to being written in Java, but I do share the sentiment. 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…
The java dependency is my biggest hangup wrt to incorporating it into my own environment. 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…
It's written in Go so doesn't need any external dependencies unless you want to target that language (i.e. it only needs a JDK if you're trying to build Java).
Disclaimer: I'm the main author.
Re: Bazel can now build Haskell
#44I wonder if Bazel takes off across many languages. It wouldn't hurt to have a modern autotools & co. replacement across ecosystems. I don't think it's doable, considering the fact that we have language specific package managers and build tools, but you never know. 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…
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.
Re: Bazel can now build Haskell
#45A significant hurdle for the universal adoption of Bazel is its too many dependencies.
sudo apt-get install openjdk-8-jdk 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.
Re: Bazel can now build Haskell
#46Seems like SCons: http://scons.org/ > 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.
Re: Bazel can now build Haskell
#47Earlier quoted context omitted.
The java dependency is my biggest hangup wrt to incorporating it into my own environment. 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…
We have done more or less that: https://please.build / https://github.com/thought-machine/please It's written in Go so doesn't need any external dependencies unless you want to target that language (i.e. it only needs a JDK if you're trying to build Java). Disclaimer: I'm the main author.
Re: Bazel can now build Haskell
#48Earlier quoted context omitted.
I cannot agree with you more. The last time I look for build a bazel project with external dependency it was messy and undocumented. It was to use Tensorflow and Opencv in a standalone C++ code, tensorflow use bazel by default.
By external dependencies, do you mean things like arbitrary Git repos? There are standard rules there to accommodate things like that. As well, this may be new documentation since you last looked, but there's https://docs.bazel.build/versions/master/external.html to read now, at least.
...unless you are in a corporate environment with a build team to integrate complicated external projects into a monorepo and where things like build system can be mandated.
That's always the feeling I've gotten from Bazel - you either do things the "google" way, or find something else.
Re: Bazel can now build Haskell
#49Earlier quoted context omitted.
Yes, look at how git basically triumphed over all other version control systems. We need a revolution like that in the space of build-tooling.
I'm not sure I like the analogy, I wish a system with a saner UI had won :)