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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[unison] use ocaml 4.02 #17352

Closed
wants to merge 2 commits into from
Closed

Conversation

mguentner
Copy link
Contributor

Motivation for this change

I see referenced issues. Hopefully this is the last PR 馃槳

Things done
  • Tested using sandboxing
    (nix.useChroot on NixOS,
    or option build-use-chroot in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Maximilian G眉ntner added 2 commits July 28, 2016 23:30
Signed-off-by: Maximilian G眉ntner <code@maschinenpsychologe.de>
The format values of ocaml 4.01 and 4.02 are not compatible.
As most distributions now use 4.02 NixOS should also build
unison with 4.02 to be compatible.

ref: NixOS#17209
ref: https://bugs.archlinux.org/task/43241

closes NixOS#17278

Signed-off-by: Maximilian G眉ntner <code@maschinenpsychologe.de>
@mention-bot
Copy link

@mguentner, thanks for your PR! By analyzing the annotation information on this pull request, we identified @edolstra, @kosmikus and @Fuuzetsu to be potential reviewers

@mguentner mguentner mentioned this pull request Jul 28, 2016
7 tasks
@obadz
Copy link
Contributor

obadz commented Jul 30, 2016

nix-build -A unison gets me this error:

ocamlopt -I /nix/store/fkpsdcx386rl0wd5z2vqdpfwy3nxzw1j-lablgtk-2.18.3/lib/ocaml/4.01.0/site-lib/lablgtk2 -g -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -I +lablgtk2 -c /tmp/nix-build-unison-2.48.4.drv-0/src/uigtk2.mli
ocamlopt -I /nix/store/fkpsdcx386rl0wd5z2vqdpfwy3nxzw1j-lablgtk-2.18.3/lib/ocaml/4.01.0/site-lib/lablgtk2: uigtk2.ml ---> uigtk2.cmx
ocamlopt -I /nix/store/fkpsdcx386rl0wd5z2vqdpfwy3nxzw1j-lablgtk-2.18.3/lib/ocaml/4.01.0/site-lib/lablgtk2 -g -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -I +lablgtk2 -c /tmp/nix-build-unison-2.48.4.drv-0/src/uigtk2.ml
File "/tmp/nix-build-unison-2.48.4.drv-0/src/uigtk2.ml", line 1:
Error: /nix/store/fkpsdcx386rl0wd5z2vqdpfwy3nxzw1j-lablgtk-2.18.3/lib/ocaml/4.01.0/site-lib/lablgtk2/pango.cmi
is not a compiled interface for this version of OCaml.
It seems to be for an older version of OCaml.
make: *** [Makefile.OCaml:435: uigtk2.cmx] Error 2

@mguentner
Copy link
Contributor Author

Ah sorry. I only tested it without X11/gui support. Will look into it...

@thufschmitt
Copy link
Member

I think this is the wrong way to do.

Binaries generated by different versions of the ocaml compiler aren't
compatible, so unison needs to be linked against dependencies built with the
same version of the compiler.

That's why different set of ocaml packages exists, one for each packaged
version of the compiler : ocamlPackages_3_10_0, ocamlPackages_4_00_1,
ocamlPackages_4_01_0, ocamlPackages_4_02 and so on.

ocamlPackages is just an alias for ocamlPackages_4_01 (btw, it may should be
more than good to set the default to ocaml 4.02).

Unison should be defined in the mkOcamlPackages in the
all-packages.nix file, so that the exists an
ocamlPackages_4_01.unison, ocamlPackages_4_02.unison, etc.. ; which
all points to a version compiled against the good compiler[1].

So to get a version of unison compiled agains 4.02, you would just have to
install ocamlPackages_4_02.unison instead of ocamlPackages.unison.

[1]: And for backward compatibility, I assume it would be good to keep a unison = ocamlPackages.unison alias.

@joachifm
Copy link
Contributor

I agree with @regnat that this isn't the best way to approach the problem, I think we can close this for now.

@joachifm joachifm closed this Nov 29, 2016
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

5 participants