All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Compiling latest coccinelle with opensuse
@ 2015-10-13 20:19 Luis R. Rodriguez
  2015-10-13 20:26 ` Julia Lawall
  2015-10-14 10:32 ` [Cocci] Compiling Coccinelle with specific OCaml versions on openSUSE SF Markus Elfring
  0 siblings, 2 replies; 31+ messages in thread
From: Luis R. Rodriguez @ 2015-10-13 20:19 UTC (permalink / raw)
  To: cocci

I'm trying to build coccinelle to use on opensuse for a cocci file
with iteration support. I'm using the latest and greatest (inria git).

After ./autogen and and then configuring with --enable-release:

configure flags:  --enable-release
findlib:          /usr/bin/ocamlfind (an actual version is strongly recommended)
menhir:           /usr/local/bin//menhir (should be an optional tool)
menhirLib module: yes (for local package use --disable-menhirLib)

ocaml scripting:  yes (overridable with --enable-ocaml)
python scripting: yes (overridable with --enable-python)
pycaml module:    local (for local package use --disable-pycaml)

pcre regexes:     local (overridable with --enable-pcre-syntax)
pcre module:      local (for local package use --disable-pcre)
pcre library:     yes (requires the dev version of libpcre)

release config:   yes (strongly recommended to be 'yes', overridable
with --enable-release)
optimized spatch: yes (overridable with --disable-opt)

My build fails with:

/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra
-I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.ml
File "parser_cocci_menhir.ml", line 1:
Error: The files /usr/lib64/ocaml/obj.cmi
       and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
       make inconsistent assumptions over interface Obj
Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed
make[6]: *** [parser_cocci_menhir.cmx] Error 2
make[6]: *** Waiting for unfinished jobs....
make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
Makefile:61: recipe for target 'all.opt' failed
make[5]: *** [all.opt] Error 2
make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
Makefile:202: recipe for target 'parsing_cocci.opt' failed
make[4]: *** [parsing_cocci.opt] Error 2
make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
Makefile:196: recipe for target 'subdirs.opt' failed
make[3]: *** [subdirs.opt] Error 1
make[3]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
Makefile:167: recipe for target 'opt-compil' failed
make[2]: *** [opt-compil] Error 2
make[2]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
Makefile:147: recipe for target 'all-release' failed
make[1]: *** [all-release] Error 2
make[1]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
Makefile:125: recipe for target 'all' failed
make: *** [all] Error 2


If I try to disable ocaml scripting with:

./configure --enable-release --disable-ocaml

My build still fails with:

/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra
-I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.ml
File "parser_cocci_menhir.ml", line 1:
Error: The files /usr/lib64/ocaml/obj.cmi
       and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
       make inconsistent assumptions over interface Obj
Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed

If I disable good 'ol mehir as well with:

./configure --enable-release --disable-ocaml --disable-menhirLib

it does not seem to disable menhir:

Summary

configure flags:  --enable-release --disable-ocaml --disable-menhirLib
--disable-menhirlib
findlib:          /usr/bin/ocamlfind (an actual version is strongly recommended)
menhir:           /usr/local/bin//menhir (should be an optional tool)
menhirLib module: local (for local package use --disable-menhirLib)

ocaml scripting:  no (overridable with --enable-ocaml)
python scripting: yes (overridable with --enable-python)
pycaml module:    local (for local package use --disable-pycaml)

pcre regexes:     local (overridable with --enable-pcre-syntax)
pcre module:      local (for local package use --disable-pcre)
pcre library:     yes (requires the dev version of libpcre)

release config:   yes (strongly recommended to be 'yes', overridable
with --enable-release)
optimized spatch: yes (overridable with --disable-opt)

I checked configure.ac but can't see why disabling menhirLib won't work.

If I nuke my local menhir, then:

./configure --enable-release --disable-ocaml

Summary

configure flags:  --enable-release --disable-ocaml
findlib:          /usr/bin/ocamlfind (an actual version is strongly recommended)
menhir:           /home/mcgrof/devel/coccinelle/setup/fake-menhir.sh
menhir (should be an optional tool)
menhirLib module: yes (for local package use --disable-menhirLib)

ocaml scripting:  no (overridable with --enable-ocaml)
python scripting: yes (overridable with --enable-python)
pycaml module:    local (for local package use --disable-pycaml)

pcre regexes:     local (overridable with --enable-pcre-syntax)
pcre module:      local (for local package use --disable-pcre)
pcre library:     yes (requires the dev version of libpcre)

release config:   yes (strongly recommended to be 'yes', overridable
with --enable-release)
optimized spatch: yes (overridable with --disable-opt)

then I get:

/home/mcgrof/devel/coccinelle/setup/fake-menhir.sh menhir --ocamlc
"/usr/bin/ocamlc.opt" --ocamldep "/usr/bin/ocamldep" --table --base
parser_cocci_menhir parser_cocci_menhir.mly
error: the file parser_cocci_menhir.ml is needed, which requires
preprocessing by menhir to obtain it from parser_cocci_menhir.mly.
However, menhir is not enabled.
error: the file parser_cocci_menhir.ml is needed, which requires
preprocessing by menhir to obtain it from parser_cocci_menhir.mly.
However, menhir is not enabled.
make[3]: *** No rule to make target 'parser_cocci_menhir.ml', needed
by 'depend'.  Stop.
make[3]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
Makefile:566: recipe for target 'depend' failed

  Luis

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 20:19 [Cocci] Compiling latest coccinelle with opensuse Luis R. Rodriguez
@ 2015-10-13 20:26 ` Julia Lawall
  2015-10-13 20:37   ` Luis R. Rodriguez
  2015-10-14 10:32 ` [Cocci] Compiling Coccinelle with specific OCaml versions on openSUSE SF Markus Elfring
  1 sibling, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-13 20:26 UTC (permalink / raw)
  To: cocci

On Tue, 13 Oct 2015, Luis R. Rodriguez wrote:

> I'm trying to build coccinelle to use on opensuse for a cocci file
> with iteration support. I'm using the latest and greatest (inria git).
> 
> After ./autogen and and then configuring with --enable-release:
> 
> configure flags:  --enable-release
> findlib:          /usr/bin/ocamlfind (an actual version is strongly recommended)
> menhir:           /usr/local/bin//menhir (should be an optional tool)
> menhirLib module: yes (for local package use --disable-menhirLib)
> 
> ocaml scripting:  yes (overridable with --enable-ocaml)
> python scripting: yes (overridable with --enable-python)
> pycaml module:    local (for local package use --disable-pycaml)
> 
> pcre regexes:     local (overridable with --enable-pcre-syntax)
> pcre module:      local (for local package use --disable-pcre)
> pcre library:     yes (requires the dev version of libpcre)
> 
> release config:   yes (strongly recommended to be 'yes', overridable
> with --enable-release)
> optimized spatch: yes (overridable with --disable-opt)
> 
> My build fails with:
> 
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra
> -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.ml
> File "parser_cocci_menhir.ml", line 1:
> Error: The files /usr/lib64/ocaml/obj.cmi
>        and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
>        make inconsistent assumptions over interface Obj

Try make clean, or make distclean.  If you had a build without ocaml, you 
may have some old code lying around.

julia

> Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed
> make[6]: *** [parser_cocci_menhir.cmx] Error 2
> make[6]: *** Waiting for unfinished jobs....
> make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
> Makefile:61: recipe for target 'all.opt' failed
> make[5]: *** [all.opt] Error 2
> make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
> Makefile:202: recipe for target 'parsing_cocci.opt' failed
> make[4]: *** [parsing_cocci.opt] Error 2
> make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> Makefile:196: recipe for target 'subdirs.opt' failed
> make[3]: *** [subdirs.opt] Error 1
> make[3]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> Makefile:167: recipe for target 'opt-compil' failed
> make[2]: *** [opt-compil] Error 2
> make[2]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> Makefile:147: recipe for target 'all-release' failed
> make[1]: *** [all-release] Error 2
> make[1]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> Makefile:125: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> 
> If I try to disable ocaml scripting with:
> 
> ./configure --enable-release --disable-ocaml
> 
> My build still fails with:
> 
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra
> -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.ml
> File "parser_cocci_menhir.ml", line 1:
> Error: The files /usr/lib64/ocaml/obj.cmi
>        and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
>        make inconsistent assumptions over interface Obj
> Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed
> 
> If I disable good 'ol mehir as well with:
> 
> ./configure --enable-release --disable-ocaml --disable-menhirLib
> 
> it does not seem to disable menhir:
> 
> Summary
> 
> configure flags:  --enable-release --disable-ocaml --disable-menhirLib
> --disable-menhirlib
> findlib:          /usr/bin/ocamlfind (an actual version is strongly recommended)
> menhir:           /usr/local/bin//menhir (should be an optional tool)
> menhirLib module: local (for local package use --disable-menhirLib)
> 
> ocaml scripting:  no (overridable with --enable-ocaml)
> python scripting: yes (overridable with --enable-python)
> pycaml module:    local (for local package use --disable-pycaml)
> 
> pcre regexes:     local (overridable with --enable-pcre-syntax)
> pcre module:      local (for local package use --disable-pcre)
> pcre library:     yes (requires the dev version of libpcre)
> 
> release config:   yes (strongly recommended to be 'yes', overridable
> with --enable-release)
> optimized spatch: yes (overridable with --disable-opt)
> 
> I checked configure.ac but can't see why disabling menhirLib won't work.
> 
> If I nuke my local menhir, then:
> 
> ./configure --enable-release --disable-ocaml
> 
> Summary
> 
> configure flags:  --enable-release --disable-ocaml
> findlib:          /usr/bin/ocamlfind (an actual version is strongly recommended)
> menhir:           /home/mcgrof/devel/coccinelle/setup/fake-menhir.sh
> menhir (should be an optional tool)
> menhirLib module: yes (for local package use --disable-menhirLib)
> 
> ocaml scripting:  no (overridable with --enable-ocaml)
> python scripting: yes (overridable with --enable-python)
> pycaml module:    local (for local package use --disable-pycaml)
> 
> pcre regexes:     local (overridable with --enable-pcre-syntax)
> pcre module:      local (for local package use --disable-pcre)
> pcre library:     yes (requires the dev version of libpcre)
> 
> release config:   yes (strongly recommended to be 'yes', overridable
> with --enable-release)
> optimized spatch: yes (overridable with --disable-opt)
> 
> then I get:
> 
> /home/mcgrof/devel/coccinelle/setup/fake-menhir.sh menhir --ocamlc
> "/usr/bin/ocamlc.opt" --ocamldep "/usr/bin/ocamldep" --table --base
> parser_cocci_menhir parser_cocci_menhir.mly
> error: the file parser_cocci_menhir.ml is needed, which requires
> preprocessing by menhir to obtain it from parser_cocci_menhir.mly.
> However, menhir is not enabled.
> error: the file parser_cocci_menhir.ml is needed, which requires
> preprocessing by menhir to obtain it from parser_cocci_menhir.mly.
> However, menhir is not enabled.
> make[3]: *** No rule to make target 'parser_cocci_menhir.ml', needed
> by 'depend'.  Stop.
> make[3]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
> Makefile:566: recipe for target 'depend' failed
> 
>   Luis
> _______________________________________________
> Cocci mailing list
> Cocci at systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
> 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 20:26 ` Julia Lawall
@ 2015-10-13 20:37   ` Luis R. Rodriguez
  2015-10-13 20:44     ` Julia Lawall
                       ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Luis R. Rodriguez @ 2015-10-13 20:37 UTC (permalink / raw)
  To: cocci

On Tue, Oct 13, 2015 at 1:26 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Tue, 13 Oct 2015, Luis R. Rodriguez wrote:
>
>> I'm trying to build coccinelle to use on opensuse for a cocci file
>> with iteration support. I'm using the latest and greatest (inria git).
>>
>> After ./autogen and and then configuring with --enable-release:
>>
>> configure flags:  --enable-release
>> findlib:          /usr/bin/ocamlfind (an actual version is strongly recommended)
>> menhir:           /usr/local/bin//menhir (should be an optional tool)
>> menhirLib module: yes (for local package use --disable-menhirLib)
>>
>> ocaml scripting:  yes (overridable with --enable-ocaml)
>> python scripting: yes (overridable with --enable-python)
>> pycaml module:    local (for local package use --disable-pycaml)
>>
>> pcre regexes:     local (overridable with --enable-pcre-syntax)
>> pcre module:      local (for local package use --disable-pcre)
>> pcre library:     yes (requires the dev version of libpcre)
>>
>> release config:   yes (strongly recommended to be 'yes', overridable
>> with --enable-release)
>> optimized spatch: yes (overridable with --disable-opt)
>>
>> My build fails with:
>>
>> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra
>> -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.ml
>> File "parser_cocci_menhir.ml", line 1:
>> Error: The files /usr/lib64/ocaml/obj.cmi
>>        and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
>>        make inconsistent assumptions over interface Obj
>
> Try make clean, or make distclean.  If you had a build without ocaml, you
> may have some old code lying around.

Instead of 'make clean' or 'make distclean' I do:

git clean -f -x -d

Its faster than 'make clean' but caution: this will delete *anything*
from your tree that is *not* in a git record, so watch out. Only try
this on a repo you don't care about.

Even if I try make distclean things still fail, as suspected. I've
tried all combination all around with distclean, clean etc.

mcgrof at ergon ~/devel/coccinelle (git::master)$ rpm -qa | grep ocaml
ocaml-ocamldoc-4.02.3-1.1.x86_64
ocaml-runtime-4.02.3-1.1.x86_64
ocaml-camlp4-devel-4.02.1-1.5.x86_64
ocaml-facile-1.1-193.6.x86_64
ocaml-4.02.3-1.1.x86_64
ocaml-camlp4-4.02.1-1.5.x86_64
ocaml-findlib-1.5.5-1.6.x86_64
ocaml-compiler-libs-4.02.3-1.1.x86_64

All these seem to be up to date.

 Luis

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 20:37   ` Luis R. Rodriguez
@ 2015-10-13 20:44     ` Julia Lawall
  2015-10-13 20:49       ` Luis R. Rodriguez
  2015-10-13 20:58     ` Julia Lawall
  2015-10-14 15:22     ` [Cocci] Compiling latest Coccinelle with openSUSE SF Markus Elfring
  2 siblings, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-13 20:44 UTC (permalink / raw)
  To: cocci



On Tue, 13 Oct 2015, Luis R. Rodriguez wrote:

> On Tue, Oct 13, 2015 at 1:26 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> > On Tue, 13 Oct 2015, Luis R. Rodriguez wrote:
> >
> >> I'm trying to build coccinelle to use on opensuse for a cocci file
> >> with iteration support. I'm using the latest and greatest (inria git).
> >>
> >> After ./autogen and and then configuring with --enable-release:
> >>
> >> configure flags:  --enable-release
> >> findlib:          /usr/bin/ocamlfind (an actual version is strongly recommended)
> >> menhir:           /usr/local/bin//menhir (should be an optional tool)
> >> menhirLib module: yes (for local package use --disable-menhirLib)
> >>
> >> ocaml scripting:  yes (overridable with --enable-ocaml)
> >> python scripting: yes (overridable with --enable-python)
> >> pycaml module:    local (for local package use --disable-pycaml)
> >>
> >> pcre regexes:     local (overridable with --enable-pcre-syntax)
> >> pcre module:      local (for local package use --disable-pcre)
> >> pcre library:     yes (requires the dev version of libpcre)
> >>
> >> release config:   yes (strongly recommended to be 'yes', overridable
> >> with --enable-release)
> >> optimized spatch: yes (overridable with --disable-opt)
> >>
> >> My build fails with:
> >>
> >> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra
> >> -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.ml
> >> File "parser_cocci_menhir.ml", line 1:
> >> Error: The files /usr/lib64/ocaml/obj.cmi
> >>        and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
> >>        make inconsistent assumptions over interface Obj
> >
> > Try make clean, or make distclean.  If you had a build without ocaml, you
> > may have some old code lying around.

Ah, OK sorry, it may have nothing to do with Coccinelle.  How did you 
install menhir?  And how did you install ocaml?  It looks like there may 
be files generated by different versions of ocaml in your lib64 directory.

Could you try the following:

file /usr/lib64/ocaml/obj.cmi
file /usr/lib64/ocaml/menhirLib/menhirLib.cmi

It should tell you what version of ocaml generated the files.

julia

> Instead of 'make clean' or 'make distclean' I do:
> 
> git clean -f -x -d
> 
> Its faster than 'make clean' but caution: this will delete *anything*
> from your tree that is *not* in a git record, so watch out. Only try
> this on a repo you don't care about.
> 
> Even if I try make distclean things still fail, as suspected. I've
> tried all combination all around with distclean, clean etc.
> 
> mcgrof at ergon ~/devel/coccinelle (git::master)$ rpm -qa | grep ocaml
> ocaml-ocamldoc-4.02.3-1.1.x86_64
> ocaml-runtime-4.02.3-1.1.x86_64
> ocaml-camlp4-devel-4.02.1-1.5.x86_64
> ocaml-facile-1.1-193.6.x86_64
> ocaml-4.02.3-1.1.x86_64
> ocaml-camlp4-4.02.1-1.5.x86_64
> ocaml-findlib-1.5.5-1.6.x86_64
> ocaml-compiler-libs-4.02.3-1.1.x86_64
> 
> All these seem to be up to date.
> 
>  Luis
> 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 20:44     ` Julia Lawall
@ 2015-10-13 20:49       ` Luis R. Rodriguez
  0 siblings, 0 replies; 31+ messages in thread
From: Luis R. Rodriguez @ 2015-10-13 20:49 UTC (permalink / raw)
  To: cocci

On Tue, Oct 13, 2015 at 1:44 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> Ah, OK sorry, it may have nothing to do with Coccinelle.  How did you
> install menhir?

>From source code. But I now deleted it.

> And how did you install ocaml?

OpenSUSE rpm package.

> It looks like there may
> be files generated by different versions of ocaml in your lib64 directory.

I see.

> Could you try the following:
>
> file /usr/lib64/ocaml/obj.cmi
> file /usr/lib64/ocaml/menhirLib/menhirLib.cmi
>
> It should tell you what version of ocaml generated the files.

mcgrof at ergon ~/devel/coccinelle (git::master)$  file /usr/lib64/ocaml/obj.cmi
/usr/lib64/ocaml/obj.cmi: OCaml interface file (.cmi) (Version 017)
mcgrof at ergon ~/devel/coccinelle (git::master)$ file
/usr/lib64/ocaml/menhirLib/menhirLib.cmi
/usr/lib64/ocaml/menhirLib/menhirLib.cmi: OCaml interface file (.cmi)
(Version 017)

  Luis

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 20:37   ` Luis R. Rodriguez
  2015-10-13 20:44     ` Julia Lawall
@ 2015-10-13 20:58     ` Julia Lawall
  2015-10-13 21:14       ` Luis R. Rodriguez
  2015-10-14 15:22     ` [Cocci] Compiling latest Coccinelle with openSUSE SF Markus Elfring
  2 siblings, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-13 20:58 UTC (permalink / raw)
  To: cocci

I doubt it will help much, but you can get rid of the need to link with 
menhirLib by removing the option --table in parsing_cocci/Makefile.  You 
will end up with a .ml file of over 100 000 lines, which may cause other 
problems for the ocaml compiler.

julia

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 20:58     ` Julia Lawall
@ 2015-10-13 21:14       ` Luis R. Rodriguez
  2015-10-13 21:18         ` Julia Lawall
  0 siblings, 1 reply; 31+ messages in thread
From: Luis R. Rodriguez @ 2015-10-13 21:14 UTC (permalink / raw)
  To: cocci

On Tue, Oct 13, 2015 at 10:58:27PM +0200, Julia Lawall wrote:
> I doubt it will help much, but you can get rid of the need to link with 
> menhirLib by removing the option --table in parsing_cocci/Makefile.  You 
> will end up with a .ml file of over 100 000 lines, which may cause other 
> problems for the ocaml compiler.

OK so with:

diff --git a/parsing_cocci/Makefile b/parsing_cocci/Makefile
index eeb249780ffd..190c0273923b 100644
--- a/parsing_cocci/Makefile
+++ b/parsing_cocci/Makefile
@@ -93,7 +93,7 @@ $(LEXER_SOURCES:.mll=.ml) :   $(LEXER_SOURCES)
        $(OCAMLLEX) $(LEXER_SOURCES)
 
 $(PARSER_SOURCES:.mly=.ml) $(PARSER_SOURCES:.mly=.mli) : $(PARSER_SOURCES)
-       $(MENHIR) --ocamlc "${OCAMLC}" --ocamldep "${OCAMLDEP}" --table --base parser_cocci_menhir $(PARSER_SOURCES)
+       $(MENHIR) --ocamlc "${OCAMLC}" --ocamldep "${OCAMLDEP}" --base parser_cocci_menhir $(PARSER_SOURCES)
 
 $(CLI_LEXER_SOURCES:.mll=.ml): $(CLI_LEXER_SOURCES)
        $(OCAMLLEX) $(CLI_LEXER_SOURCES)


Note to readers: menhir is not required for github source compilation,
at the time of writing its required only for internal source builds
(as code gets prep'd for release on to github, so if you are debuggin
builds don't try iunstalling menhir

Without menhir:

/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -c function_prototypes.ml
skipped building semantic_cocci.cmo in optimizing mode: semantic_cocci.cmx will be built instead.
skipped building flag_parsing_cocci.cmo in optimizing mode: flag_parsing_cocci.cmx will be built instead.
skipped building parse_aux.cmo in optimizing mode: parse_aux.cmx will be built instead.
/usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.mli
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.ml
File "parser_cocci_menhir.ml", line 1:
Error: The files /usr/lib64/ocaml/obj.cmi
       and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
       make inconsistent assumptions over interface Obj
Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed


With menhir:


/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -I /usr/lib64/ocaml/menhirLib -a -o cocci_parser.cmxa menhirLib.cmx flag_parsing_cocci.cmx type_cocci.cmx ast_cocci.cmx ast0_cocci.cmx pretty_print_cocci.cmx unparse_ast0.cmx visitor_ast0_types.cmx visitor_ast.cmx visitor_ast0.cmx compute_lines.cmx comm_assoc.cmx iso_pattern.cmx iso_compile.cmx single_statement.cmx simple_assignments.cmx get_metas.cmx ast0toast.cmx check_meta.cmx top_level.cmx type_infer.cmx test_exps.cmx unitary_ast0.cmx arity.cmx index.cmx context_neg.cmx adjust_pragmas.cmx insert_plus.cmx function_prototypes.cmx unify_ast.cmx semantic_cocci.cmx data.cmx free_vars.cmx safe_for_multi_decls.cmx parse_printf.cmx parse_aux.cmx disjdistr.cmx lexer_cocci.cmx parser_cocci_menhir.cmx lexer_cli.cmx lexer_script.cmx cocci_grep.cmx dpll.cmx get_constants2.cmx id_utils.cmx git_grep.cmx adjacency.cmx commas_on_lists.cmx parse_cocci.cmx command_line.cmx
File "_none_", line 1:
Error: Files flag_parsing_cocci.cmx and menhirLib.cmx
       make inconsistent assumptions over interface CamlinternalFormatBasics
Makefile:68: recipe for target 'cocci_parser.cmxa' failed


  Luis

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 21:14       ` Luis R. Rodriguez
@ 2015-10-13 21:18         ` Julia Lawall
  2015-10-13 22:05           ` Luis R. Rodriguez
  0 siblings, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-13 21:18 UTC (permalink / raw)
  To: cocci

