Commit graph

9 commits

Author SHA1 Message Date
sterni 2140791f9b
ocamlPackages.janeStreet{,_0_9_0}: join the ocamlPackages fix point, allowing overriding to work as expected (#113696)
* ocamlPackages.janeStreet_0_9_0: join the ocamlPackages fix point

Internal dependencies in the janeStreet sets were always taken from the
own rec attribute set. While this is pretty simple and convenient, it
has the disadvantage that it doesn't play nice with overriding: If you'd
override an attribute in a janeStreet set previously, it would be
changed when referenced directly, but the other packages in that
janeStreet set still would use the original, non-overridden version of
the derivation.

This is easily fixed by passing janeStreet_0_9_0 itself from the fix
point of ocamlPackages and using it to reference the dependencies.

Example showing it now works as expected:

test-overlay.nix:

    self: super: {
      ocamlPackages = super.ocamlPackages.overrideScope (old: _: {
        janeStreet_0_9_0 = old.janeStreet_0_9_0 // {
          base = old.janeStreet_0_9_0.base.overrideAttrs (_: {
            meta.broken = true;
          });
        };
      });
    }

nix-repl> (import ./. {
  overlays = [ (import ./test-overlay.nix) ];
}).ocamlPackages.janeStreet_0_9_0.stdio

error: Package ‘ocaml4.10.0-base-0.9.4’ in /home/lukas/src/nix/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage.nix:6 is marked as broken, refusing to evaluate.

a) To temporarily allow broken packages, you can use an environment variable
   for a single invocation of the nix tools.

     $ export NIXPKGS_ALLOW_BROKEN=1

b) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

* ocamlPackages.janeStreet: take part in fixpoint for OCaml >= 4.08

This change makes overrides to the janeStreet set work as expected by
making the janeStreet set take part in the ocamlPackages fixpoint for
janeStreet 0.14, i. e. OCaml >= 4.08

* ocamlPackages.janeStreet: take part in fixpoint for OCaml == 4.07

This change makes overrides to the janeStreet set work as expected by
making the janeStreet set take part in the ocamlPackages fixpoint for
janeStreet 0.12, i. e. OCaml == 4.07

* ocamlPackages.janeStreet: take part in fixpoint for OCaml < 4.07

This change makes overrides to the janeStreet set work as expected by
making the janeStreet set take part in the ocamlPackages fixpoint for
janeStreet 0.11, i. e. OCaml < 4.07

* ocamlPackages.janeStreet: remove self - super distinction

Previously, we inherited non-janestreet ocaml dependencies from super
and janestreet dependencies from self which always was super.janeStreet.

This behavior is however not really what we want due to liftJaneStreet:
Users and other packages will use ocamlPackages.base etc. instead of
ocamlPackages.janeStreet.base and the like. Consequently they also would
override the top-level attributes which would mean that other janestreet
packages would not pick up on it however.

As a consequence however, overriding ocamlPackages.janeStreet.base
doesn't work. Since this was never possible, I don't think this is an
issue. It is probably a good idea to deprecate that set anyways and
printing a warning when it is used via trace.

janeStreet_0_9_0 is unchanged as the disticniton between self and super
makes sense for it.

Below is an example showing how overriding would work from an user's
perspective:

test-overlay.nix:

    self: super: {
      ocamlPackages = super.ocamlPackages.overrideScope (old: _: {
        base = old.base.overrideAttrs (_: {
          meta.broken = true;
        });
      });
    }

nix-repl> (import ./. { overlays = [ (import ./test-overlay.nix) ]; }).ocamlPackages.
stdio
error: Package ‘ocaml4.10.0-base-0.14.0’ in /home/lukas/src/nix/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix:12 is marked as broken, refusing to evaluate.

a) To temporarily allow broken packages, you can use an environment variable
   for a single invocation of the nix tools.

     $ export NIXPKGS_ALLOW_BROKEN=1

b) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.
2021-04-11 12:26:10 +02:00
sternenseemann 1979284362 ocamlPackages.ctypes: 0.17.1 -> 0.18.0
https://github.com/ocamllabs/ocaml-ctypes/blob/0.18.0/CHANGES.md#ctypes-0180

* ocamlPackages.async_ssl: fix compatibility with ctypes 0.18.0 by using
  ctypes.foreign instead of ctypes.foreign.threaded since the distinction
  between threaded and unthreaded has been removed in this release.
* libbap: link with -thread so linking ctypes.foreign doesn't fail
  https://github.com/BinaryAnalysisPlatform/bap-bindings/issues/18
* ocaml-ng.ocamlPackages_4_07.sodium: patch lib_gen/_tags to also add
  the `package(bigarray)` directive since `ctypes.stubs` no longer
  propgates that, leading to module not found error.
* ocaml-ng.ocamlPackages_4_{04,05,06,07}.async_ssl: mark as broken: due to
  the bigarray-compat dependency, we need dune 2 for ctypes which breaks
  compilation of the legacy async_ssl 0.11 version since we can't
  upgrade to dune 2 for it since that version doesn't support the legacy
  jbuild files.
2021-03-10 16:12:03 +01:00
Vincent Laporte 6b023dc690 ocamlPackages.re2: fix building with clang 2020-01-20 10:18:53 +01:00
Vincent Laporte d1ee1bd06a ocamlPackages.ecaml: init at 0.12.0 2019-11-01 06:54:04 +00:00
Vincent Laporte dc6b299e09 ocamlPackages.patience_diff: init at 0.12.0 2019-10-03 08:26:41 +02:00
Vincent Laporte 33c36dd2f4 ocamlPackages.expect_test_helpers: init at 0.12.0 2019-10-03 08:26:41 +02:00
Vincent Laporte 2c87f4f07e ocamlPackages.expect_test_helpers_kernel: init at 0.12.0 2019-10-03 08:26:41 +02:00
Vincent Laporte e0dcde83b0 ocamlPackages.sexp_pretty: init at 0.12.0 2019-10-03 08:26:41 +02:00
Vincent Laporte 748046d594 ocamlPackages.janeStreet: init at 0.12 (for OCaml ≥ 4.07)
Also add a few legacy packages at version 0.11 for OCaml ≥ 4.07: configurator,
ppx_core, ppx_driver, ppx_type_conv

ocamlPackages.bap: disable for OCaml ≥ 4.07

ocamlPackages.bistro: 0.4.0 -> 0.5.0
2019-09-10 14:05:26 +00:00