3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/ocaml-modules
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
..
afl-persistent
alcotest
angstrom
angstrom-async
angstrom-lwt-unix
angstrom-unix
ansiterminal
apron
arp
asn1-combinators
astring
atd
atdgen
awa
bap
base64
batteries
benchmark
bheap
bigarray-compat
bigarray-overlap
bigstring
bigstringaf
bin_prot
biniou
biocaml
bisect_ppx
bistro
bitstring
bitv
bolt
bos
ca-certs
cairo2
calendar
camlimages
camlpdf
camlzip
camomile
caqti
carton
cfstream
charInfo_width
checkseum
cil
cmdliner
cohttp
comparelib
conduit
config-file
containers
cow
cpdf
cpu
cpuid
crowbar
cryptgps
cryptokit
csexp
cstruct
csv
ctypes
curly
curses
decompress
diet
digestif
directories
dispatch
dns
dolmen
dolog
domain-name
dtoa
duff
dum
dune-action-plugin
dune-build-info
dune-configurator
dune-glob
dune-private-libs
duration
dypgen
earley
earlybird
easy-format
eigen
either
elina
eliom
elpi
emile
encore
enumerate
eqaf
erm_xml
erm_xmpp
estring
ethernet
expat
extlib
ezjsonm
ezxmlm
facile
faillib
faraday
farfadet
fdkaac
fiat-p256
fieldslib
fileutils
fix
fmt
fontconfig
fpath
frontc
functoria
functory
gapi-ocaml
gen
genspio
gg
git
gmap
gmetadom
gnuplot
graphics
graphql
graphql_ppx
gsl
gtktop
hacl_x25519
herelib
hex
hidapi
higlo
hkdf
hmap
http
httpaf
hxd
imagelib
index
inifiles
inotify
integers
io-page
ipaddr
iri
irmin
irmin-watcher
iso8601
iter
janestreet
javalib
jingoo
jsonm
jwto
kafka
ke
lablgl
lablgtk
lablgtk-extras
lablgtk3
labltk
lacaml
lambda-term
lambdasoup
lens
linenoise
llvm
logs
lru
lua-ml
luv
lwt
lwt-dllist
lwt_log
lwt_react
lwt_ssl
macaddr
macaque
magic-mime
magick
mariadb
markup
mdx
menhir
merlin-extend
metrics
mew
mew_vi
mimic
minisat
mirage
mirage-block
mirage-block-ramdisk
mirage-block-unix
mirage-bootvar-unix
mirage-channel
mirage-clock
mirage-console
mirage-crypto
mirage-device
mirage-flow
mirage-fs
mirage-kv
mirage-logs
mirage-nat
mirage-net
mirage-profile
mirage-protocols
mirage-random
mirage-random-test
mirage-stack
mirage-time
mirage-unix
mirage-vnetif
mlgmp
mlgmpidl
mmap
mparser
mtime
mustache
mysql
nocrypto
nonstd
notty
npy
num
ocaml-cairo
ocaml-freestanding
ocaml-gettext
ocaml-libvirt
ocaml-lsp
ocaml-migrate-parsetree
ocaml-monadic
ocaml-protoc
ocaml-r
ocaml-result
ocaml-sat-solvers
ocaml-syntax-shims
ocaml-text
ocaml-version
ocamlfuse
ocamlgraph
ocamlmake
ocamlnat
ocamlnet
ocamlsdl
ocb-stubblr
ocf
ocp-ocamlres
ocplib-endian
ocplib-json-typed
ocplib-simplex
ocsigen-deriving
ocsigen-server
ocsigen-start
ocsigen-toolkit
octavius
ocurl
odate
odn
odoc
omd
opam-core
opam-file-format
opam-format
opam-repository
opam-state
opium
opium_kernel
optcomp
opti
optint
otfm
otr
ounit
ounit2
owee
owl
owl-base
pa_bench
pa_ounit
parany
parmap
parse-argv
pbkdf
pcap-format
pcre
pecu
pgocaml
pgsolver
phylogenetics
pipebang
piqi
piqi-ocaml
posix
postgresql
pprint
ppx_bap
ppx_blob
ppx_cstubs
ppx_derivers
ppx_deriving
ppx_deriving_protobuf
ppx_deriving_rpc
ppx_deriving_yojson
ppx_gen_rec
ppx_import
ppx_tools
ppx_tools_versioned
ppx_yojson_conv_lib
ppxfind
ppxlib
printbox
process
prof_spacetime
progress
psmt2-frontend
psq
ptime
ptmap
ptset
pycaml
qcheck
qtest
randomconv
re
react
reactivedata
repr
resource-pooling
rope
rpclib
rresult
safepass
sawja
secp256k1
sedlex
semaphore-compat
seq
sha
sodium
sosa
spacetime_lib
spelll
sqlite3
sqlite3EZ
srt
ssl
stdint
stdlib-shims
stringext
syslog
syslog-message
tcpip
tcslib
terminal_size
tls
toml
topkg
torch
trie
tsdl
tsort
tuntap
twt
type_conv
typerep
tyxml
uchar
ulex
uri
uucd
uucp
uuidm
uunf
uuseg
uutf
variantslib
vchan
vg
visitors
wasm
webbrowser
webmachine
wodan
wtf8
x509
xenstore
xenstore-tool
xenstore_transport
xml-light
xmlm
xtmpl
yaml
yojson
z3
zarith
zed
zmq