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.
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.
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.
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
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.
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.
bumped, thanks (with some adjustments for gentoo-prefix that are hopefuly more correct)