Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 709646 - net-misc/unison-2.48.4-r1 fails to build with dev-lang/ocaml-4.09
Summary: net-misc/unison-2.48.4-r1 fails to build with dev-lang/ocaml-4.09
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major with 4 votes (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-14 18:38 UTC by charles17
Modified: 2020-07-26 05:07 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge --info,6.40 KB, text/plain)
2020-02-14 18:38 UTC, charles17
Details
build.log (build.log,11.60 KB, text/x-log)
2020-02-14 18:39 UTC, charles17
Details
unison-2.51.2 build log (build.log,19.30 KB, text/x-log)
2020-02-16 10:17 UTC, charles17
Details
Patch for unison-2.48 (unison-2.48.4-ocaml-4.08.patch,2.20 KB, patch)
2020-03-17 16:17 UTC, Petr Zima
Details | Diff
Patch for unison-2.51 (unison-2.51.2-ocaml-4.08.patch,1.66 KB, patch)
2020-03-17 16:18 UTC, Petr Zima
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description charles17 2020-02-14 18:38:42 UTC
Created attachment 613834 [details]
emerge --info

emerge -pqv '=net-misc/unison-2.48.4-r1::gentoo'
[ebuild  N    ] net-misc/unison-2.48.4-r1  USE="gtk ocamlopt -debug -doc -static -test -threads"
Comment 1 charles17 2020-02-14 18:39:57 UTC
Created attachment 613836 [details]
build.log
Comment 2 Jonas Stein gentoo-dev 2020-02-14 19:18:55 UTC
"This expression has type bytes but an expression was expected of type string"

Please test and report, if 2.51.2 works for you.

Can you see, if it was reported/fixed upstream already?
https://github.com/bcpierce00/unison
Comment 3 charles17 2020-02-16 10:17:19 UTC
Created attachment 614014 [details]
unison-2.51.2 build log

