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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unison: fix build with ocamlPackages_4_09 #82619

Merged
merged 2 commits into from Mar 16, 2020
Merged

Conversation

winterdeaf
Copy link
Contributor

Motivation for this change

Fixes #61867 and #61505, bumps the ocaml version unison is built
against to 4.09. The patches included here appear in the trunk version
of unison, but were not backported to 2.51.2.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Fixes NixOS#61867 and NixOS#61505, bumps the ocaml version unison is built
against to 4.09. The patches included here appear in the trunk version
of unison, but were not backported to 2.51.2.
@vbgl
Copy link
Contributor

vbgl commented Mar 15, 2020

Why choosing OCaml 4.09 rather than the default version of OCaml in nixpkgs?

@winterdeaf
Copy link
Contributor Author

Local and remote instances need to be built with the same (or very close) Ocaml versions to communicate -- it could be good to pin it to a fixed version, but I don't know whether 4.09 is ideal. Debian/Ubuntu are shipping Unison 2.48 w/ Ocaml 4.08, Archlinux is using 4.09. The current default version in nixpkg is 4.07, which I cannot sync with my other hosts.

We could maybe add an configuration option to specify the Ocaml to use, if there is an easy way to make it select the correct patches.

@vbgl
Copy link
Contributor

vbgl commented Mar 16, 2020

Generally speaking, packages in nixpkgs can easily be overridden. For instance, here is how to change the version of OCaml used for building unison:

unison.override { ocamlPackages = ocaml-ng.ocamlPackages_4_02; }

The patches that you add in this PR fix the build of unison with all versions of OCaml between 4.06 and 4.09 (included). Therefore, I don’t see a good reason to choose a different default version of OCaml than in the rest of nixpkgs.

pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
Co-Authored-By: Vincent Laporte <vbgl@users.noreply.github.com>
@winterdeaf
Copy link
Contributor Author

unison.override { ocamlPackages = ocaml-ng.ocamlPackages_4_02; }

Sounds good to me.

@vbgl
Copy link
Contributor

vbgl commented Mar 16, 2020

@GrahamcOfBorg build unison usync

@vbgl vbgl merged commit 3355e8d into NixOS:master Mar 16, 2020
vbgl pushed a commit to vbgl/nixpkgs that referenced this pull request Mar 16, 2020
Fixes NixOS#61867 and NixOS#61505, bumps the ocaml version unison is built
against to 4.08. The patches included here appear in the trunk version
of unison, but were not backported to 2.51.2.

(cherry picked from commit 3355e8d)
@vbgl
Copy link
Contributor

vbgl commented Mar 16, 2020

Merged into 20.03 as 27eca64

Thanks!

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.

unison fails t build, citing 'Unbound value Gpointer.region_of_string' (nixOs 19.03)
2 participants