These are real questions I've received, if you have more that I haven't answered here, please ask them to me.
Q: Cabal is going to have to learn how to configure rust/zig/D/C++/meson/bazel projects?
A: No. The logic is offloaded to build drivers (like cargo-driver
) that get the necessary information from a custom stanza
Q: Cabal already knows how to do it, it's called Setup.hs
A: Setup.hs
' unrestricted code execution proves to be a liability. The ability here is to provide a clear and official path
to allow the transition from this Setup.hs
usecase. One build driver can be analysed for n projects, but n Setup.hs
files
must be analysed for n projects.
Q: This cargo-driver
of yours, who's going to be in charge?
A: A healthy mix of stakeholders and community members, the idea being that some central coordination with the cabal team is needed and we can't have this left to the good will of the community altogether, because we want to present a coherent and reliable "Rust integration" story. The Haskell Foundation can have a stake in it, for instance. But anybody can make a driver, it's not a walled-garden. cargo-rust
will be maintained in a more “official” capacity due to its ecosystemic importance and significance.
Q: This is too heavy/rigid for me, why can't we just let the user figure it out?
A: The goal is to offer a clear and straightforward path to native code integration without having to retain the knowlege of those systems in Cabal. At the same time, more flexible tools are an open door to unregulated code execution.
Q: This is the wrong approach, you should put that knowledge in something higher-level like Bazel
A: This doesn't prevent you from using Bazel but forcing people to learn Bazel in order to do what other languages have asking too much for too few benefits.
Q: You're bloating Cabal, external dependencies shouldn't be necessary to use external dependencies
A: We think that the weight of having a build driver as a build dependency to handle other build dependencies is an acceptable compromise.
Q: Realistically, what system only knows how to do cabal build
? Can't you run a command before cabal build
that takes care of everything?
A: Not every system is able to run arbitrary command when compilling a Haskell package. More specifically each time a package X depends on a package Y, cabal will build the dependency with a standard cabal build
. Build platforms that support cabal shouldn't have to adapt to something too flexible when it comes to building cabal packages.
As discussed,
encoding
package case (customSetup.hs
) via something similar to:Preprocessor
module..mapping
files to produceAutogen-Modules
.