Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] amd64 stable: unison doesnt compile with ocaml-4.04
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
pietinger
n00b
n00b


Joined: 17 Oct 2006
Posts: 48

PostPosted: Tue Feb 14, 2017 1:53 pm    Post subject: [solved] amd64 stable: unison doesnt compile with ocaml-4.04 Reply with quote

I get:

Code:

ocamlopt: ubase/prefs.mli ---> ubase/prefs.cmi
ocamlopt -g -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -c /var/tmp/portage/portage/net-misc/unison-2.48.3/work/unison-2.48.3/system.ml
ocamlopt -g -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -c /var/tmp/portage/portage/net-misc/unison-2.48.3/work/unison-2.48.3/ubase/prefs.mli
ocamlopt: lwt/lwt_util.ml ---> lwt/lwt_util.cmx
File "/var/tmp/portage/portage/net-misc/unison-2.48.3/work/unison-2.48.3/system.ml", line 1:
Error: The implementation /var/tmp/portage/portage/net-misc/unison-2.48.3/work/unison-2.48.3/system.ml
       does not match the interface system.cmi:
       Values do not match:
         val symlink : ?to_dir:bool -> string -> string -> unit
       is not included in
         val symlink : string -> fspath -> unit
make: *** [Makefile.OCaml:434: system.cmx] Error 2


with google I found this link: https://github.com/bcpierce00/unison/issues/12

So, how can I compile unison with ocaml 4.02. ?


Last edited by pietinger on Wed Feb 15, 2017 9:00 am; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 21779
Location: here

PostPosted: Tue Feb 14, 2017 3:07 pm    Post subject: Reply with quote

You have tried to apply proposed patch?
For apply user patch with portage you can see wiki
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
pietinger
n00b
n00b


Joined: 17 Oct 2006
Posts: 48

PostPosted: Tue Feb 14, 2017 8:02 pm    Post subject: Reply with quote

fedeliallalinea wrote:
You have tried to apply proposed patch?


No. Maybe this is too much comlicated for me ... (I am not that power user). My thinking was, the easiest way would be to tell portage should take an older version of ocaml (something with "masking"). But if there is no solution I have to look for other apps than unison.
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 21779
Location: here

PostPosted: Tue Feb 14, 2017 8:27 pm    Post subject: Reply with quote

If you don't want try patches the only solution is downgrade ocaml and masking version 4.04.0 (echo "=dev-lang/ocaml-4.04.0" >> /etc/portage/package.mask).

it's not that complicated to apply patches, the steps are:
  • if not exists create file /etc/portage/bashrc with content
    Code:
    pre_src_prepare() {
        [[ ${EAPI:-0} == [012345] ]] || return
        if ! type epatch_user > /dev/null 2>&1; then
            local names="EPATCH_USER_SOURCE epatch_user epatch evar_push evar_push_set evar_pop estack_push estack_pop"
            source <(awk "/^# @(FUNCTION|VARIABLE): / { p = 0 } /^# @(FUNCTION|VARIABLE): (${names// /|})\$/ { p = 1 } p { print }" ${PORTDIR}/eclass/eutils.eclass)
        fi

        epatch_user

        for name in $names; do
            unset $name
        done
    }

  • create directory
    Code:
    mkdir -p /etc/portage/patches/net-misc/unison-2.48.3

  • save patch in this directory
    Code:
    # cd /etc/portage/patches/net-misc/unison-2.48.3
    # wget "https://github.com/bcpierce00/unison/files/252406/patch1.txt" -O unison-ocaml1.patch
    # wget "https://github.com/bcpierce00/unison/files/252405/patch2.txt" -O unison-ocaml2.patch

  • try to compile unison
    Code:
    # emerge -1 unison


_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
pietinger
n00b
n00b


Joined: 17 Oct 2006
Posts: 48

PostPosted: Tue Feb 14, 2017 10:31 pm    Post subject: Reply with quote

fedeliallalinea wrote:
[...] it's not that complicated to apply patches, the steps are: [...]


Wow. Thank you very much for this excellent description. I will try it and report you ... and ... you gave me a backup also:

fedeliallalinea wrote:
If you don't want try patches the only solution is downgrade ocaml and masking version 4.04.0 (echo "=dev-lang/ocaml-4.04.0" >> /etc/portage/package.mask).
Back to top
View user's profile Send private message
pietinger
n00b
n00b


Joined: 17 Oct 2006
Posts: 48

PostPosted: Tue Feb 14, 2017 10:55 pm    Post subject: Reply with quote

It works !! Thank you very much again. Please allow me a last question: When the next version of unison will be available, I olnly have to delete the bashrc - or only the patches - or both ?
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 21779
Location: here

PostPosted: Wed Feb 15, 2017 6:58 am    Post subject: Reply with quote

pietinger wrote:
It works !! Thank you very much again. Please allow me a last question: When the next version of unison will be available, I olnly have to delete the bashrc - or only the patches - or both ?

You can remove patches just for remove mess, but if version change the patches is not applied because you have specified the version with directory name unison-2.48.3.
The file bashrc is for apply to all ebuild the user patch, this because in EAPI<=5 the function epatch_user (that which applies user patch from directory in /etc/portage/patches) is not mandatory, so you can keep this file.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Frautoincnam
Tux's lil' helper
Tux's lil' helper


Joined: 19 May 2017
Posts: 76

PostPosted: Wed May 24, 2017 9:05 pm    Post subject: Reply with quote

fedeliallalinea wrote:

Code:
pre_src_prepare() {
}



Is it possible this is never called anymore ?
I use that for a long time, but it doesn't apply patches for a while.
I even modified it like told in https://wiki.gentoo.org/wiki//etc/portage/patches#Enabling_.2Fetc.2Fportage.2Fpatches_for_all_ebuilds unsuccessfull.

Other thing, I can see that now, bashrc is called several times during emerge files. So I tried adding
Code:
[ "${EBUILD_PHASE}" == "unpack" ] || exit 0

but not better.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum