httpaf icon indicating copy to clipboard operation
httpaf copied to clipboard

Add build / develop environment in Nix

Open Nymphium opened this issue 3 years ago • 2 comments

This PR adds Nix for easy-to-setup and reproducable build and develop environment. test

Nymphium avatar Jan 24 '22 06:01 Nymphium

I'm not sure I understand why we want to test 3 different versions of OCaml in nix in the actions as opposed to just testing the latest. Also, it looks like those giant nix files are generated, but I'm not sure how to regenerate them or if we really need to check them in. Can you shed some light on that process?

dpatti avatar Feb 01 '22 19:02 dpatti

I'm not sure I understand why we want to test 3 different versions of OCaml in nix in the actions as opposed to just testing the latest.

Httpaf accepts OCaml >= 4.0.3 and opam2nix, which generates nix expression from opam file, can be used with OCaml >= 4.11.0, so the action tests the three latest versions. Is it preferred to test only the latest version same as current?

Also, it looks like those giant nix files are generated, but I'm not sure how to regenerate them or if we really need to check them in. Can you shed some light on that process?

nix/opam-selection_VERSION.nix can be generated as following:

$ nix-shell default.nix -A resolve --argstr ocamlVersion 4_12 # for OCaml 4.12.x

ocamlVersion refers nix/ocamlDefaultVersion.nix by default.

These file preserves reproducability like ".opam.lock", but its saves dependent packave version based on opam commit hash and also depexts without version. Versions of epexts can be managed via commid hash ov nixpkgs.

Nymphium avatar Feb 07 '22 07:02 Nymphium