Skip to content
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

ocamlPackages: init xenstore, xenstore_transport, vchan, tls-mirage, conduit-mirage and cohttp-mirage #109621

Merged
merged 7 commits into from Jan 24, 2021

Conversation

sternenseemann
Copy link
Member

Motivation for this change

Reference #23955.

Add more MirageOS packages which also are required for git-mirage >= 3.0.0:

  • xenstore
  • xenstore_transport
  • tls-mirage
  • vchan
  • conduit-mirage
  • cohttp-mirage

Where the last package depends on all of the packages listed before.

We also add xenstore-tool which is shipped with xenstore_transport. We could also consider putting it into top level as it is a simple cli that doesn't ship with an OCaml library of any kind.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@sternenseemann
Copy link
Member Author

@GrahamcOfBorg build ocamlPackages.cohttp-mirage ocamlPackages.xenstore-tool ocaml-ng.ocamlPackages_4_08.cohttp-mirage

};

nativeBuildInputs = [
ppx_sexp_conv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be propagated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really? I isn't listed in the libraries field of any dune file, is it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not in the source, but after compilation, it ends up in the dune-package and META files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, is fixed!

pkgs/development/ocaml-modules/vchan/default.nix Outdated Show resolved Hide resolved
@vbgl vbgl merged commit 2483ca4 into NixOS:master Jan 24, 2021
@sternenseemann sternenseemann deleted the cohttp-mirage-2.5.4 branch January 24, 2021 17:21
@sternenseemann sternenseemann restored the cohttp-mirage-2.5.4 branch January 24, 2021 20:06
@sternenseemann sternenseemann deleted the cohttp-mirage-2.5.4 branch January 24, 2021 20:09
sha256 = "1kxxd9i4qiq98r7sgvl59iq2ni7y6drnv48qj580q5cyiyyc85q3";
};

propagatedBuildInputs = [ xenstore lwt ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sternenseemann this is missing a dependency on stdlib-shims

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really? Neither in opam nor anywhere in the repository stdlib-shims is referencend.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh that's actually saying xenstore requires it, not xenstore_transport.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm it could also be a dune 2 quirk. I default to dune2 for building all packages

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On master everything builds fine for me with 4.11 as well, can you reproduce it there?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I triggered it as well now in a nixpkgs-review with OCaml 4.10. Weird.

builder for '/nix/store/5fxwkbvnmjg61dxi60dsqysxgjg6gmri-ocaml4.10.0-xenstore_transport-1.3.0.drv' failed with exit code 1; last 10 log lines:
  building
  File "/nix/store/1f7xs83sak49nmkkhsbkd8m2bxy1mn1z-ocaml4.10.0-xenstore-2.1.1/lib/ocaml/4.10.0/site-lib/xenstore/dune-package", line 10, characters 19-31:
  10 |  (requires cstruct stdlib-shims)
                          ^^^^^^^^^^^^
  Error: Library "stdlib-shims" not found.
  -> required by library "xenstore" in
     /nix/store/1f7xs83sak49nmkkhsbkd8m2bxy1mn1z-ocaml4.10.0-xenstore-2.1.1/lib/ocaml/4.10.0/site-lib/xenstore
  Hint: try:
    dune external-lib-deps --missing -p xenstore_transport -j 8 @install

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha! should we add that as a dependency to xenstore then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still a little weird to me that it isn't present upstream, but dune-package seems to require it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really confused by this because I don't get what circumstances trigger this issue. On master the following turn up no results:

grep -r "stdlib-shims" $(nix-build -A ocamlPackages.xenstore --no-out-link)

So sometimes dune-package requires stdlib-shims and sometimes it doesn't?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants