nixpkgs/pkgs/top-level
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
..
agda-packages.nix
aliases.nix aliases: add mising date 2021-04-08 13:08:53 +02:00
all-packages.nix mdevd: init at 0.1.3.0 2021-04-11 10:22:29 +00:00
beam-packages.nix
config.nix
coq-packages.nix coqtail-math: init at 20201124 2021-04-09 10:05:32 +02:00
darwin-packages.nix darwin.binutils: use clang for as on aarch64-darwin (#115167) 2021-03-17 00:27:34 -04:00
default.nix
dhall-packages.nix
dotnet-packages.nix
emacs-packages.nix
emscripten-packages.nix
gnuradio-packages.nix gnuradioPackages: use same python for all packages 2021-04-03 17:06:08 +02:00
haskell-packages.nix ghc: drop obsolete compiler version 8.10.3 2021-03-12 21:23:15 +01:00
haxe-packages.nix
impure.nix
java-packages.nix
kodi-packages.nix kodi.packages.inputstream-rtmp: init at 3.4.0 2021-03-23 21:11:35 -04:00
lua-packages.nix mysql: deprecate alias 2021-04-04 03:18:57 +02:00
make-tarball.nix
metrics.nix metrics: drop requiredSystemFeatures; /cc #76776 2021-03-28 12:08:59 +02:00
ocaml-packages.nix ocamlPackages.janeStreet{,_0_9_0}: join the ocamlPackages fix point, allowing overriding to work as expected (#113696) 2021-04-11 12:26:10 +02:00
octave-packages.nix octave.pkgs.sparsersb: remove librsb null override, unbreak (#115838) 2021-03-10 23:28:10 +01:00
packages-config.nix emacs26: Drop unsupported package 2021-03-02 16:17:37 +02:00
perl-packages.nix perlPackages.NetCIDRLite: 0.21 -> 0.22 2021-04-05 18:02:52 +02:00
php-packages.nix v8: 7.4.255 -> 8.4.255 2021-03-29 15:25:17 +02:00
pure-packages.nix
python-packages.nix python3Packages.pyenvisalink: init at 4.1 2021-04-10 15:31:56 -07:00
qt5-packages.nix mapbox-gl-qml: 1.7.5 -> 1.7.6 and move to libsForQt5 2021-03-21 18:46:46 +01:00
release-alternatives.nix
release-cross.nix
release-lib.nix
release-python.nix
release-small.nix lzma: deprecate alias 2021-04-04 19:49:52 +02:00
release.nix
ruby-packages.nix rubyPackages.kramdown: 2.3.0 -> 2.3.1 2021-03-30 07:45:19 +09:00
splice.nix
stage.nix
static.nix pkgsStatic: comment on brotli disabled 2021-03-29 19:40:05 +07:00
unixtools.nix
wine-packages.nix