I’m working with the guix package for ocaml, specifically the latest version ocaml-5.0 which sources a git-reference and downloads version 5.0.0 as well as 4.14.1 of the ocaml compiler, and it puts the 4.14.1 version on the path while both are in the guix store.
$ find /gnu/store -name 'ocamlc'
/gnu/store/09mcap7b798l1qcl6gq675g18sic707f-ocaml-5.0.0/bin/ocamlc
/gnu/store/97a4bm7z22cr7n6nw610nfh42g5cql95-profile/bin/ocamlc
/gnu/store/2svlw5lki4y9lidqxympqwc442419y19-profile/bin/ocamlc
/gnu/store/55mpnb02a2mycc1c6nbfmmf094dcqzm8-profile/bin/ocamlc
/gnu/store/gh99shc3cdls89bppwyq0ks27gnsaq3p-ocaml-4.14.1/bin/ocamlc
/gnu/store/g4zrx79p1g872l08rq2kpq6skwjp6hyj-ocaml-5.0.0/bin/ocamlc
/gnu/store/brxlliydayc2y7p212jrip72nc6kih98-profile/bin/ocamlc
/gnu/store/qmbjq25c52dr8x148dmf5sz470jvwmky-profile/bin/ocamlc
/gnu/store/6238f7zg7czfk77m62yxm3wca94ni1db-profile/bin/ocamlc
/gnu/store/fbsh02axbr6qimd2ld83q7iq3h35f2ns-profile/bin/ocamlc
/gnu/store/7dpdqypfbaz8nn90pcb253fsprdssrxy-ocaml-5.0.0/bin/ocamlc
/gnu/store/n3h47jcrq5hm7mzln6z53zz9j9jpn5nm-ocaml-4.14.1/bin/ocamlc
/gnu/store/rwxkyl97slhllm9b05pjmcl39ssnb6lh-ocaml-4.14.1/bin/ocamlc
/gnu/store/vkci332a96v14kr1wm64mz246sai0fx7-ocaml-4.14.1/bin/ocamlc
/gnu/store/gsj3w4yzv0qmpk4jxw5nkxrs1icj8758-profile/bin/ocamlc
/gnu/store/jp7zrvl0wpx1dx3y9kmxwczs0ny9jxxw-ocaml-5.0.0/bin/ocamlc
$ ocamlc --version
4.14.1
What’s the standard way of working with a package like this? Is there a means by which I choose which version of the compiler I want on the path or is this an error in the package?
(use-modules
(guix packages)
(guix build-system dune)
(guix gexp)
(guix licenses)
(gnu packages ocaml))
(package
(name "test_proj")
(version "1.0.0")
(source #f)
(build-system dune-build-system)
(inputs (list zlib))
(native-inputs (list ocaml-5.0 dune ocaml-utop))
(synopsis "A dune test project")
(description "An OCAML test project using Dune as the package manager")
(home-page "https://foo.bar.baz")
(license gpl3+))