Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 538206 - dev-ml/camlp4-4.02.0_p1 version bump
Summary: dev-ml/camlp4-4.02.0_p1 version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Team for the ML programming language family
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-29 22:55 UTC by hfk22
Modified: 2015-01-30 13:15 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hfk22 2015-01-29 22:55:10 UTC
There's a bug in this version of camlp4 that makes the toplevel virtually unusable.  Basically, anytime we load in camlp4, each command must be terminated with around 9 end of file (^D) characters.  The attached URL describes this issue in more detail and it looks like it was fixed in 4.02.1+1.  There's been a couple of other bug fixes since then and the most current bug fix is 4.02.1+2, which would be nice to get in a version bump.

Reproducible: Always

Steps to Reproduce:
1. ocaml
2. #use "topfind"
3. #camlp4o
4. let x = 2;;
5. ^D^D^D^D^D^D^D^D^D
Actual Results:  
We get the correct value (x=2), but we needed 9 end of file characters to do so.

Expected Results:  
We should just get the correct value (x=2) without having to do the end of file characters.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2015-01-30 08:53:42 UTC
The latest release seems to be the _p1 ebuild which translates to 4.02.0+1. The bug you reference was fixed before that release.
Comment 2 hfk22 2015-01-30 10:32:08 UTC
Are you sure?  The 4.02.0+1 release done on Sep 2, 2014 whereas this bug was not fixed until commit 1c084ef on Oct 21, 2014:

https://github.com/ocaml/camlp4/commit/1c084ef126f129b14046e8afe6ce2c8bc6e4bf7a

This fix was the last bit merged into 4.02.1+1 with commit d2a0c33:

https://github.com/ocaml/camlp4/commit/d2a0c33f65b68127be436c4c60f5935a2d38340f

and is also included in 4.02.1+2.  The tag 4.02.0.0+1 corresponds to commit 7f25650, which is 17 commits behind 4.02.1+1 and 23 commits behind 4.02.1+2.  More importantly, 4.02.0.0+1 doesn't appear to contain the bug fix, which occured 16 commits after the tag.
Comment 3 Alexis Ballier gentoo-dev 2015-01-30 10:37:13 UTC
you're right, that's just github "hiding" latest releases...


but, by copying 4.02.0_p1-r1 to 4.02.1_p2, I get build failures, e.g. with type-conv:

+ /usr/bin/ocamlfind ocamldep -syntax camlp4o -package camlp4.quotations -package camlp4.extend -modules lib/pa_type_conv.ml > lib/pa_type_conv.ml.depends
Camlp4: Uncaught exception: DynLoader.Error ("Camlp4OCamlRevisedParser.cmo", "file not found in path")

File "lib/pa_type_conv.ml", line 1:
Error: Error while running external preprocessor
Command line: camlp4 '-I' '/usr/lib64/ocaml/camlp4' '-I' '/usr/lib64/ocaml/camlp4' '-I' '/usr/lib64/ocaml/camlp4' '-I' '/usr/lib64/ocaml/camlp4' '-parser' 'o' '-parser' 'op' '-printer' 'p' '-parser' 'Camlp4QuotationCommon' '-parser' 'Camlp4OCamlRevisedQuotationExpander' '-ignore' 'foo' '-parser' 'Camlp4GrammarParser'  'lib/pa_type_conv.ml' > /var/tmp/portage/dev-ml/type-conv-112.01.00/temp/ocamlpp54270b

Command exited with code 2.
Compilation unsuccessful after building 3 targets (0 cached) in 00:00:00.
E: Failure("Command ''/usr/bin/ocamlbuild' lib/pa_type_conv.cma lib/pa_type_conv.cmxa lib/pa_type_conv.a lib/pa_type_conv.cmxs -use-ocamlfind' terminated with error code 10")




not sure if I did something wrong
Comment 4 hfk22 2015-01-30 11:12:51 UTC
I see it too.  It looks like camlp4 moved where it put its parsers, which is messing up the build for type-conv.  Evidently, it messed up some other utilities as well:

https://github.com/ocaml/opam-repository/issues/2882

I'll check if there's an easy fix.
Comment 5 hfk22 2015-01-30 12:43:42 UTC
Alright, the problem has to do with DESTDIR.  Basically, prior to 4.02.1, DESTDIR was not recognized.  This was fixed in 4.02.1, which means that the ebuild needs to be updated.  Here's what I'm using and seemed to work on my system:

# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ml/camlp4/camlp4-4.02.0_p1-r1.ebuild,v 1.1 2014/11/29 14:53:17 aballier Exp $

EAPI=5

MY_PV=${PV/_p/+}
MY_P=${PN}-${MY_PV}

DESCRIPTION="System for writing extensible parsers for programming languages"
HOMEPAGE="https://github.com/ocaml/camlp4"
SRC_URI="https://github.com/ocaml/camlp4/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"

LICENSE="LGPL-2-with-linking-exception"
SLOT="0/${PV}"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-fbsd ~x86-linux"
IUSE="+ocamlopt"

DEPEND=">=dev-lang/ocaml-4.02:=[ocamlopt?]"
RDEPEND="${DEPEND}
        !<dev-ml/findlib-1.5.5-r1"

S=${WORKDIR}/${P/_p/-}

src_configure() {
        ./configure \
                --bindir=/usr/bin \
                --libdir="$(ocamlc -where)" \
                --pkgdir="$(ocamlc -where)" \
                || die
}

src_compile() {
        emake byte
        use ocamlopt && emake native
}

src_install() {
        emake DESTDIR="${D}" install install-META
        dodoc CHANGES.md README.md
}

Here's the diff to camlp4-4.02.0_p1-r1.ebuild:

# diff camlp4-4.02.0_p1-r1.ebuild camlp4-4.02.1_p2.ebuild
27,29c27,29
<               --bindir="${ED}/usr/bin" \
<               --libdir="${D}$(ocamlc -where)" \
<               --pkgdir="${D}$(ocamlc -where)" \
---
>               --bindir=/usr/bin \
>               --libdir="$(ocamlc -where)" \
>               --pkgdir="$(ocamlc -where)" \
39c39
<       emake install install-META
---
>       emake DESTDIR="${D}" install install-META

With this new version of camlp4, the bug I mentioned above disappears.
Comment 6 Alexis Ballier gentoo-dev 2015-01-30 13:15:10 UTC
bumped, thanks (with some adjustments for gentoo-prefix that are hopefuly more correct)