-
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
Remove HaskellPrebuiltPackageInfo
#442
Conversation
Hum, an unpleasant side-effect of this (more precisely of the (the |
7f7274d
to
6ea4650
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to review the first commits, but got stuck at the “Get Haddock to work” commit.
) | ||
return [buildInfo, libInfo] | ||
|
||
haskell_import = rule( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the haskell_import
rule from haskell/haskell.bzl
? Shouldn’t it be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually yes, though we probably should have a way to generate the correct (new) haskell_import
statements for other inputs than nix (like ghc bindist or an external ghc) first.
3985227
to
2217e97
Compare
@Profpatsch thanks to the early review. |
e025c5d
to
f05dd16
Compare
Can't quite get this to work. With
I get:
The issue seems to be the |
@lunaris That's another typo in the example, it should be |
Awesome -- it works! I'll put some testing in now but I think this is sweet and it's just a matter of what the final version should be (e.g. the |
Alas, it seems there is something more to the subpackage issue. If you take the files I posted earlier and add something like this to
with a
Then this will fail to build due to not being able to satisfy our old friend |
I still can't build your example (because |
Yes, works for me too! |
So this is still blocked at least on tweag/rules_nixpkgs#29 ? |
@mrkkrp yes, still. Though tweag/rules_nixpkgs#29 is a much simpler change so should be easy to merge if we think that this one is good-to-go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phew, this took a while. Looks quite okay to me, though I can’t say I understood it all. There might be a few outdated comments, because I went through commit-by-commit, they should be relevant in any case though.
I like the deduplication when importing nix packages from one source!
Using non-labeled arguments in this context would be awfully fragile and hard to understand, so we'd better forbid them altogether
By default (until release 0.19), bazel starts as much as 200 threads in his analysis phase, which means until 200 nix-build calls with rules_nixpkgs. This causes a lot of issues, in particular frequent OOMs on the CI and Nix complaining because it can only build a limited number of derivations at the same time.
The way bazel handles providers for aspects apparently changed, and there is no need to forward a provider in the aspect if the base rule already defines it
7095cdb
to
a3a15fc
Compare
I've just rebased on top of master, there wasn't any major conflict, just some package renamings in tests.
I don't see what in this change could cause it, but who knows…
In theory it shouldn't since the choice of generating or not the macro is done via a ghc flag passed during the build of the package and we don't touch these. Did you have any issue with it? |
After rebasing, two packages that had built before that use |
Hm… it's actually surprising that it worked before because I forgot to forward the If it's really the problem, it should be easy to fix. Do you by any chance have a small repro handy? |
@regnat Reproducing repo for the CPP problem at https://github.com/lunaris/bazel-example ( |
This commit removes all use of the "new" `haskell_import` based mechanism and the Nixpkgs code to support it. This is effectively a revert of #442. The new stack_install mechanism is not Nixpkgs specific and has better performance characteristics.
This mechanism was introduced in #442 and was meant to be a stepping stone towards removing the special treatment of prebuilt dependencies. It was plagued by performance problems related to Nix and never saw adoption beyond this project's test suite. With the advent of `stack_install` and `haskell_cabal_library`, we can finally get rid of it.
This commit removes all use of the "new" `haskell_import` based mechanism and the Nixpkgs code to support it. This is effectively a revert of #442. The new stack_install mechanism is not Nixpkgs specific and has better performance characteristics.
This mechanism was introduced in #442 and was meant to be a stepping stone towards removing the special treatment of prebuilt dependencies. It was plagued by performance problems related to Nix and never saw adoption beyond this project's test suite. With the advent of `stack_install` and `haskell_cabal_library`, we can finally get rid of it.
This commit removes all use of the "new" `haskell_import` based mechanism and the Nixpkgs code to support it. This is effectively a revert of #442. The new stack_install mechanism is not Nixpkgs specific and has better performance characteristics.
This mechanism was introduced in #442 and was meant to be a stepping stone towards removing the special treatment of prebuilt dependencies. It was plagued by performance problems related to Nix and never saw adoption beyond this project's test suite. With the advent of `stack_install` and `haskell_cabal_library`, we can finally get rid of it.
This commit removes all use of the "new" `haskell_import` based mechanism and the Nixpkgs code to support it. This is effectively a revert of #442. The new stack_install mechanism is not Nixpkgs specific and has better performance characteristics.
This mechanism was introduced in #442 and was meant to be a stepping stone towards removing the special treatment of prebuilt dependencies. It was plagued by performance problems related to Nix and never saw adoption beyond this project's test suite. With the advent of `stack_install` and `haskell_cabal_library`, we can finally get rid of it.
This mechanism was introduced in #442 and was meant to be a stepping stone towards removing the special treatment of prebuilt dependencies. It was plagued by performance problems related to Nix and never saw adoption beyond this project's test suite. With the advent of `stack_install` and `haskell_cabal_library`, we can finally get rid of it.
(depends on tweag/rules_nixpkgs#29)
Solve #440 by provinding an alternative
haskell_import
rule inhaskell/import.bzl
which directly generates anHaskellLibraryInfo
,HaskellBuildInfo
andHaddockInfo
for the dependency.There is also a new set of rules in
haskell/nix.bzl
to generate these rules from a nixpkgs definition with just a bit of boilerplate (see the documentation ofhaskell_nixpkgs_packages
).Apart from the testsuite, I've succesfully tried it on a mid-sized haskell repository (apart from doctest, but it wasn't working before either because of #367, so nothing new on this side)
@mrkkrp since you proposed some help, there's probably a lot to say regarding this PR as it is my first real skylark work and I'm not familiar with the internals of
rules_haskell