Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 709646

Summary: net-misc/unison-2.48.4-r1 fails to build with dev-lang/ocaml-4.09
Product: Gentoo Linux Reporter: charles17
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: major CC: bleszynski, bruce, chris, frainz, gentoo, jstein, orzel, sam, toralf, zima
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/17927
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 750335    
Bug Blocks: 749606, 737154    
Attachments: emerge --info
build.log
unison-2.51.2 build log
Patch for unison-2.48
Patch for unison-2.51

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 archtester Gentoo Infrastructure 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.
Comment 19 charles17 2020-10-14 11:33:09 UTC
The 2.48 branch was probably never enabled for ocaml-4.09.
See the »Compatibility with OCaml 4.08« commit on https://github.com/bcpierce00/unison/commits/unison-2.48
Maybe better restrict to ocaml-4.08
Comment 20 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-17 01:28:07 UTC
*** Bug 733720 has been marked as a duplicate of this bug. ***
Comment 21 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-17 01:28:13 UTC
*** Bug 739426 has been marked as a duplicate of this bug. ***
Comment 22 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-17 01:28:39 UTC
*** Bug 704910 has been marked as a duplicate of this bug. ***
Comment 23 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-17 01:28:45 UTC
*** Bug 749348 has been marked as a duplicate of this bug. ***
Comment 24 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-17 01:29:39 UTC
The patches here will fix compatibility with 4.09.0, but not 4.10.0. Worth looking at because 4.09.0 is in stable now.

I suspect the latest release (rc right now) will work with 4.10.0, but that will only be for the latest slot.
Comment 25 Larry the Git Cow gentoo-dev 2020-10-17 08:32:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71df67d36b63cbe65b3eb9a8b91c07ccb2ac9071

commit 71df67d36b63cbe65b3eb9a8b91c07ccb2ac9071
Author:     Volkmar W. Pogatzki <gentoo@pogatzki.net>
AuthorDate: 2020-10-14 14:43:39 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2020-10-17 08:32:04 +0000

    net-misc/unison: build with ocaml-4.09.0
    
    Patches from https://bugs.gentoo.org/709646 applied
    Restricting to <=dev-lang/ocaml-4.09:=
    Does not build with ocaml-4.10.0
    
    Closes: https://bugs.gentoo.org/709646
    Bug: https://bugs.gentoo.org/739426
    Bug: https://bugs.gentoo.org/733720
    
    Package-Manager: Portage-3.0.8, Repoman-3.0.1
    Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../unison/files/unison-2.48.4-ocaml-4.08.patch    | 79 +++++++++++++++++++
 .../unison/files/unison-2.51.2-ocaml-4.08.patch    | 50 ++++++++++++
 net-misc/unison/unison-2.48.4-r2.ebuild            | 90 ++++++++++++++++++++++
 net-misc/unison/unison-2.51.2-r1.ebuild            | 86 +++++++++++++++++++++
 4 files changed, 305 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2759ca74611a5aebdc14a873670a26f66a899107

commit 2759ca74611a5aebdc14a873670a26f66a899107
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2020-10-17 08:31:56 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2020-10-17 08:32:05 +0000

    net-misc/unison: bump to 2.51.3_rc2
    
    Bug: https://bugs.gentoo.org/709646
    Package-Manager: Portage-3.0.8, Repoman-3.0.1
    Signed-off-by: Sam James <sam@gentoo.org>

 net-misc/unison/Manifest                 |  1 +
 net-misc/unison/unison-2.51.3_rc2.ebuild | 84 ++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
Comment 26 Till Schäfer 2020-10-19 11:26:41 UTC
why is this marked as resolve while the current stable (2.48.4-r1) still fails to build?
I think revision 2 should be stabilized as well.