-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: Should we drop support for binary distributions? #1423
Comments
The first immediate concern that strikes out to me is "what does this mean for windows builds". The second is, of course, that all of the bazel and nix integration currently require nix installed globally, which isn't great (it very much complicates |
I agree that Perhaps the problem is the degree to which the bindists are not acceptable as-is for GHC and its dependencies. Is this perhaps an upstream problem? I don't know the answers, but I'm pretty sure the answer is not for Bazel rules to take on the responsibilities of package managers and operating system distros for building large dependency trees of software packages. |
In short, I think we should support a "host" toolchain as described in #1320, as well as an improved bindist toolchain as described in #1393 . We currently implement two ways to provide a GHC toolchain in rules_haskell
Nix is the best option to obtain a hermetic GHC toolchain and avoid implicit system dependencies. However, this option is only available if Nix is available. In particular it is not an option on Windows, but we also have users on Linux or MacOS that can't or prefer not to use Nix. Meaning we need some mechanism outside of Nix to provide GHC. As @robinbb identifies correctly the current bindist mechanism has a few issues regarding hermeticity. The #1393 proposes to improve the current bindist mechanism by performing the #1320 proposes a "host" toolchain where we just use whichever GHC is installed globally. I think this is also what @robinbb is proposing with
I think both approaches are useful and we'd want to support both. The "host" toolchain can for example be convenient on CI setups where GHC is installed in a separate step, e.g. a GitHub action, or Docker image. The approach of downloading a bindist is useful for projects that don't use Nix but still want to have a single command build and ensure that all developers use the same compiler version.
I would not recommend building GHC from source in Bazel. Building GHC from source can be hard to setup and can take hours. The bindists try to provide a middle ground by doing most of the build for you and leaving only a small configure step do be done on installation site (only required on Unix). Note, Unix bindists that don't require the configure steps are discussed here. In #1393 we also discuss dedicated prebuilt GHC bindists for rules_haskell.
To clarify, the An issue that is caused by the bindist being built on Debian9 in that case is that it depends on certain versions of system libraries such as
I don't think we need to go that far. The bindist rule provides a compromise between being able to pin the GHC version while accepting implicit dependencies on other more common system libraries. Comparable features exist in rules_go or rules_nodejs, or stack outside of Bazel. As described above and in #1393 it could be improved to reduce some of these inhermeticities. |
I wholeheartedly agree with @aherrmann's plan. Are there followup issues to file? That way we can close this one. |
@robinbb writes:
The text was updated successfully, but these errors were encountered: