cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] [bug-cocci] fix bytecode build of pyml
@ 2018-06-19  6:11 Christopher Zimmermann
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Zimmermann @ 2018-06-19  6:11 UTC (permalink / raw)
  To: cocci

Hi,

please consider inclusion of the following patches.

Christopher Zimmermann


Signed-off-by: Christopher Zimmermann <chrisz@openbsd.org>
Index: bundles/pyml/Makefile
--- bundles/pyml/Makefile.orig
+++ bundles/pyml/Makefile
@@ -52,8 +52,8 @@ $(SRC_DIR)/pyml_compat.cmx: $(SRC_DIR)/pyml_compat.ml 
 $(SRC_DIR)/pyml_compat.cmo: $(SRC_DIR)/pyml_compat.ml
$(SRC_DIR)/pyml_compat.cmi $(OCAMLC_CMD) -c $< -o $@
 
-$(SRC_DIR)/generate: $(SRC_DIR)/pyml_compat.cmx $(SRC_DIR)/generate.cmx
-	$(OCAMLOPT) $^ -o $@
+$(SRC_DIR)/generate: $(SRC_DIR)/pyml_compat.cmo $(SRC_DIR)/generate.cmo
+	$(OCAMLC_CMD) $^ -o $@
 
 $(SRC_DIR)/generate.cmx: $(SRC_DIR)/generate.ml
$(SRC_DIR)/pyml_compat.cmx $(OCAMLOPT_CMD) -c $< -o $@




This does not set a default options as suggested in configure.ac,
but overrides the user-provided setting.

Signed-off-by: Christopher Zimmermann <chrisz@openbsd.org>
Index: configure
--- configure.orig
+++ configure
@@ -14416,7 +14416,6 @@ fi
 
 fi
 
-enable_opt="yes"
 
 
 if test "x$enable_opt" = xyes; then :


Signed-off-by: Christopher Zimmermann <chrisz@openbsd.org>
Index: parsing_c/unparse_c.ml
--- parsing_c/unparse_c.ml.orig
+++ parsing_c/unparse_c.ml
@@ -2362,11 +2362,11 @@ let start_mark = function
 *)
 module String = struct
   let init n f =
-    let s = String.make n ' ' in
+    let s = Bytes.make n ' ' in
     for i = 0 to n - 1 do
       s.[i] <- f i
     done;
-    s
+    Bytes.unsafe_to_string s
 
   let map f s =
     init (String.length s) (fun i -> f s.[i])


Signed-off-by: Christopher Zimmermann <chrisz@openbsd.org>
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -71,7 +71,7 @@ INCLUDEDIRSDEP=commons commons/ocamlextra \
  parsing_cocci parsing_c ocaml python engine popl09 extra \
  $(MAKELIBS)
 
-INCLUDEDIRS=$(INCLUDEDIRSDEP) $(PCREDIR) $(PARMAPDIR) $(INCLIBS)
+INCLUDEDIRS=$(INCLUDEDIRSDEP) $(PCREDIR) $(PARMAPDIR) $(INCLIBS) +num
 
 ##############################################################################
 # Generic variables


Signed-off-by: Christopher Zimmermann <chrisz@openbsd.org>
Index: parsing_c/Makefile
--- parsing_c/Makefile.orig
+++ parsing_c/Makefile
@@ -42,9 +42,9 @@ LIBS=../commons/commons.cma ../globals/globals.cma \
 INCLUDESDEP= -I ../commons -I ../commons/ocamlextra \
   -I ../globals -I  ../parsing_cocci
 
-INCLUDES=$(INCLUDESDEP) $(TARZANINCLUDE)
+INCLUDES=$(INCLUDESDEP) $(TARZANINCLUDE) -I +num
 
-SYSLIBS= str.cma unix.cma num.cma
+SYSLIBS= str.cma unix.cma nums.cma
 
 ##############################################################################
 # Generic variables



Signed-off-by: Christopher Zimmermann <chrisz@openbsd.org>
Index: parsing_c/unparse_c.ml
--- parsing_c/unparse_c.ml.orig
+++ parsing_c/unparse_c.ml
@@ -2362,11 +2362,11 @@ let start_mark = function
 *)
 module String = struct
   let init n f =
-    let s = String.make n ' ' in
+    let s = Bytes.make n ' ' in
     for i = 0 to n - 1 do
       s.[i] <- f i
     done;
-    s
+    Bytes.unsafe_to_string s
 
   let map f s =
     init (String.length s) (fun i -> f s.[i])


Signed-off-by: Christopher Zimmermann <chrisz@openbsd.org>
Index: tools/spgen/source/Makefile
--- tools/spgen/source/Makefile.orig
+++ tools/spgen/source/Makefile
@@ -39,7 +39,7 @@ LIBS_OPT = $(LIBS:=.cmxa)
 
 INCLUDEDIRS= $(COCCIDIR)/commons $(COCCIDIR)/commons/ocamlextra \
 	$(COCCIDIR)/globals $(COCCIDIR)/parsing_cocci
$(COCCIDIR)/parsing_c \
-	$(PCREDIR)
+	$(PCREDIR) +num
 
 INCLUDES=$(INCLUDEDIRS:%=-I %)
 


-- 
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
2779 7F73 44FD 0736 B67A  C410 69EC 7922 34B4 2566
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20180619/2101c2c8/attachment.asc>

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

* [Cocci] [bug-cocci] fix bytecode build of pyml
  2018-06-18 20:09 Christopher Zimmermann
  2018-06-18 21:03 ` Julia Lawall
@ 2018-06-20 14:08 ` Thierry Martinez
  1 sibling, 0 replies; 4+ messages in thread
From: Thierry Martinez @ 2018-06-20 14:08 UTC (permalink / raw)
  To: cocci

Hi, Christopher.

Thank you for your patches! I adapted the first one; the other ones
applied to former version of Coccinelle repo and are already fixed.

Christopher?:
> +++ bundles/pyml/Makefile

pyml/generate should be compiled by ocamlc if ocamlopt is not available,
indeed. It is done this way in newer versions of pyml, so I updated pyml
version in master and adapted your patch accordingly (see 7ab8f01).

> Index: configure

This file is generated by autoconf. The culprit line in configure.ac
was fixed in master by commit 14945e1.

> Index: parsing_c/unparse_c.ml

These redefinitions of String.{init,map} are not present anymore
in unparse_c.ml since commit 446dc66f.

> Index: Makefile

The nums module is no longer used (see commit 3c5dc62ba).

Cheers.
--
Thierry.

Christopher?:
> Hi,
>
> please consider inclusion of the following patches.
>
> Christopher Zimmermann
>
>
> Index: bundles/pyml/Makefile
> --- bundles/pyml/Makefile.orig
> +++ bundles/pyml/Makefile
> @@ -52,8 +52,8 @@ $(SRC_DIR)/pyml_compat.cmx: $(SRC_DIR)/pyml_compat.ml
>  $(SRC_DIR)/pyml_compat.cmo: $(SRC_DIR)/pyml_compat.ml $(SRC_DIR)/pyml_compat.cmi
>  	$(OCAMLC_CMD) -c $< -o $@
>
> -$(SRC_DIR)/generate: $(SRC_DIR)/pyml_compat.cmx $(SRC_DIR)/generate.cmx
> -	$(OCAMLOPT) $^ -o $@
> +$(SRC_DIR)/generate: $(SRC_DIR)/pyml_compat.cmo $(SRC_DIR)/generate.cmo
> +	$(OCAMLC_CMD) $^ -o $@
>
>  $(SRC_DIR)/generate.cmx: $(SRC_DIR)/generate.ml $(SRC_DIR)/pyml_compat.cmx
>  	$(OCAMLOPT_CMD) -c $< -o $@
>
>
>
>
> This does not set a default options as suggested in configure.ac,
> but overrides the user-provided setting.
>
> Index: configure
> --- configure.orig
> +++ configure
> @@ -14416,7 +14416,6 @@ fi
>
>  fi
>
> -enable_opt="yes"
>
>
>  if test "x$enable_opt" = xyes; then :
>
>
>
> Index: parsing_c/unparse_c.ml
> --- parsing_c/unparse_c.ml.orig
> +++ parsing_c/unparse_c.ml
> @@ -2362,11 +2362,11 @@ let start_mark = function
>  *)
>  module String = struct
>    let init n f =
> -    let s = String.make n ' ' in
> +    let s = Bytes.make n ' ' in
>      for i = 0 to n - 1 do
>        s.[i] <- f i
>      done;
> -    s
> +    Bytes.unsafe_to_string s
>
>    let map f s =
>      init (String.length s) (fun i -> f s.[i])
>
>
> Index: Makefile
> --- Makefile.orig
> +++ Makefile
> @@ -71,7 +71,7 @@ INCLUDEDIRSDEP=commons commons/ocamlextra \
>   parsing_cocci parsing_c ocaml python engine popl09 extra \
>   $(MAKELIBS)
>
> -INCLUDEDIRS=$(INCLUDEDIRSDEP) $(PCREDIR) $(PARMAPDIR) $(INCLIBS)
> +INCLUDEDIRS=$(INCLUDEDIRSDEP) $(PCREDIR) $(PARMAPDIR) $(INCLIBS) +num
>
>  ##############################################################################
>  # Generic variables
>
>
>
> Index: parsing_c/Makefile
> --- parsing_c/Makefile.orig
> +++ parsing_c/Makefile
> @@ -42,9 +42,9 @@ LIBS=../commons/commons.cma ../globals/globals.cma \
>  INCLUDESDEP= -I ../commons -I ../commons/ocamlextra \
>    -I ../globals -I  ../parsing_cocci
>
> -INCLUDES=$(INCLUDESDEP) $(TARZANINCLUDE)
> +INCLUDES=$(INCLUDESDEP) $(TARZANINCLUDE) -I +num
>
> -SYSLIBS= str.cma unix.cma num.cma
> +SYSLIBS= str.cma unix.cma nums.cma
>
>  ##############################################################################
>  # Generic variables
>
>
>
>
> Index: parsing_c/unparse_c.ml
> --- parsing_c/unparse_c.ml.orig
> +++ parsing_c/unparse_c.ml
> @@ -2362,11 +2362,11 @@ let start_mark = function
>  *)
>  module String = struct
>    let init n f =
> -    let s = String.make n ' ' in
> +    let s = Bytes.make n ' ' in
>      for i = 0 to n - 1 do
>        s.[i] <- f i
>      done;
> -    s
> +    Bytes.unsafe_to_string s
>
>    let map f s =
>      init (String.length s) (fun i -> f s.[i])
>
>
>
> Index: tools/spgen/source/Makefile
> --- tools/spgen/source/Makefile.orig
> +++ tools/spgen/source/Makefile
> @@ -39,7 +39,7 @@ LIBS_OPT = $(LIBS:=.cmxa)
>
>  INCLUDEDIRS= $(COCCIDIR)/commons $(COCCIDIR)/commons/ocamlextra \
>  	$(COCCIDIR)/globals $(COCCIDIR)/parsing_cocci
> $(COCCIDIR)/parsing_c \
> -	$(PCREDIR)
> +	$(PCREDIR) +num
>
>  INCLUDES=$(INCLUDEDIRS:%=-I %)

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

* [Cocci] [bug-cocci] fix bytecode build of pyml
  2018-06-18 20:09 Christopher Zimmermann
@ 2018-06-18 21:03 ` Julia Lawall
  2018-06-20 14:08 ` Thierry Martinez
  1 sibling, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2018-06-18 21:03 UTC (permalink / raw)
  To: cocci

Thank you for the feedback.  Could you send a version with

Signed-off-by: name <email>

See readme.txt.

Thanks,
julia

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

* [Cocci] [bug-cocci] fix bytecode build of pyml
@ 2018-06-18 20:09 Christopher Zimmermann
  2018-06-18 21:03 ` Julia Lawall
  2018-06-20 14:08 ` Thierry Martinez
  0 siblings, 2 replies; 4+ messages in thread
From: Christopher Zimmermann @ 2018-06-18 20:09 UTC (permalink / raw)
  To: cocci

Hi,

please consider inclusion of the following patches.

Christopher Zimmermann


Index: bundles/pyml/Makefile
--- bundles/pyml/Makefile.orig
+++ bundles/pyml/Makefile
@@ -52,8 +52,8 @@ $(SRC_DIR)/pyml_compat.cmx: $(SRC_DIR)/pyml_compat.ml 
 $(SRC_DIR)/pyml_compat.cmo: $(SRC_DIR)/pyml_compat.ml $(SRC_DIR)/pyml_compat.cmi
 	$(OCAMLC_CMD) -c $< -o $@
 
-$(SRC_DIR)/generate: $(SRC_DIR)/pyml_compat.cmx $(SRC_DIR)/generate.cmx
-	$(OCAMLOPT) $^ -o $@
+$(SRC_DIR)/generate: $(SRC_DIR)/pyml_compat.cmo $(SRC_DIR)/generate.cmo
+	$(OCAMLC_CMD) $^ -o $@
 
 $(SRC_DIR)/generate.cmx: $(SRC_DIR)/generate.ml $(SRC_DIR)/pyml_compat.cmx
 	$(OCAMLOPT_CMD) -c $< -o $@




This does not set a default options as suggested in configure.ac,
but overrides the user-provided setting.

Index: configure
--- configure.orig
+++ configure
@@ -14416,7 +14416,6 @@ fi
 
 fi
 
-enable_opt="yes"
 
 
 if test "x$enable_opt" = xyes; then :



Index: parsing_c/unparse_c.ml
--- parsing_c/unparse_c.ml.orig
+++ parsing_c/unparse_c.ml
@@ -2362,11 +2362,11 @@ let start_mark = function
 *)
 module String = struct
   let init n f =
-    let s = String.make n ' ' in
+    let s = Bytes.make n ' ' in
     for i = 0 to n - 1 do
       s.[i] <- f i
     done;
-    s
+    Bytes.unsafe_to_string s
 
   let map f s =
     init (String.length s) (fun i -> f s.[i])


Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -71,7 +71,7 @@ INCLUDEDIRSDEP=commons commons/ocamlextra \
  parsing_cocci parsing_c ocaml python engine popl09 extra \
  $(MAKELIBS)
 
-INCLUDEDIRS=$(INCLUDEDIRSDEP) $(PCREDIR) $(PARMAPDIR) $(INCLIBS)
+INCLUDEDIRS=$(INCLUDEDIRSDEP) $(PCREDIR) $(PARMAPDIR) $(INCLIBS) +num
 
 ##############################################################################
 # Generic variables



Index: parsing_c/Makefile
--- parsing_c/Makefile.orig
+++ parsing_c/Makefile
@@ -42,9 +42,9 @@ LIBS=../commons/commons.cma ../globals/globals.cma \
 INCLUDESDEP= -I ../commons -I ../commons/ocamlextra \
   -I ../globals -I  ../parsing_cocci
 
-INCLUDES=$(INCLUDESDEP) $(TARZANINCLUDE)
+INCLUDES=$(INCLUDESDEP) $(TARZANINCLUDE) -I +num
 
-SYSLIBS= str.cma unix.cma num.cma
+SYSLIBS= str.cma unix.cma nums.cma
 
 ##############################################################################
 # Generic variables




Index: parsing_c/unparse_c.ml
--- parsing_c/unparse_c.ml.orig
+++ parsing_c/unparse_c.ml
@@ -2362,11 +2362,11 @@ let start_mark = function
 *)
 module String = struct
   let init n f =
-    let s = String.make n ' ' in
+    let s = Bytes.make n ' ' in
     for i = 0 to n - 1 do
       s.[i] <- f i
     done;
-    s
+    Bytes.unsafe_to_string s
 
   let map f s =
     init (String.length s) (fun i -> f s.[i])



Index: tools/spgen/source/Makefile
--- tools/spgen/source/Makefile.orig
+++ tools/spgen/source/Makefile
@@ -39,7 +39,7 @@ LIBS_OPT = $(LIBS:=.cmxa)
 
 INCLUDEDIRS= $(COCCIDIR)/commons $(COCCIDIR)/commons/ocamlextra \
 	$(COCCIDIR)/globals $(COCCIDIR)/parsing_cocci
$(COCCIDIR)/parsing_c \
-	$(PCREDIR)
+	$(PCREDIR) +num
 
 INCLUDES=$(INCLUDEDIRS:%=-I %)
 


-- 
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
2779 7F73 44FD 0736 B67A  C410 69EC 7922 34B4 2566
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20180618/f06a28f9/attachment.asc>

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

end of thread, other threads:[~2018-06-20 14:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-19  6:11 [Cocci] [bug-cocci] fix bytecode build of pyml Christopher Zimmermann
  -- strict thread matches above, loose matches on Subject: below --
2018-06-18 20:09 Christopher Zimmermann
2018-06-18 21:03 ` Julia Lawall
2018-06-20 14:08 ` Thierry Martinez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).