reflex-frp / reflex-platform

A curated package set and set of tools that let you build Haskell packages so they can run on a variety of platforms. reflex-platform is built on top of the nix package manager.
https://reflex-frp.org
BSD 3-Clause "New" or "Revised" License
721 stars 164 forks source link

Upstream `work-on-multi` into Nixpkgs's `shellFor` #586

Open Ericson2314 opened 4 years ago

Ericson2314 commented 4 years ago

See definition of shellFor in https://github.com/NixOS/nixpkgs/blob/8e4c9d15456fd3a35044bcea864d558fade4a021/pkgs/development/haskell-modules/make-package-set.nix#L253-L323 . It works today by splitting the dependencies as "haskell" vs "system", and then making a shell based off of this.

This, however, is too coarse-grained. We should instead first combine all the packages as work-ont-multi does. In the cross case we should also make two ghcWithPackages calls, one for Setup.hs with setup depends and buildHaskellPackages.ghcWithPackages in addition to the regular one. In the native case, we should combine regular haskell dependencies with setup-depends for one big ghcWithPackages call.

Ericson2314 commented 4 years ago

To anyone working on this, take a glance at https://github.com/NixOS/nixpkgs/pulls?utf8=%E2%9C%93&q=is%3Apr+shellFor+ for the history of shellFor, and https://github.com/NixOS/nixpkgs/pull/46453 in particular.

I think the plan should be to somewhat undo https://github.com/NixOS/nixpkgs/commit/51267d3982dd23d02413c891cccbdd18107a8b44 from that PR, in that .env will not use shellFor. Instead, shellFor would use .env: The logic from shellFor that is moved back inside generic-builder to define the .env, and the remaining bits of shellFor are replaced with work-on-multi, combining the packages into one package from which to get and use a .env.

Ericson2314 commented 4 years ago

Nixpkgs side is is in https://github.com/NixOS/nixpkgs/pull/76349. After that's merged and we switch to 19.09, we can then use it from reflex-platform.