On Tue, 13 Oct 2015, Luis R. Rodriguez wrote:

> On Tue, Oct 13, 2015 at 10:58:27PM +0200, Julia Lawall wrote:
> > I doubt it will help much, but you can get rid of the need to link with 
> > menhirLib by removing the option --table in parsing_cocci/Makefile.  You 
> > will end up with a .ml file of over 100 000 lines, which may cause other 
> > problems for the ocaml compiler.
> 
> OK so with:
> 
> diff --git a/parsing_cocci/Makefile b/parsing_cocci/Makefile
> index eeb249780ffd..190c0273923b 100644
> --- a/parsing_cocci/Makefile
> +++ b/parsing_cocci/Makefile
> @@ -93,7 +93,7 @@ $(LEXER_SOURCES:.mll=.ml) :   $(LEXER_SOURCES)
>         $(OCAMLLEX) $(LEXER_SOURCES)
>  
>  $(PARSER_SOURCES:.mly=.ml) $(PARSER_SOURCES:.mly=.mli) : $(PARSER_SOURCES)
> -       $(MENHIR) --ocamlc "${OCAMLC}" --ocamldep "${OCAMLDEP}" --table --base parser_cocci_menhir $(PARSER_SOURCES)
> +       $(MENHIR) --ocamlc "${OCAMLC}" --ocamldep "${OCAMLDEP}" --base parser_cocci_menhir $(PARSER_SOURCES)
>  
>  $(CLI_LEXER_SOURCES:.mll=.ml): $(CLI_LEXER_SOURCES)
>         $(OCAMLLEX) $(CLI_LEXER_SOURCES)
> 
> 
> Note to readers: menhir is not required for github source compilation,
> at the time of writing its required only for internal source builds
> (as code gets prep'd for release on to github, so if you are debuggin
> builds don't try iunstalling menhir
> 
> Without menhir:
> 
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -c function_prototypes.ml
> skipped building semantic_cocci.cmo in optimizing mode: semantic_cocci.cmx will be built instead.
> skipped building flag_parsing_cocci.cmo in optimizing mode: flag_parsing_cocci.cmx will be built instead.
> skipped building parse_aux.cmo in optimizing mode: parse_aux.cmx will be built instead.
> /usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.mli
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.ml
> File "parser_cocci_menhir.ml", line 1:
> Error: The files /usr/lib64/ocaml/obj.cmi
>        and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
>        make inconsistent assumptions over interface Obj
> Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed
> 
> 
> With menhir:
> 
> 
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -I /usr/lib64/ocaml/menhirLib -a -o cocci_parser.cmxa menhirLib.cmx flag_parsing_cocci.cmx type_cocci.cmx ast_cocci.cmx ast0_cocci.cmx pretty_print_cocci.cmx unparse_ast0.cmx visitor_ast0_types.cmx visitor_ast.cmx visitor_ast0.cmx compute_lines.cmx comm_assoc.cmx iso_pattern.cmx iso_compile.cmx single_statement.cmx simple_assignments.cmx get_metas.cmx ast0toast.cmx check_meta.cmx top_level.cmx type_infer.cmx test_exps.cmx unitary_ast0.cmx arity.cmx index.cmx context_neg.cmx adjust_pragmas.cmx insert_plus.cmx function_prototypes.cmx unify_ast.cmx semantic_cocci.cmx data.cmx free_vars.cmx safe_for_multi_decls.cmx parse_printf.cmx parse_aux.cmx disjdistr.cmx lexer_cocci.cmx parser_cocci_menhir.cmx lexer_cli.cmx lexer_script.cmx cocci_grep.cmx dpll.cmx get_constants2.cmx id_utils.cmx git_grep.cmx adjacency.cmx commas_on_lists.cmx parse_cocci.cmx command_line.cmx
> File "_none_", line 1:
> Error: Files flag_parsing_cocci.cmx and menhirLib.cmx
>        make inconsistent assumptions over interface CamlinternalFormatBasics
> Makefile:68: recipe for target 'cocci_parser.cmxa' failed

OK, so it looks like the problem is just postponed.  If you feel 
adventurous, just remove all references to menhirLib in the Coccinelle 
makefiles.  It should not be needed.

julia

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 21:18         ` Julia Lawall
@ 2015-10-13 22:05           ` Luis R. Rodriguez
  2015-10-14  5:26             ` Julia Lawall
  2015-10-14 14:47             ` [Cocci] Compiling latest coccinelle with opensuse Sébastien Hinderer
  0 siblings, 2 replies; 31+ messages in thread
From: Luis R. Rodriguez @ 2015-10-13 22:05 UTC (permalink / raw)
  To: cocci

On Tue, Oct 13, 2015 at 11:18:12PM +0200, Julia Lawall wrote:
> On Tue, 13 Oct 2015, Luis R. Rodriguez wrote:
> 
> > On Tue, Oct 13, 2015 at 10:58:27PM +0200, Julia Lawall wrote:
> > > I doubt it will help much, but you can get rid of the need to link with 
> > > menhirLib by removing the option --table in parsing_cocci/Makefile.  You 
> > > will end up with a .ml file of over 100 000 lines, which may cause other 
> > > problems for the ocaml compiler.
> > 
> > OK so with:
> > 
> > diff --git a/parsing_cocci/Makefile b/parsing_cocci/Makefile
> > index eeb249780ffd..190c0273923b 100644
> > --- a/parsing_cocci/Makefile
> > +++ b/parsing_cocci/Makefile
> > @@ -93,7 +93,7 @@ $(LEXER_SOURCES:.mll=.ml) :   $(LEXER_SOURCES)
> >         $(OCAMLLEX) $(LEXER_SOURCES)
> >  
> >  $(PARSER_SOURCES:.mly=.ml) $(PARSER_SOURCES:.mly=.mli) : $(PARSER_SOURCES)
> > -       $(MENHIR) --ocamlc "${OCAMLC}" --ocamldep "${OCAMLDEP}" --table --base parser_cocci_menhir $(PARSER_SOURCES)
> > +       $(MENHIR) --ocamlc "${OCAMLC}" --ocamldep "${OCAMLDEP}" --base parser_cocci_menhir $(PARSER_SOURCES)
> >  
> >  $(CLI_LEXER_SOURCES:.mll=.ml): $(CLI_LEXER_SOURCES)
> >         $(OCAMLLEX) $(CLI_LEXER_SOURCES)
> > 
> > 
> > Note to readers: menhir is not required for github source compilation,
> > at the time of writing its required only for internal source builds
> > (as code gets prep'd for release on to github, so if you are debuggin
> > builds don't try iunstalling menhir
> > 
> > Without menhir:
> > 
> > /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -c function_prototypes.ml
> > skipped building semantic_cocci.cmo in optimizing mode: semantic_cocci.cmx will be built instead.
> > skipped building flag_parsing_cocci.cmo in optimizing mode: flag_parsing_cocci.cmx will be built instead.
> > skipped building parse_aux.cmo in optimizing mode: parse_aux.cmx will be built instead.
> > /usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.mli
> > /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -c parser_cocci_menhir.ml
> > File "parser_cocci_menhir.ml", line 1:
> > Error: The files /usr/lib64/ocaml/obj.cmi
> >        and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
> >        make inconsistent assumptions over interface Obj
> > Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed
> > 
> > 
> > With menhir:
> > 
> > 
> > /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -I /usr/lib64/ocaml/menhirLib -I /usr/lib64/ocaml/menhirLib -a -o cocci_parser.cmxa menhirLib.cmx flag_parsing_cocci.cmx type_cocci.cmx ast_cocci.cmx ast0_cocci.cmx pretty_print_cocci.cmx unparse_ast0.cmx visitor_ast0_types.cmx visitor_ast.cmx visitor_ast0.cmx compute_lines.cmx comm_assoc.cmx iso_pattern.cmx iso_compile.cmx single_statement.cmx simple_assignments.cmx get_metas.cmx ast0toast.cmx check_meta.cmx top_level.cmx type_infer.cmx test_exps.cmx unitary_ast0.cmx arity.cmx index.cmx context_neg.cmx adjust_pragmas.cmx insert_plus.cmx function_prototypes.cmx unify_ast.cmx semantic_cocci.cmx data.cmx free_vars.cmx safe_for_multi_decls.cmx parse_printf.cmx parse_aux.cmx disjdistr.cmx lexer_cocci.cmx parser_cocci_menhir.cmx lexer_cli.cmx lexer_script.cmx cocci_grep.cmx dpll.cmx get_constants2.cmx id_utils.cmx git_grep.cmx adjacency.cmx commas_on_lists.cmx parse_cocci.cmx command_line.cmx
> > File "_none_", line 1:
> > Error: Files flag_parsing_cocci.cmx and menhirLib.cmx
> >        make inconsistent assumptions over interface CamlinternalFormatBasics
> > Makefile:68: recipe for target 'cocci_parser.cmxa' failed
> 
> OK, so it looks like the problem is just postponed.  If you feel 
> adventurous, just remove all references to menhirLib in the Coccinelle 
> makefiles.  It should not be needed.

Not sure if I've done it right but:

http://drvbp1.linux-foundation.org/~mcgrof/coccinelle/hacks/remove-menhir.patch

Then I ./autogen
and
./configure --enable-release

This ends with:

make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/bundles/parmap/parmap-1.0-rc5-patched'
mv parmap-1.0-rc5-patched/_build/* .
make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/bundles/parmap'
make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
make[4]: Entering directory '/sda3/home/mcgrof/devel/coccinelle'
make[5]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/commons'
make[6]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/commons'
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c commands.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c common.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c interfaces.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c objet.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c seti.ml
skipped building seti.cmo in optimizing mode: seti.cmx will be built instead.
skipped building ocamlextra/setPt.cmo in optimizing mode: ocamlextra/setPt.cmx will be built instead.
/usr/bin/ocamlc.opt -unsafe -I ocamlextra -I ocollection   -c oset.mli
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c oset.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c oassoc.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c osequence.ml
/usr/bin/ocamlc.opt -unsafe -I ocamlextra -I ocollection   -c ograph.mli
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ograph.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/osetb.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassocb.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassoch.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassoc_buffer.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassoc_cache.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassocid.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c oarray.ml
/usr/bin/ocamlc.opt -unsafe -I ocamlextra -I ocollection   -c ograph_simple.mli
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ograph_simple.ml
/usr/bin/ocamlc.opt -unsafe -I ocamlextra -I ocollection   -c ograph_extended.mli
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ograph_extended.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c glimpse.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c parser_combinators.ml
/usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection  -a -o commons.cmxa ocamlextra/dumper.cmx ocamlextra/setb.cmx ocamlextra/mapb.cmx ocamlextra/setPt.cmx commands.cmx common.cmx interfaces.cmx objet.cmx ocollection.cmx seti.cmx oset.cmx oassoc.cmx osequence.cmx ograph.cmx ocollection/osetb.cmx ocollection/oassocb.cmx ocollection/oassoch.cmx ocollection/oassoc_buffer.cmx ocollection/oassoc_cache.cmx ocollection/oassocid.cmx oarray.cmx ograph_simple.cmx ograph_extended.cmx glimpse.cmx parser_combinators.cmx ocamlextra/enum.cmx ocamlextra/dynArray.cmx ocamlextra/suffix_tree.cmx ocamlextra/suffix_tree_ext.cmx
make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/commons'
make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/commons'
make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
make[4]: Entering directory '/sda3/home/mcgrof/devel/coccinelle'
make[5]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/globals'
make[6]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/globals'
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -c config.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -c flag.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -c iteration.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -c regexp.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -a -o globals.cmxa config.cmx flag.cmx iteration.cmx regexp_pcre.cmx regexp.cmx
make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/globals'
make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/globals'
make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
make[4]: Entering directory '/sda3/home/mcgrof/devel/coccinelle'
make[5]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/ctl'
make[6]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/ctl'
skipped building ast_ctl.cmo in optimizing mode: ast_ctl.cmx will be built instead.
/usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c pretty_print_ctl.mli
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c pretty_print_ctl.ml
/usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c ctl_engine.mli
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c ctl_engine.ml
/usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c wrapper_ctl.mli
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c wrapper_ctl.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -a -o ctl.cmxa flag_ctl.cmx ast_ctl.cmx pretty_print_ctl.cmx ctl_engine.cmx wrapper_ctl.cmx
make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/ctl'
make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/ctl'
make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
make[4]: Entering directory '/sda3/home/mcgrof/devel/coccinelle'
make[5]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
make[6]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
skipped building visitor_ast0_types.cmo in optimizing mode: visitor_ast0_types.cmx will be built instead.
/usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c visitor_ast0.mli
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c visitor_ast0.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c comm_assoc.ml
/usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c iso_pattern.mli
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c iso_pattern.ml
/usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c iso_compile.mli
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c iso_compile.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c single_statement.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c simple_assignments.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c get_metas.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c ast0toast.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c check_meta.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c type_infer.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c test_exps.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c unitary_ast0.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c context_neg.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c adjust_pragmas.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c insert_plus.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c function_prototypes.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c parse_aux.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c lexer_cocci.ml
File "lexer_cocci.mll", line 152, characters 61-66:
Error: Unbound type constructor token
Makefile:85: recipe for target 'lexer_cocci.cmx' failed
make[6]: *** [lexer_cocci.cmx] Error 2
make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
Makefile:56: recipe for target 'all.opt' failed
make[5]: *** [all.opt] Error 2
make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
Makefile:202: recipe for target 'parsing_cocci.opt' failed
make[4]: *** [parsing_cocci.opt] Error 2
make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
Makefile:196: recipe for target 'subdirs.opt' failed
make[3]: *** [subdirs.opt] Error 1
make[3]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
Makefile:167: recipe for target 'opt-compil' failed
make[2]: *** [opt-compil] Error 2
make[2]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
Makefile:147: recipe for target 'all-release' failed
make[1]: *** [all-release] Error 2
make[1]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
Makefile:125: recipe for target 'all' failed
make: *** [all] Error 2
 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 22:05           ` Luis R. Rodriguez
@ 2015-10-14  5:26             ` Julia Lawall
  2015-10-14  7:11               ` Sébastien Hinderer
  2015-10-14 14:47             ` [Cocci] Compiling latest coccinelle with opensuse Sébastien Hinderer
  1 sibling, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-14  5:26 UTC (permalink / raw)
  To: cocci

> 
> Not sure if I've done it right but:
> 
> http://drvbp1.linux-foundation.org/~mcgrof/coccinelle/hacks/remove-menhir.patch

No, it's not quite right.  You got rid of things that reference menhir.  
You should only get rid of references to menhirLib.  Menhir is an 
independent tool that runs.  menhirLib is a library that tries to link 
with your spatch.  Running menhir is fine.  Thus the following is fine:

-$(PARSER_SOURCES:.mly=.ml) $(PARSER_SOURCES:.mly=.mli) : 
$(PARSER_SOURCES)
-	$(MENHIR) --ocamlc "${OCAMLC}" --ocamldep "${OCAMLDEP}" --table 
--base parser_cocci_menhir $(PARSER_SOURCES)

except that it should not have the --table.

julia

> 
> Then I ./autogen
> and
> ./configure --enable-release
> 
> This ends with:
> 
> make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/bundles/parmap/parmap-1.0-rc5-patched'
> mv parmap-1.0-rc5-patched/_build/* .
> make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/bundles/parmap'
> make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> make[4]: Entering directory '/sda3/home/mcgrof/devel/coccinelle'
> make[5]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/commons'
> make[6]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/commons'
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c commands.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c common.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c interfaces.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c objet.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c seti.ml
> skipped building seti.cmo in optimizing mode: seti.cmx will be built instead.
> skipped building ocamlextra/setPt.cmo in optimizing mode: ocamlextra/setPt.cmx will be built instead.
> /usr/bin/ocamlc.opt -unsafe -I ocamlextra -I ocollection   -c oset.mli
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c oset.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c oassoc.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c osequence.ml
> /usr/bin/ocamlc.opt -unsafe -I ocamlextra -I ocollection   -c ograph.mli
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ograph.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/osetb.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassocb.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassoch.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassoc_buffer.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassoc_cache.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ocollection/oassocid.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c oarray.ml
> /usr/bin/ocamlc.opt -unsafe -I ocamlextra -I ocollection   -c ograph_simple.mli
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ograph_simple.ml
> /usr/bin/ocamlc.opt -unsafe -I ocamlextra -I ocollection   -c ograph_extended.mli
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c ograph_extended.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c glimpse.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection   -c parser_combinators.ml
> /usr/bin/ocamlopt.opt -unsafe -I ocamlextra -I ocollection  -a -o commons.cmxa ocamlextra/dumper.cmx ocamlextra/setb.cmx ocamlextra/mapb.cmx ocamlextra/setPt.cmx commands.cmx common.cmx interfaces.cmx objet.cmx ocollection.cmx seti.cmx oset.cmx oassoc.cmx osequence.cmx ograph.cmx ocollection/osetb.cmx ocollection/oassocb.cmx ocollection/oassoch.cmx ocollection/oassoc_buffer.cmx ocollection/oassoc_cache.cmx ocollection/oassocid.cmx oarray.cmx ograph_simple.cmx ograph_extended.cmx glimpse.cmx parser_combinators.cmx ocamlextra/enum.cmx ocamlextra/dynArray.cmx ocamlextra/suffix_tree.cmx ocamlextra/suffix_tree_ext.cmx
> make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/commons'
> make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/commons'
> make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> make[4]: Entering directory '/sda3/home/mcgrof/devel/coccinelle'
> make[5]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/globals'
> make[6]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/globals'
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -c config.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -c flag.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -c iteration.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -c regexp.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I /home/mcgrof/devel/coccinelle/bundles/pcre/ -a -o globals.cmxa config.cmx flag.cmx iteration.cmx regexp_pcre.cmx regexp.cmx
> make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/globals'
> make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/globals'
> make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> make[4]: Entering directory '/sda3/home/mcgrof/devel/coccinelle'
> make[5]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/ctl'
> make[6]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/ctl'
> skipped building ast_ctl.cmo in optimizing mode: ast_ctl.cmx will be built instead.
> /usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c pretty_print_ctl.mli
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c pretty_print_ctl.ml
> /usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c ctl_engine.mli
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c ctl_engine.ml
> /usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c wrapper_ctl.mli
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c wrapper_ctl.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -a -o ctl.cmxa flag_ctl.cmx ast_ctl.cmx pretty_print_ctl.cmx ctl_engine.cmx wrapper_ctl.cmx
> make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/ctl'
> make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/ctl'
> make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> make[4]: Entering directory '/sda3/home/mcgrof/devel/coccinelle'
> make[5]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
> make[6]: Entering directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
> skipped building visitor_ast0_types.cmo in optimizing mode: visitor_ast0_types.cmx will be built instead.
> /usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c visitor_ast0.mli
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c visitor_ast0.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c comm_assoc.ml
> /usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c iso_pattern.mli
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c iso_pattern.ml
> /usr/bin/ocamlc.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c iso_compile.mli
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c iso_compile.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c single_statement.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c simple_assignments.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c get_metas.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c ast0toast.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c check_meta.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c type_infer.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c test_exps.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c unitary_ast0.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c context_neg.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c adjust_pragmas.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c insert_plus.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c function_prototypes.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c parse_aux.ml
> /usr/bin/ocamlopt.opt -unsafe -I ../commons -I ../commons/ocamlextra -I ../globals -c lexer_cocci.ml
> File "lexer_cocci.mll", line 152, characters 61-66:
> Error: Unbound type constructor token
> Makefile:85: recipe for target 'lexer_cocci.cmx' failed
> make[6]: *** [lexer_cocci.cmx] Error 2
> make[6]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
> Makefile:56: recipe for target 'all.opt' failed
> make[5]: *** [all.opt] Error 2
> make[5]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle/parsing_cocci'
> Makefile:202: recipe for target 'parsing_cocci.opt' failed
> make[4]: *** [parsing_cocci.opt] Error 2
> make[4]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> Makefile:196: recipe for target 'subdirs.opt' failed
> make[3]: *** [subdirs.opt] Error 1
> make[3]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> Makefile:167: recipe for target 'opt-compil' failed
> make[2]: *** [opt-compil] Error 2
> make[2]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> Makefile:147: recipe for target 'all-release' failed
> make[1]: *** [all-release] Error 2
> make[1]: Leaving directory '/sda3/home/mcgrof/devel/coccinelle'
> Makefile:125: recipe for target 'all' failed
> make: *** [all] Error 2
>  
> 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-14  5:26             ` Julia Lawall
@ 2015-10-14  7:11               ` Sébastien Hinderer
  2015-10-14  7:59                 ` Julia Lawall
  2015-10-14 10:54                 ` [Cocci] Compiling latest Coccinelle with openSUSE SF Markus Elfring
  0 siblings, 2 replies; 31+ messages in thread
From: Sébastien Hinderer @ 2015-10-14  7:11 UTC (permalink / raw)
  To: cocci

Hi, Luis,

Normally, when Menhir is not installed, Coccinelle's buil system
should use the one provided in the bundles directory (same for MenhirLib).
At the moment this does not work quite wll and I am currently working on
fixing this issue.
Meanwhile, one other simple thing you could try is to install menhir
either through your distribution if it is packaged, or directly from
sources. Then start from a clean git repository and do the usual
procedure and I believe that shold work and would appreciate to know if it
does not.

hth,

S?bastien.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-14  7:11               ` Sébastien Hinderer
@ 2015-10-14  7:59                 ` Julia Lawall
  2015-10-14  8:53                   ` Sébastien Hinderer
  2015-10-14 10:54                 ` [Cocci] Compiling latest Coccinelle with openSUSE SF Markus Elfring
  1 sibling, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-14  7:59 UTC (permalink / raw)
  To: cocci

On Wed, 14 Oct 2015, S?bastien Hinderer wrote:

> Hi, Luis,
>
> Normally, when Menhir is not installed, Coccinelle's buil system
> should use the one provided in the bundles directory (same for MenhirLib).
> At the moment this does not work quite wll and I am currently working on
> fixing this issue.
> Meanwhile, one other simple thing you could try is to install menhir
> either through your distribution if it is packaged, or directly from
> sources.

He built it from sources.  The problem he has with menhirLib is an
incompatability between cmi files in his lib64/ocaml directory.  That
would seem to have nothing to do with Coccinelle.  But file says that the
cmi files come from the same version of ocaml, which is really mysterious.
One of the files is Obj.mli. I assume that this comes with ocaml?  I
didn't ask whether he had reinstalled ocaml somehow after compiling
menhir.

julia

> Then start from a clean git repository and do the usual
> procedure and I believe that shold work and would appreciate to know if it
> does not.
>
> hth,
>
> S?bastien.
> _______________________________________________
> Cocci mailing list
> Cocci at systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-14  7:59                 ` Julia Lawall
@ 2015-10-14  8:53                   ` Sébastien Hinderer
  2015-10-14 20:59                     ` Luis R. Rodriguez
  0 siblings, 1 reply; 31+ messages in thread
From: Sébastien Hinderer @ 2015-10-14  8:53 UTC (permalink / raw)
  To: cocci

Hi,

Luis: here is what I am guessing.

At some point in the past you have installed OCaml and then compiled
Menhir from sources with that version of OCaml. Meanwhile the OCaml
related packages got updated but Menhir has not been recompiled with
the updated version of OCaml, hence the inconsistency.

My suggestion would thus be to make sure you recompile Menhir with the
currently installed version of OCaml.

S?bastien.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling Coccinelle with specific OCaml versions on openSUSE
  2015-10-13 20:19 [Cocci] Compiling latest coccinelle with opensuse Luis R. Rodriguez
  2015-10-13 20:26 ` Julia Lawall
@ 2015-10-14 10:32 ` SF Markus Elfring
  2015-10-14 14:44   ` Sébastien Hinderer
  1 sibling, 1 reply; 31+ messages in thread
From: SF Markus Elfring @ 2015-10-14 10:32 UTC (permalink / raw)
  To: cocci

> Error: The files /usr/lib64/ocaml/obj.cmi
>        and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
>        make inconsistent assumptions over interface Obj
> Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed

I stumbled on the following message since I installed
the package "OCaml 4.02.3-1.1" also on my openSUSE system.


Error: Files type_cocci.cmx and menhirLib.cmx
       make inconsistent assumptions over implementation Printf
Makefile:89: die Regel f?r Ziel ?cocci_parser.cmxa? scheiterte


How do you think about to circumvent this software dependency hiccup
by the OPAM interface for a while?
https://opam.ocaml.org/packages/coccinelle/coccinelle.1.0.2/

Regards,
Markus

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest Coccinelle with openSUSE
  2015-10-14  7:11               ` Sébastien Hinderer
  2015-10-14  7:59                 ` Julia Lawall
@ 2015-10-14 10:54                 ` SF Markus Elfring
  1 sibling, 0 replies; 31+ messages in thread
From: SF Markus Elfring @ 2015-10-14 10:54 UTC (permalink / raw)
  To: cocci

> Normally, when Menhir is not installed, Coccinelle's buil system
> should use the one provided in the bundles directory (same for MenhirLib).
> At the moment this does not work quite wll and I am currently working on
> fixing this issue.

I am curious on how this software development will evolve.


> Meanwhile, one other simple thing you could try is to install menhir
> either through your distribution if it is packaged, or directly from sources.
> Then start from a clean git repository and do the usual procedure
> and I believe that shold work and would appreciate to know if it does not.

I guess that there are further dependencies to consider.
For which data processing tasks is this library needed in Coccinelle so far?
http://cristal.inria.fr/~fpottier/menhir/CHANGES

How do you think about to reuse the package "menhir-20151012.tar.gz"
(together with the software "OCaml 4.02.3")?

Regards,
Markus

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling Coccinelle with specific OCaml versions on openSUSE
  2015-10-14 10:32 ` [Cocci] Compiling Coccinelle with specific OCaml versions on openSUSE SF Markus Elfring
@ 2015-10-14 14:44   ` Sébastien Hinderer
  2015-10-14 14:49     ` Julia Lawall
  0 siblings, 1 reply; 31+ messages in thread
From: Sébastien Hinderer @ 2015-10-14 14:44 UTC (permalink / raw)
  To: cocci

SF Markus Elfring (2015/10/14 12:32 +0200):
> > Error: The files /usr/lib64/ocaml/obj.cmi
> >        and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
> >        make inconsistent assumptions over interface Obj
> > Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed
> 
> I stumbled on the following message since I installed
> the package "OCaml 4.02.3-1.1" also on my openSUSE system.
> 
> 
> Error: Files type_cocci.cmx and menhirLib.cmx
>        make inconsistent assumptions over implementation Printf
> Makefile:89: die Regel f?r Ziel ?cocci_parser.cmxa? scheiterte
> 
> 
> How do you think about to circumvent this software dependency hiccup
> by the OPAM interface for a while?
> https://opam.ocaml.org/packages/coccinelle/coccinelle.1.0.2/

Sure, in my opinion, opam is a great solution worth trying for
everybody.

S?bastien.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-13 22:05           ` Luis R. Rodriguez
  2015-10-14  5:26             ` Julia Lawall
@ 2015-10-14 14:47             ` Sébastien Hinderer
  1 sibling, 0 replies; 31+ messages in thread
From: Sébastien Hinderer @ 2015-10-14 14:47 UTC (permalink / raw)
  To: cocci

Luis,

As the output of your rpm command shows, it seems your system has a
mixture of packages installed, some from ocaml 4.02.1, others from ocaml
4.02.3. So, if completely uninstalling menhir, making sure all its iles
have been removed from your system and then recompiling it is notenough,
one other thing that may be worse trying is to also uninstall every
OCaml related packages and then re-installing them.

S?bastien.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling Coccinelle with specific OCaml versions on openSUSE
  2015-10-14 14:44   ` Sébastien Hinderer
@ 2015-10-14 14:49     ` Julia Lawall
  2015-10-14 14:57       ` Sébastien Hinderer
  0 siblings, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-14 14:49 UTC (permalink / raw)
  To: cocci

On Wed, 14 Oct 2015, S?bastien Hinderer wrote:

> SF Markus Elfring (2015/10/14 12:32 +0200):
> > > Error: The files /usr/lib64/ocaml/obj.cmi
> > >        and /usr/lib64/ocaml/menhirLib/menhirLib.cmi
> > >        make inconsistent assumptions over interface Obj
> > > Makefile:90: recipe for target 'parser_cocci_menhir.cmx' failed
> >
> > I stumbled on the following message since I installed
> > the package "OCaml 4.02.3-1.1" also on my openSUSE system.
> >
> >
> > Error: Files type_cocci.cmx and menhirLib.cmx
> >        make inconsistent assumptions over implementation Printf
> > Makefile:89: die Regel f?r Ziel ?cocci_parser.cmxa? scheiterte
> >
> >
> > How do you think about to circumvent this software dependency hiccup
> > by the OPAM interface for a while?
> > https://opam.ocaml.org/packages/coccinelle/coccinelle.1.0.2/
>
> Sure, in my opinion, opam is a great solution worth trying for
> everybody.

No problem with opam, but this problem will recur, so I would really
prefer to have it solved.

julia

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling Coccinelle with specific OCaml versions on openSUSE
  2015-10-14 14:49     ` Julia Lawall
@ 2015-10-14 14:57       ` Sébastien Hinderer
  2015-10-14 15:43         ` SF Markus Elfring
  0 siblings, 1 reply; 31+ messages in thread
From: Sébastien Hinderer @ 2015-10-14 14:57 UTC (permalink / raw)
  To: cocci

Julia Lawall (2015/10/14 16:49 +0200):
> No problem with opam, but this problem will recur, so I would really
> prefer to have it solved.

Sure! The two things are totally distinct and the reported problem
definitely needs to be solved.

So far, the issue is that I was absolutely not able to reproduce it, so
any help on this would be greatly appreciated. The help could be a
detailed procedure explaining how to reproduce the problem, an access to
a machine where the problem occurs or anything else you guys could think
about.

S?bastien.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest Coccinelle with openSUSE
  2015-10-13 20:37   ` Luis R. Rodriguez
  2015-10-13 20:44     ` Julia Lawall
  2015-10-13 20:58     ` Julia Lawall
@ 2015-10-14 15:22     ` SF Markus Elfring
  2 siblings, 0 replies; 31+ messages in thread
From: SF Markus Elfring @ 2015-10-14 15:22 UTC (permalink / raw)
  To: cocci

> mcgrof at ergon ~/devel/coccinelle (git::master)$ rpm -qa | grep ocaml
?
> ocaml-camlp4-devel-4.02.1-1.5.x86_64
?
> ocaml-camlp4-4.02.1-1.5.x86_64
?

How do you think about to trigger that these software packages will also
refer to the version "4.02.3"?
https://build.opensuse.org/package/show?project=openSUSE%3AFactory&package=ocaml-camlp4

Regards,
Markus

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling Coccinelle with specific OCaml versions on openSUSE
  2015-10-14 14:57       ` Sébastien Hinderer
@ 2015-10-14 15:43         ` SF Markus Elfring
  0 siblings, 0 replies; 31+ messages in thread
From: SF Markus Elfring @ 2015-10-14 15:43 UTC (permalink / raw)
  To: cocci

> So far, the issue is that I was absolutely not able to reproduce it,
> so any help on this would be greatly appreciated.

I have got the impression that such an issue depends on specific version ranges
for the software "OCaml" and "Menhir".
Do you know the versions with which this library will work for the affected
programming language?


> The help could be a detailed procedure explaining how to reproduce the problem,
> an access to a machine where the problem occurs or anything else you guys
> could think about.

How do you think about to reuse a continuous integration system eventually?


When will Coccinelle's OCaml scripting interface work also together with
the latest software releases?

Regards,
Markus

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-14  8:53                   ` Sébastien Hinderer
@ 2015-10-14 20:59                     ` Luis R. Rodriguez
  2015-10-14 21:04                       ` Julia Lawall
  2015-10-14 21:44                       ` [Cocci] Compiling latest coccinelle with opensuse Sébastien Hinderer
  0 siblings, 2 replies; 31+ messages in thread
From: Luis R. Rodriguez @ 2015-10-14 20:59 UTC (permalink / raw)
  To: cocci

On Wed, Oct 14, 2015 at 10:53:50AM +0200, S?bastien Hinderer wrote:
> Hi,
> 
> Luis: here is what I am guessing.
> 
> At some point in the past you have installed OCaml and then compiled
> Menhir from sources with that version of OCaml. Meanwhile the OCaml
> related packages got updated but Menhir has not been recompiled with
> the updated version of OCaml, hence the inconsistency.
> 
> My suggestion would thus be to make sure you recompile Menhir with the
> currently installed version of OCaml.

S?bastien,

your guess was correct. I also tested using a new base OpenSUSE factory
install for both github and inria git repos for coccinelle and found
that:

  * github: works as expected
  * inria git: required menhir but fails with a compilation failure [0]

Then with only the latest and greatest on inira git:

  * menhir: compiled
  * coccinelle: compiles

Once I forced recompilation of menhir things worked well. The
reason things seem to work on debian is menhir is packaged and
updated regularly, and I suppose it might be updated as ocaml
gets updated as otherwise Debian would run into similar issues,
and if not I suspect they will once ocaml on Debian does get
upgraded :)

I wonder how we'll avoid these dependency issues creeping up moving
forward. This is pretty fragile, and if the git tree will represent
later the latest and greatest what should we do about mehir
dependencies?

For your convenience I've taken the time to document getting you
an opensuse chroot you can play with on Debian [1] but sadly
Debian zypper package currently has an odd issue [2]. So alternatively
you can just use docker [3] to get an opensuse factory thing going.
Both these options are the equivalent of using debootstrap on OpenSUSE.

Long term I realize you had some plans for possibly jenkins, otherwise
another option is the opensuse build service, which lets you get things
built over different distributions. I'm afraid that such solutions
might not pick up these sorts of issues though, I don't think they
upgrade the system but rather have a fresh install for each shoot,
not sure... BTW if you go the docker way and want to reproduce my
issues for bullet proof bug you could end up first compiling menhir
with the default docker image ocaml, then 'zypper dup' to upgrade
ocaml version and finally compiling  coccinelle.

Thanks for your help!

[0] Perhaps this should be prettier and require menhir then.

/usr/bin/ocamldep -I ../commons -I ../commons/ocamlextra -I ../globals *.mli *.ml > .depend
make[3]: Leaving directory '/root/coccinelle/ctl'
make[3]: Entering directory '/root/coccinelle/parsing_cocci'
/root/coccinelle/setup/fake-menhir.sh menhir --ocamlc "/usr/bin/ocamlc.opt" --ocamldep "/usr/bin/ocamldep" --table --base parser_cocci_menhir parser_cocci_menhir.mly
error: the file parser_cocci_menhir.ml is needed, which requires preprocessing by menhir to obtain it from parser_cocci_menhir.mly. However, menhir is not enabled.
make[3]: *** No rule to make target 'parser_cocci_menhir.ml', needed by 'depend'.  Stop.

[1] If zypper on Debian actually worked...

rm -rf /opt/opensuse/

mkdir -p /opt/opensuse/dev/
mknod /opt/opensuse/dev/zero c 1 5 

zypper --root /data/opensuse/ ar http://download.opensuse.org/factory/repo/oss repo-oss
zypper --gpg-auto-import-keys -n --root /data/opensuse install rpm zypper wget vim

[2] zypper sucks on Debian right now

root at garbanzo:~# zypper
zypper: relocation error: zypper: symbol _ZN4zypp5CpeId11NoThrowType13lastMalformedE, version ZYPP_plain not defined in file libzypp.so.1503 with link time reference

[3] Use docker to get the latest and greatest OpenSUSE factory

apt-get install docker
docker pull opensuse

# on one terminal
docker daemon

# to copy files or folders (say coccinelle git or menhir tarball)
# you'll want to run from your host machine, after using
# docker ps to get the image ID
docker cp ~/some-path/coccinelle/ docker-image-id:/root/

# then get a terminal going
docker run -t -i opensuse /bin/bash

# upgrade the machine (avoid this if you want to try to repdroduce
# the theoretical issue iwth menhir and ocaml, and instead first
# compile and install menhir
zypper --gpg-auto-import-keys -n dup

# ca-certificates-mozilla will be needed for git clone over https on
# github
zypper --gpg-auto-import-keys -n install git ca-certificates-mozilla

# silly thing, opensuse doens't have this enable by default so one cannot
# use zypper si -d (source-intall) to get build dependencies by default...
# sucks!
zypper ar -f http://download.opensuse.org/factory/repo/src-oss repo-src-oss
zypper --gpg-auto-import-keys -n si -d coccinelle

# missing dependencies - I'll go report these. I've cc'd the maintainer
# but I'll also just take the liberty to submit the changes into osc [4].
# I'll note the build gets odd issues if you do not have tar. So a possible
# enhancement to autotools on coccinelle might be to require tar.
zypper --gpg-auto-import-keys -n install autoconf automake make tar

# To build the other goodies:

# get PCRE
zypper --gpg-auto-import-keys -n install pcre-tools pcre-devel

# Documentation
zypper --gpg-auto-import-keys -n install texlive-latex-bin-bin

Note I cannot still build the documentation, so I have given up
even with the above installed.

[4] Contributing to opensuse for the coccinelle package:

First get osc installed

But really first get an account on open build service:

https://build.opensuse.org/

You'll use that for osc.

git clone https://github.com/openSUSE/osc.git
cd osc

# you'll need these little buggers
sudo apt-get install python-urlgrabber python-gnomekeyring
python setup.py build
sudo python setup.py install
sudo ln -sf /home/mcgrof/devel/osc/osc-wrapper.py /usr/bin/osc

Then to get coccinelle package a la apt-get source coccinelle,
but with mechanisms so you can contribute directly as if you
are using svn:

mkdir -p ~/devel/
cd ~/devel/
osc co openSUSE:Factory/coccinelle
cd openSUSE\:Factory/coccinelle/
vi coccinelle.spec

osc diff

But to contribute you need your own branch, etc, see the documentation
for more details:

https://en.opensuse.org/openSUSE:How_to_contribute_to_Factory
 
  Luis

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-14 20:59                     ` Luis R. Rodriguez
@ 2015-10-14 21:04                       ` Julia Lawall
  2015-10-14 21:23                         ` [Cocci] Common.union_setError (was: Compiling latest coccinelle with opensuse) Luis R. Rodriguez
  2015-10-14 21:44                       ` [Cocci] Compiling latest coccinelle with opensuse Sébastien Hinderer
  1 sibling, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-14 21:04 UTC (permalink / raw)
  To: cocci



On Wed, 14 Oct 2015, Luis R. Rodriguez wrote:

> On Wed, Oct 14, 2015 at 10:53:50AM +0200, S?bastien Hinderer wrote:
> > Hi,
> > 
> > Luis: here is what I am guessing.
> > 
> > At some point in the past you have installed OCaml and then compiled
> > Menhir from sources with that version of OCaml. Meanwhile the OCaml
> > related packages got updated but Menhir has not been recompiled with
> > the updated version of OCaml, hence the inconsistency.
> > 
> > My suggestion would thus be to make sure you recompile Menhir with the
> > currently installed version of OCaml.
> 
> S?bastien,
> 
> your guess was correct. I also tested using a new base OpenSUSE factory
> install for both github and inria git repos for coccinelle and found
> that:
> 
>   * github: works as expected
>   * inria git: required menhir but fails with a compilation failure [0]
> 
> Then with only the latest and greatest on inira git:
> 
>   * menhir: compiled
>   * coccinelle: compiles
> 
> Once I forced recompilation of menhir things worked well. The
> reason things seem to work on debian is menhir is packaged and
> updated regularly, and I suppose it might be updated as ocaml
> gets updated as otherwise Debian would run into similar issues,
> and if not I suspect they will once ocaml on Debian does get
> upgraded :)
> 
> I wonder how we'll avoid these dependency issues creeping up moving
> forward. This is pretty fragile, and if the git tree will represent
> later the latest and greatest what should we do about mehir
> dependencies?

I guess that it is normal that if you install something with your package 
manager, and another thing without your package manager, then they will 
get out of synch in strange ways.  It doesn't really seem like 
Coccinelle's problem, specifically.

Now that it has compiled, do you still have the problem with the 
Common.union_set reference?  Sebastien seemed to think that the ability to 
do dynamic linking in ocaml depends on more things than I would have 
expected.  But I odn't know the details.

julia


> For your convenience I've taken the time to document getting you
> an opensuse chroot you can play with on Debian [1] but sadly
> Debian zypper package currently has an odd issue [2]. So alternatively
> you can just use docker [3] to get an opensuse factory thing going.
> Both these options are the equivalent of using debootstrap on OpenSUSE.
> 
> Long term I realize you had some plans for possibly jenkins, otherwise
> another option is the opensuse build service, which lets you get things
> built over different distributions. I'm afraid that such solutions
> might not pick up these sorts of issues though, I don't think they
> upgrade the system but rather have a fresh install for each shoot,
> not sure... BTW if you go the docker way and want to reproduce my
> issues for bullet proof bug you could end up first compiling menhir
> with the default docker image ocaml, then 'zypper dup' to upgrade
> ocaml version and finally compiling  coccinelle.
> 
> Thanks for your help!
> 
> [0] Perhaps this should be prettier and require menhir then.
> 
> /usr/bin/ocamldep -I ../commons -I ../commons/ocamlextra -I ../globals *.mli *.ml > .depend
> make[3]: Leaving directory '/root/coccinelle/ctl'
> make[3]: Entering directory '/root/coccinelle/parsing_cocci'
> /root/coccinelle/setup/fake-menhir.sh menhir --ocamlc "/usr/bin/ocamlc.opt" --ocamldep "/usr/bin/ocamldep" --table --base parser_cocci_menhir parser_cocci_menhir.mly
> error: the file parser_cocci_menhir.ml is needed, which requires preprocessing by menhir to obtain it from parser_cocci_menhir.mly. However, menhir is not enabled.
> make[3]: *** No rule to make target 'parser_cocci_menhir.ml', needed by 'depend'.  Stop.
> 
> [1] If zypper on Debian actually worked...
> 
> rm -rf /opt/opensuse/
> 
> mkdir -p /opt/opensuse/dev/
> mknod /opt/opensuse/dev/zero c 1 5 
> 
> zypper --root /data/opensuse/ ar http://download.opensuse.org/factory/repo/oss repo-oss
> zypper --gpg-auto-import-keys -n --root /data/opensuse install rpm zypper wget vim
> 
> [2] zypper sucks on Debian right now
> 
> root at garbanzo:~# zypper
> zypper: relocation error: zypper: symbol _ZN4zypp5CpeId11NoThrowType13lastMalformedE, version ZYPP_plain not defined in file libzypp.so.1503 with link time reference
> 
> [3] Use docker to get the latest and greatest OpenSUSE factory
> 
> apt-get install docker
> docker pull opensuse
> 
> # on one terminal
> docker daemon
> 
> # to copy files or folders (say coccinelle git or menhir tarball)
> # you'll want to run from your host machine, after using
> # docker ps to get the image ID
> docker cp ~/some-path/coccinelle/ docker-image-id:/root/
> 
> # then get a terminal going
> docker run -t -i opensuse /bin/bash
> 
> # upgrade the machine (avoid this if you want to try to repdroduce
> # the theoretical issue iwth menhir and ocaml, and instead first
> # compile and install menhir
> zypper --gpg-auto-import-keys -n dup
> 
> # ca-certificates-mozilla will be needed for git clone over https on
> # github
> zypper --gpg-auto-import-keys -n install git ca-certificates-mozilla
> 
> # silly thing, opensuse doens't have this enable by default so one cannot
> # use zypper si -d (source-intall) to get build dependencies by default...
> # sucks!
> zypper ar -f http://download.opensuse.org/factory/repo/src-oss repo-src-oss
> zypper --gpg-auto-import-keys -n si -d coccinelle
> 
> # missing dependencies - I'll go report these. I've cc'd the maintainer
> # but I'll also just take the liberty to submit the changes into osc [4].
> # I'll note the build gets odd issues if you do not have tar. So a possible
> # enhancement to autotools on coccinelle might be to require tar.
> zypper --gpg-auto-import-keys -n install autoconf automake make tar
> 
> # To build the other goodies:
> 
> # get PCRE
> zypper --gpg-auto-import-keys -n install pcre-tools pcre-devel
> 
> # Documentation
> zypper --gpg-auto-import-keys -n install texlive-latex-bin-bin
> 
> Note I cannot still build the documentation, so I have given up
> even with the above installed.
> 
> [4] Contributing to opensuse for the coccinelle package:
> 
> First get osc installed
> 
> But really first get an account on open build service:
> 
> https://build.opensuse.org/
> 
> You'll use that for osc.
> 
> git clone https://github.com/openSUSE/osc.git
> cd osc
> 
> # you'll need these little buggers
> sudo apt-get install python-urlgrabber python-gnomekeyring
> python setup.py build
> sudo python setup.py install
> sudo ln -sf /home/mcgrof/devel/osc/osc-wrapper.py /usr/bin/osc
> 
> Then to get coccinelle package a la apt-get source coccinelle,
> but with mechanisms so you can contribute directly as if you
> are using svn:
> 
> mkdir -p ~/devel/
> cd ~/devel/
> osc co openSUSE:Factory/coccinelle
> cd openSUSE\:Factory/coccinelle/
> vi coccinelle.spec
> 
> osc diff
> 
> But to contribute you need your own branch, etc, see the documentation
> for more details:
> 
> https://en.opensuse.org/openSUSE:How_to_contribute_to_Factory
>  
>   Luis
> _______________________________________________
> Cocci mailing list
> Cocci at systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
> 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Common.union_setError (was: Compiling latest coccinelle with opensuse)
  2015-10-14 21:04                       ` Julia Lawall
@ 2015-10-14 21:23                         ` Luis R. Rodriguez
  2015-10-14 21:32                           ` Julia Lawall
  0 siblings, 1 reply; 31+ messages in thread
From: Luis R. Rodriguez @ 2015-10-14 21:23 UTC (permalink / raw)
  To: cocci

On Wed, Oct 14, 2015 at 11:04:47PM +0200, Julia Lawall wrote:
> On Wed, 14 Oct 2015, Luis R. Rodriguez wrote:
> > On Wed, Oct 14, 2015 at 10:53:50AM +0200, S?bastien Hinderer wrote:
> > > Hi,
> > > 
> > > Luis: here is what I am guessing.
> > > 
> > > At some point in the past you have installed OCaml and then compiled
> > > Menhir from sources with that version of OCaml. Meanwhile the OCaml
> > > related packages got updated but Menhir has not been recompiled with
> > > the updated version of OCaml, hence the inconsistency.
> > > 
> > > My suggestion would thus be to make sure you recompile Menhir with the
> > > currently installed version of OCaml.
> > 
> > S?bastien,
> > 
> > your guess was correct. I also tested using a new base OpenSUSE factory
> > install for both github and inria git repos for coccinelle and found
> > that:
> > 
> >   * github: works as expected
> >   * inria git: required menhir but fails with a compilation failure [0]
> > 
> > Then with only the latest and greatest on inira git:
> > 
> >   * menhir: compiled
> >   * coccinelle: compiles
> > 
> > Once I forced recompilation of menhir things worked well. The
> > reason things seem to work on debian is menhir is packaged and
> > updated regularly, and I suppose it might be updated as ocaml
> > gets updated as otherwise Debian would run into similar issues,
> > and if not I suspect they will once ocaml on Debian does get
> > upgraded :)
> > 
> > I wonder how we'll avoid these dependency issues creeping up moving
> > forward. This is pretty fragile, and if the git tree will represent
> > later the latest and greatest what should we do about mehir
> > dependencies?
> 
> I guess that it is normal that if you install something with your package 
> manager, and another thing without your package manager, then they will 
> get out of synch in strange ways.  It doesn't really seem like 
> Coccinelle's problem, specifically.

The problem here stems from users of the internal inria git tree prior
to a release, nothing more. For those users like myself the issue is
real, and I am now aware of it, and so should others. Since we know we
want to later strive towards one tree for development we should consider
this a bit more seriously though. Perhaps once compromise might be to
carry the pre-built files (as in github now) and *only* if a specific
non-default 'make menhir-update' type of target is used would we force
a re-generation of the files? Distributions should not need to run
this, ony admins of the git tree.

> Now that it has compiled, do you still have the problem with the 
> Common.union_set reference?

Oh yes. And the instructions I gave can be used to reproduce that
build I think as well now. To reproduce one can build coccinelle
on opensuse (I guess inria git version), and then apply this draft
patch onto linux-next (git am the file).

http://drvbp1.linux-foundation.org/~mcgrof/coccinelle/common-union-issue/fw-warn-init-probe-draft-v2.patch

Then try it as follows:

# Note: cancel after 20 seconds otherwise, this patch is still
# being worked on, the current iteration use will run for a long
# time, don't waste your machine cycles / overheat your box.
export COCCI=scripts/coccinelle/api/request_firmware.cocci
make coccicheck MODE=report

I get:

Please check for false positives in the output before submitting a patch.
When using "patch" mode, carefully review the patch before submitting it.

File "/tmp/ocaml_cocci_27c72e.ml", line 21, characters 23-39:
File "/tmp/ocaml_cocci_eb7247.ml", line 21, characters 23-39:
File "/tmp/ocaml_cocci_82ec3c.ml", line 21, characters 23-39:
File "/tmp/ocaml_cocci_7c147c.ml", line 21, characters 23-39:
Error: Unbound value Common.union_setError: Unbound value Common.union_setError: Unbound value Common.union_set


Error: Unbound value Common.union_set
Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_27c72e.ml")
Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_eb7247.ml")
Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_7c147c.ml")
Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_82ec3c.ml")

> Sebastien seemed to think that the ability to 
> do dynamic linking in ocaml depends on more things than I would have 
> expected.  But I odn't know the details.

Interesting, let me know if you have any leads on a possible fix. In the
meantime I'll be debugging the above iteration SmPL patch on Debian.

  Luis

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Common.union_setError (was: Compiling latest coccinelle with opensuse)
  2015-10-14 21:23                         ` [Cocci] Common.union_setError (was: Compiling latest coccinelle with opensuse) Luis R. Rodriguez
@ 2015-10-14 21:32                           ` Julia Lawall
  2015-10-14 21:39                             ` Luis R. Rodriguez
  0 siblings, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-14 21:32 UTC (permalink / raw)
  To: cocci



On Wed, 14 Oct 2015, Luis R. Rodriguez wrote:

> On Wed, Oct 14, 2015 at 11:04:47PM +0200, Julia Lawall wrote:
> > On Wed, 14 Oct 2015, Luis R. Rodriguez wrote:
> > > On Wed, Oct 14, 2015 at 10:53:50AM +0200, S?bastien Hinderer wrote:
> > > > Hi,
> > > > 
> > > > Luis: here is what I am guessing.
> > > > 
> > > > At some point in the past you have installed OCaml and then compiled
> > > > Menhir from sources with that version of OCaml. Meanwhile the OCaml
> > > > related packages got updated but Menhir has not been recompiled with
> > > > the updated version of OCaml, hence the inconsistency.
> > > > 
> > > > My suggestion would thus be to make sure you recompile Menhir with the
> > > > currently installed version of OCaml.
> > > 
> > > S?bastien,
> > > 
> > > your guess was correct. I also tested using a new base OpenSUSE factory
> > > install for both github and inria git repos for coccinelle and found
> > > that:
> > > 
> > >   * github: works as expected
> > >   * inria git: required menhir but fails with a compilation failure [0]
> > > 
> > > Then with only the latest and greatest on inira git:
> > > 
> > >   * menhir: compiled
> > >   * coccinelle: compiles
> > > 
> > > Once I forced recompilation of menhir things worked well. The
> > > reason things seem to work on debian is menhir is packaged and
> > > updated regularly, and I suppose it might be updated as ocaml
> > > gets updated as otherwise Debian would run into similar issues,
> > > and if not I suspect they will once ocaml on Debian does get
> > > upgraded :)
> > > 
> > > I wonder how we'll avoid these dependency issues creeping up moving
> > > forward. This is pretty fragile, and if the git tree will represent
> > > later the latest and greatest what should we do about mehir
> > > dependencies?
> > 
> > I guess that it is normal that if you install something with your package 
> > manager, and another thing without your package manager, then they will 
> > get out of synch in strange ways.  It doesn't really seem like 
> > Coccinelle's problem, specifically.
> 
> The problem here stems from users of the internal inria git tree prior
> to a release, nothing more.

I don't think so.  The only different between the Inria version and the 
github version is whether parser_cocci_menhir.ml has to be created or is 
provided.  But you created it with no problem (to my understanding).  The 
problem came when you tried to compile it.  Then it refers to menhirLib.

> For those users like myself the issue is
> real, and I am now aware of it, and so should others. Since we know we
> want to later strive towards one tree for development we should consider
> this a bit more seriously though. Perhaps once compromise might be to
> carry the pre-built files (as in github now) and *only* if a specific
> non-default 'make menhir-update' type of target is used would we force
> a re-generation of the files? Distributions should not need to run
> this, ony admins of the git tree.
> 
> > Now that it has compiled, do you still have the problem with the 
> > Common.union_set reference?
> 
> Oh yes. And the instructions I gave can be used to reproduce that
> build I think as well now. To reproduce one can build coccinelle
> on opensuse (I guess inria git version), and then apply this draft
> patch onto linux-next (git am the file).

Just for another data point, could you try demos/iteration.cocci?  Or for 
an even simpler test, demos/ocaml2.cocci.  No need to check the results.  
I just want to know if they crash.

julia

> http://drvbp1.linux-foundation.org/~mcgrof/coccinelle/common-union-issue/fw-warn-init-probe-draft-v2.patch
> 
> Then try it as follows:
> 
> # Note: cancel after 20 seconds otherwise, this patch is still
> # being worked on, the current iteration use will run for a long
> # time, don't waste your machine cycles / overheat your box.
> export COCCI=scripts/coccinelle/api/request_firmware.cocci
> make coccicheck MODE=report
> 
> I get:
> 
> Please check for false positives in the output before submitting a patch.
> When using "patch" mode, carefully review the patch before submitting it.
> 
> File "/tmp/ocaml_cocci_27c72e.ml", line 21, characters 23-39:
> File "/tmp/ocaml_cocci_eb7247.ml", line 21, characters 23-39:
> File "/tmp/ocaml_cocci_82ec3c.ml", line 21, characters 23-39:
> File "/tmp/ocaml_cocci_7c147c.ml", line 21, characters 23-39:
> Error: Unbound value Common.union_setError: Unbound value Common.union_setError: Unbound value Common.union_set
> 
> 
> Error: Unbound value Common.union_set
> Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_27c72e.ml")
> Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_eb7247.ml")
> Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_7c147c.ml")
> Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_82ec3c.ml")
> 
> > Sebastien seemed to think that the ability to 
> > do dynamic linking in ocaml depends on more things than I would have 
> > expected.  But I odn't know the details.
> 
> Interesting, let me know if you have any leads on a possible fix. In the
> meantime I'll be debugging the above iteration SmPL patch on Debian.
> 
>   Luis
> 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Common.union_setError (was: Compiling latest coccinelle with opensuse)
  2015-10-14 21:32                           ` Julia Lawall
@ 2015-10-14 21:39                             ` Luis R. Rodriguez
  2015-10-14 21:47                               ` Julia Lawall
  0 siblings, 1 reply; 31+ messages in thread
From: Luis R. Rodriguez @ 2015-10-14 21:39 UTC (permalink / raw)
  To: cocci

On Wed, Oct 14, 2015 at 11:32:59PM +0200, Julia Lawall wrote:
> On Wed, 14 Oct 2015, Luis R. Rodriguez wrote:
> > The problem here stems from users of the internal inria git tree prior
> > to a release, nothing more.
> 
> I don't think so.  The only different between the Inria version and the 
> github version is whether parser_cocci_menhir.ml has to be created or is 
> provided.  But you created it with no problem (to my understanding).  The 
> problem came when you tried to compile it.  Then it refers to menhirLib.

But as I reported in my previous long detailed reply menhir is required
to be built if using the inria git, otherwise the build barfs with the error
I mentioned. So perhaps it was not desirable for that to be a requirement
but it seems it is -- at least for the non-github version?

> > For those users like myself the issue is
> > real, and I am now aware of it, and so should others. Since we know we
> > want to later strive towards one tree for development we should consider
> > this a bit more seriously though. Perhaps once compromise might be to
> > carry the pre-built files (as in github now) and *only* if a specific
> > non-default 'make menhir-update' type of target is used would we force
> > a re-generation of the files? Distributions should not need to run
> > this, ony admins of the git tree.
> > 
> > > Now that it has compiled, do you still have the problem with the 
> > > Common.union_set reference?
> > 
> > Oh yes. And the instructions I gave can be used to reproduce that
> > build I think as well now. To reproduce one can build coccinelle
> > on opensuse (I guess inria git version), and then apply this draft
> > patch onto linux-next (git am the file).
> 
> Just for another data point, could you try demos/iteration.cocci?  Or for 
> an even simpler test, demos/ocaml2.cocci.  No need to check the results.  
> I just want to know if they crash.

Also fails:

mcgrof at ergon ~/linux-next (git::20150805-pend-all)$ spatch -no_show_diff --sp-file iteration.cocci --dir ./
init_defs_builtins: /home/mcgrof/devel/coccinelle/standard.h
Using native version of ocamlc/ocamlopt/ocamldep
ocamlopt.opt -shared -o /tmp/ocaml_cocci_97ece2.cmxs -g -I /usr/lib64/ocaml  -I /home/mcgrof/devel/coccinelle//ocaml /tmp/ocaml_cocci_97ece2.ml
File "/tmp/ocaml_cocci_97ece2.ml", line 20, characters 23-39:
Error: Unbound value Common.union_set
Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_97ece2.ml")

  Luis

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-14 20:59                     ` Luis R. Rodriguez
  2015-10-14 21:04                       ` Julia Lawall
@ 2015-10-14 21:44                       ` Sébastien Hinderer
  2015-10-14 21:48                         ` Julia Lawall
  1 sibling, 1 reply; 31+ messages in thread
From: Sébastien Hinderer @ 2015-10-14 21:44 UTC (permalink / raw)
  To: cocci

Dear Luis,

Great you could finally compile coccinelle.
And many thanks for having explained all the procedure to get docker
working, it's really great and will be very helpful.

I won't be able to look into the two problems (menhir and
Common.Union_set) before next week but will do it as soonas possible.

Regarding your suggestion to distribute the files generated by Menhir: I
don't think this will solve the problem; Indeed, the problem does not
occur when generating these files but when compiling them.

Actually, there are two things that are used from Menhir. First, Menhir
is used as a commandline tool. It takes a .mly file as inputandproduces
corresponding .ml and .mli files. Thisis roughtly speaking equivalentto
what yacc or bison do: taking a .y file as input and producing a .c as
output. Second, the .ml file that has been generated by Menhir uses a
library whichis called MenhirLib and to which the .cmo or .cmx files
obtained by compilin the .ml file will have to be linked. That is where
the problem you described appears andthat's why I don't think including
the generated .ml files woudlhelpin any way.

I hope I managed to be clear. :)

S?bastien.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Common.union_setError (was: Compiling latest coccinelle with opensuse)
  2015-10-14 21:39                             ` Luis R. Rodriguez
@ 2015-10-14 21:47                               ` Julia Lawall
  2015-10-14 21:53                                 ` Sébastien Hinderer
  0 siblings, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-14 21:47 UTC (permalink / raw)
  To: cocci



On Wed, 14 Oct 2015, Luis R. Rodriguez wrote:

> On Wed, Oct 14, 2015 at 11:32:59PM +0200, Julia Lawall wrote:
> > On Wed, 14 Oct 2015, Luis R. Rodriguez wrote:
> > > The problem here stems from users of the internal inria git tree prior
> > > to a release, nothing more.
> > 
> > I don't think so.  The only different between the Inria version and the 
> > github version is whether parser_cocci_menhir.ml has to be created or is 
> > provided.  But you created it with no problem (to my understanding).  The 
> > problem came when you tried to compile it.  Then it refers to menhirLib.
> 
> But as I reported in my previous long detailed reply menhir is required
> to be built if using the inria git, otherwise the build barfs with the error
> I mentioned. So perhaps it was not desirable for that to be a requirement
> but it seems it is -- at least for the non-github version?

OK, menhirLib is always needed with Coccinelle.  Maybe Coccinelle manages 
to use its own version, if you don't have one installed.  I had thought 
that Sebastien said that the menhir bundle was not being activated, but 
perhaps I misunderstood.

> > > For those users like myself the issue is
> > > real, and I am now aware of it, and so should others. Since we know we
> > > want to later strive towards one tree for development we should consider
> > > this a bit more seriously though. Perhaps once compromise might be to
> > > carry the pre-built files (as in github now) and *only* if a specific
> > > non-default 'make menhir-update' type of target is used would we force
> > > a re-generation of the files? Distributions should not need to run
> > > this, ony admins of the git tree.
> > > 
> > > > Now that it has compiled, do you still have the problem with the 
> > > > Common.union_set reference?
> > > 
> > > Oh yes. And the instructions I gave can be used to reproduce that
> > > build I think as well now. To reproduce one can build coccinelle
> > > on opensuse (I guess inria git version), and then apply this draft
> > > patch onto linux-next (git am the file).
> > 
> > Just for another data point, could you try demos/iteration.cocci?  Or for 
> > an even simpler test, demos/ocaml2.cocci.  No need to check the results.  
> > I just want to know if they crash.
> 
> Also fails:
> 
> mcgrof at ergon ~/linux-next (git::20150805-pend-all)$ spatch -no_show_diff --sp-file iteration.cocci --dir ./
> init_defs_builtins: /home/mcgrof/devel/coccinelle/standard.h
> Using native version of ocamlc/ocamlopt/ocamldep
> ocamlopt.opt -shared -o /tmp/ocaml_cocci_97ece2.cmxs -g -I /usr/lib64/ocaml  -I /home/mcgrof/devel/coccinelle//ocaml /tmp/ocaml_cocci_97ece2.ml
> File "/tmp/ocaml_cocci_97ece2.ml", line 20, characters 23-39:
> Error: Unbound value Common.union_set
> Fatal error: exception Yes_prepare_ocamlcocci.CompileFailure("/tmp/ocaml_cocci_97ece2.ml")

OK, thanks.

julia

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-14 21:44                       ` [Cocci] Compiling latest coccinelle with opensuse Sébastien Hinderer
@ 2015-10-14 21:48                         ` Julia Lawall
  2015-10-14 21:58                           ` Sébastien Hinderer
  0 siblings, 1 reply; 31+ messages in thread
From: Julia Lawall @ 2015-10-14 21:48 UTC (permalink / raw)
  To: cocci



On Wed, 14 Oct 2015, S?bastien Hinderer wrote:

> Dear Luis,
> 
> Great you could finally compile coccinelle.
> And many thanks for having explained all the procedure to get docker
> working, it's really great and will be very helpful.
> 
> I won't be able to look into the two problems (menhir and
> Common.Union_set) before next week but will do it as soonas possible.
> 
> Regarding your suggestion to distribute the files generated by Menhir: I
> don't think this will solve the problem; Indeed, the problem does not
> occur when generating these files but when compiling them.
> 
> Actually, there are two things that are used from Menhir. First, Menhir
> is used as a commandline tool. It takes a .mly file as inputandproduces
> corresponding .ml and .mli files. Thisis roughtly speaking equivalentto
> what yacc or bison do: taking a .y file as input and producing a .c as
> output. Second, the .ml file that has been generated by Menhir uses a
> library whichis called MenhirLib and to which the .cmo or .cmx files
> obtained by compilin the .ml file will have to be linked. That is where
> the problem you described appears andthat's why I don't think including
> the generated .ml files woudlhelpin any way.
> 
> I hope I managed to be clear. :)

I have the impression that he managed to have menhirLib without installing 
menhir when he used the github version.  Is that possible?  Is there a 
bundle for menhirLib?

julia

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Common.union_setError (was: Compiling latest coccinelle with opensuse)
  2015-10-14 21:47                               ` Julia Lawall
@ 2015-10-14 21:53                                 ` Sébastien Hinderer
  0 siblings, 0 replies; 31+ messages in thread
From: Sébastien Hinderer @ 2015-10-14 21:53 UTC (permalink / raw)
  To: cocci

Julia Lawall (2015/10/14 23:47 +0200):
> OK, menhirLib is always needed with Coccinelle.  Maybe Coccinelle manages 
> to use its own version, if you don't have one installed.  I had thought 
> that Sebastien said that the menhir bundle was not being activated, but 
> perhaps I misunderstood.

I'm myself confused, sorry about that Julia. There definitely is an
issue in Coccinelle's uild system regading this. What I noiced (using
INria's tree) is that Coccinelle is not able to use its bundled menhir.
So if no Menhir is installed, things go wrong. I don't remember exactly
what goes wrong but there's deinitely something that needs to be fixed
here.

S?bastien.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Cocci] Compiling latest coccinelle with opensuse
  2015-10-14 21:48                         ` Julia Lawall
@ 2015-10-14 21:58                           ` Sébastien Hinderer
  0 siblings, 0 replies; 31+ messages in thread
From: Sébastien Hinderer @ 2015-10-14 21:58 UTC (permalink / raw)
  To: cocci

Julia Lawall (2015/10/14 23:48 +0200):
> I have the impression that he managed to have menhirLib without installing 
> menhir when he used the github version.  Is that possible?

Perhaps...

> Is there a bundle for menhirLib?

As far as I understand, the menhir bundle provides both the tool and
MenhirLib.

S?bastien.

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2015-10-14 21:58 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13 20:19 [Cocci] Compiling latest coccinelle with opensuse Luis R. Rodriguez
2015-10-13 20:26 ` Julia Lawall
2015-10-13 20:37   ` Luis R. Rodriguez
2015-10-13 20:44     ` Julia Lawall
2015-10-13 20:49       ` Luis R. Rodriguez
2015-10-13 20:58     ` Julia Lawall
2015-10-13 21:14       ` Luis R. Rodriguez
2015-10-13 21:18         ` Julia Lawall
2015-10-13 22:05           ` Luis R. Rodriguez
2015-10-14  5:26             ` Julia Lawall
2015-10-14  7:11               ` Sébastien Hinderer
2015-10-14  7:59                 ` Julia Lawall
2015-10-14  8:53                   ` Sébastien Hinderer
2015-10-14 20:59                     ` Luis R. Rodriguez
2015-10-14 21:04                       ` Julia Lawall
2015-10-14 21:23                         ` [Cocci] Common.union_setError (was: Compiling latest coccinelle with opensuse) Luis R. Rodriguez
2015-10-14 21:32                           ` Julia Lawall
2015-10-14 21:39                             ` Luis R. Rodriguez
2015-10-14 21:47                               ` Julia Lawall
2015-10-14 21:53                                 ` Sébastien Hinderer
2015-10-14 21:44                       ` [Cocci] Compiling latest coccinelle with opensuse Sébastien Hinderer
2015-10-14 21:48                         ` Julia Lawall
2015-10-14 21:58                           ` Sébastien Hinderer
2015-10-14 10:54                 ` [Cocci] Compiling latest Coccinelle with openSUSE SF Markus Elfring
2015-10-14 14:47             ` [Cocci] Compiling latest coccinelle with opensuse Sébastien Hinderer
2015-10-14 15:22     ` [Cocci] Compiling latest Coccinelle with openSUSE SF Markus Elfring
2015-10-14 10:32 ` [Cocci] Compiling Coccinelle with specific OCaml versions on openSUSE SF Markus Elfring
2015-10-14 14:44   ` Sébastien Hinderer
2015-10-14 14:49     ` Julia Lawall
2015-10-14 14:57       ` Sébastien Hinderer
2015-10-14 15:43         ` SF Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.