snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 39 forks source link

Configure libraries according to build flavour/target. #636

Open chitrak7 opened 6 years ago

chitrak7 commented 6 years ago

Currently, we configure libraries in package rules and they are configured in vanilla context. I think we should remove all instaces of vanilla context and replace them with flavors that they are built in or the targets.

This approach is not only confusing but creates a lot of errors. I think we should use input flavours even in the default target(stage1). @angerman @snowleopard @alpmestan @izgzhen Any commnets/Suggestions??

chitrak7 commented 6 years ago

This issue also addresses the issue with #626 .

alpmestan commented 6 years ago

I think this is the right way to go, yes. If we get a --flavour (or perf if none is given explicitly), we should then maybe assume that users want all the rules to just adapt the work they're doing to respect the ways dictated by the flavour, etc. vanillaContext is definitely overly used. We might want to think about whether we still want perf to be the default flavour for say validate or binary-dist, which in the make build system for most intents and purposes are suppose to be executed against a fixed flavour. But otherwise, following this principle sounds reasonable to me, and at least it gives us a principled way to figure out what to build and not to build and in what ways etc.

snowleopard commented 6 years ago

@chitrak7 I agree with @alpmestan's comments.