(In reply to Jonas Stein from comment #2)
> "This expression has type bytes but an expression was expected of type
> string"
> 
> Please test and report, if 2.51.2 works for you.

See build.log attached



> Can you see, if it was reported/fixed upstream already?
> https://github.com/bcpierce00/unison

»Error: This expression has type string but an expression was expected of type bytes« 
is mentioned two years ago in https://github.com/bcpierce00/unison/issues/128#issuecomment-359622046
Comment 4 charles17 2020-02-16 10:35:26 UTC
See https://bugs.gentoo.org/704910#c7
Comment 5 charles17 2020-02-16 10:41:28 UTC
Similar was fixed for app-misc/geneweb with https://bugs.gentoo.org/707312#c7
Comment 6 charles17 2020-02-20 08:10:40 UTC
Please change dependency to
DEPEND="<dev-lang/ocaml-4.09[ocamlopt?]
Comment 7 El Goretto 2020-03-13 10:26:27 UTC
(In reply to charles17 from comment #6)
> Please change dependency to
> DEPEND="<dev-lang/ocaml-4.09[ocamlopt?]

I can confirm masking dev-lang/ocaml-4.09.0 allows net-misc/unison-2.48.4-r1 to be built.
Comment 8 Petr Zima 2020-03-17 16:15:20 UTC
Confirming here too, Debian has a patch.
Comment 10 Petr Zima 2020-03-17 16:18:38 UTC
Created attachment 620920 [details, diff]
Patch for unison-2.51
Comment 11 Konstantin Münning 2020-04-03 13:31:10 UTC
(In reply to Petr Zima from comment #10)
> Created attachment 620920 [details, diff] [details, diff]
> Patch for unison-2.51

Without this patch unison-2.51.2 with ocaml-4.09.0 fails with this error:

File "/var/tmp/portage/net-misc/unison-2.51.2/work/src/system.ml", line 1:
Error: The implementation /var/tmp/portage/net-misc/unison-2.51.2/work/src/system.ml
       does not match the interface system.cmi:
       Values do not match:
         val link : ?follow:bool -> string -> string -> unit
       is not included in
         val link : fspath -> fspath -> unit
       File "/var/tmp/portage/net-misc/unison-2.51.2/work/src/system/system_intf.ml", line 70, characters 0-35:
         Expected declaration
       File "/var/tmp/portage/net-misc/unison-2.51.2/work/src/system/system_generic.ml", line 50, characters 4-8:
         Actual declaration
make: *** [Makefile.OCaml:423: system.cmx] Error 2
make: *** Waiting for unfinished jobs....

This patch fixes this for me.
Comment 12 Bruce Guenter 2020-04-07 17:09:04 UTC
With the patch for unison-2.48 applied, I am able to build unison with ocaml-4.09. However, the resulting program is not interoperable with the same version built with ocaml-4.04:

Failed: Server: Fatal error during unmarshaling (input_value: ill-formed message),
possibly because client and server have been compiled with different versions of the OCaml compiler.

I do not know enough about OCaml to know what might have changed with the compiler. It does not appear that the patch should have caused this, unless possibly it has an effect on the sort order. Since the unison build for Ubuntu (and presumably others) has been built with the older OCaml compiler, this seems to makes interoperability impossible.
Comment 13 Petr Zima 2020-04-07 18:07:16 UTC
(In reply to Bruce Guenter from comment #12)
> ... However, the resulting program is not interoperable with the
> same version built with ocaml-4.04 ...

That's completely normal with unison, you need to have both endpoints compiled with the same version of ocaml. Maybe it's even written somewhere in the unison docs. I guess it's because unison uses some language-level serialization which is very dependent on the compiler. Some close versions may be compatible but generally they are not.
Comment 14 Petr Zima 2020-04-07 18:13:51 UTC
(In reply to Bruce Guenter from comment #12)
> ... Since the unison build for
> Ubuntu (and presumably others) has been built with the older OCaml compiler,
> this seems to makes interoperability impossible.

I was struggling with Gentoo <-> Debian in the past. At the moment Debian uses ocaml-4.08 which is luckily compatible with Gentoo's ocaml-4.09. You have two options, either compile fresh versions of ocaml and unison manually on Ubuntu (that's what I formerly did on Debian) or downgrade ocaml on Gentoo, 4.04 is still available.

Slotting ocaml would help in this regard, but I am not sure if it's worth the effort otherwise.
Comment 15 Thomas Capricelli 2020-04-27 01:15:58 UTC
I'm hit by this as well (and I'm pretty sure unison is the only ocaml program here)

Could the dependancy be fixed in the unison ebuild ?
Comment 16 Calvin Jay Ross 2020-05-14 18:20:29 UTC
(In reply to Thomas Capricelli from comment #15)
> I'm hit by this as well (and I'm pretty sure unison is the only ocaml
> program here)
> 
> Could the dependancy be fixed in the unison ebuild ?

Yeah, I managed to modify the ebuild to apply a compatibility patch for OCaml 4.08 and it works fine. Though, I'm brand new to gentoo, so I'm currently looking into proposing the changes.
Comment 17 Thomas Capricelli 2020-06-12 22:42:55 UTC
(In reply to Calvin Jay Ross from comment #16)
> Yeah, I managed to modify the ebuild to apply a compatibility patch for
> OCaml 4.08 and it works fine. Though, I'm brand new to gentoo, so I'm
> currently looking into proposing the changes.

That looks like what "proxy maintainer" aims to facilitate... Did you contact gentoo dev ? (on irc for exemple)
Comment 18 Sam James gentoo-dev Security 2020-07-12 01:13:49 UTC
(In reply to Calvin Jay Ross from comment #16)
> Yeah, I managed to modify the ebuild to apply a compatibility patch for
> OCaml 4.08 and it works fine. Though, I'm brand new to gentoo, so I'm
> currently looking into proposing the changes.

You can share the patch here and/or via a Github PR without taking on responsibility for the package.