Skip to contentSkip to conversation

tools/ocaml: Fix cleaning bindings test

PATCH In review Jason Andryuk 3 participants 6 messages Nov 6 – Nov 9

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/ocaml: Fix cleaning bindings test

make clean fails in the bindings tests:

make[7]: Entering directory '/home/amd/xen/tools/ocaml/tests/bindings'
rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.cmxs *.annot *.spot *.spit unix.cmxa -ccopt -L -ccopt ....
rm: invalid option -- 'c'
Try 'rm --help' for more information.

Split the compiler flags out of the LIBS variable, since LIBS is passed to rm. The individual *.cxma files are deleted in their respective directories.

Fixes d97847e858f1 ("tools/ocaml: Gitlab CI test for bindings")
---
 tools/ocaml/tests/bindings/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/ocaml/tests/bindings/Makefile +3 -3
index 75f8babbaf..98fcb7aa5b 100644
@@ -10,8 +10,8 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xc \
 	-I $(OCAML_TOPLEVEL)/libs/eventchn
 
-LIBS = \
-	unix.cmxa \
+LIBS = unix.cmxa
+LIBFLAGS = \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/xenmmap.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xc $(OCAML_TOPLEVEL)/libs/xc/xenctrl.cmxa \
@@ -21,7 +21,7 @@ LIBS = \
 PROGRAMS = test-ocaml-bindings
 OCAML_PROGRAM = test-ocaml-bindings
 
-test-ocaml-bindings_LIBS = $(LIBS)
+test-ocaml-bindings_LIBS = $(LIBS) $(LIBFLAGS)
 test-ocaml-bindings_MLSORTED = $(shell $(OCAMLDEP) -sort $(OBJS:=.ml))
 test-ocaml-bindings_OBJS = $(test-ocaml-bindings_MLSORTED:.ml=)
 
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jason Andryuk

make clean fails in the bindings tests:

make[7]: Entering directory '/home/amd/xen/tools/ocaml/tests/bindings'
rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.cmxs *.annot *.spot *.spit unix.cmxa -ccopt -L -ccopt ....
rm: invalid option -- 'c'
Try 'rm --help' for more information.

Quoted 6 lines

Split the compiler flags out of the LIBS variable, since LIBS is passed to rm. The individual *.cxma files are deleted in their respective directories.

Fixes d97847e858f1 ("tools/ocaml: Gitlab CI test for bindings")

Lovely...  Sorry for breaking this.

#2 lore raw
Quoted 12 lines · Andrew Cooper
Quoted 11 lines · Jason Andryuk

make clean fails in the bindings tests:

make[7]: Entering directory '/home/amd/xen/tools/ocaml/tests/bindings'
rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.cmxs *.annot *.spot *.spit unix.cmxa -ccopt -L -ccopt ....
rm: invalid option -- 'c'
Try 'rm --help' for more information.

Split the compiler flags out of the LIBS variable, since LIBS is passed to rm. The individual *.cxma files are deleted in their respective directories.

Quoted 6 lines
Quoted 2 lines
Fixes d97847e858f1 ("tools/ocaml: Gitlab CI test for bindings")

Lovely...  Sorry for breaking this.

Thanks. I just double checked and unix.cmxa isn't in the directory on a successful build. So the whole thing could be moved to LIBFLAGS or a suitable name.

Regards,
Jason

#3 lore raw
Quoted 17 lines · Jason Andryuk
Quoted 16 lines · Andrew Cooper
Quoted 14 lines · Jason Andryuk

make clean fails in the bindings tests:

make[7]: Entering directory '/home/amd/xen/tools/ocaml/tests/bindings' rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.cmxs *.annot *.spot *.spit unix.cmxa -ccopt -L -ccopt ....
rm: invalid option -- 'c'
Try 'rm --help' for more information.

Split the compiler flags out of the LIBS variable, since LIBS is passed to rm.  The individual *.cxma files are deleted in their respective directories.

Fixes d97847e858f1 ("tools/ocaml: Gitlab CI test for bindings")
Quoted 7 lines
Quoted 3 lines

Lovely...  Sorry for breaking this.

Thanks.  I just double checked and unix.cmxa isn't in the directory on a successful build.  So the whole thing could be moved to LIBFLAGS or a suitable name.

Unix is from the Ocaml standard library, but you still have to name it to get an executable out at the end.

I cribbed this all from tools/ocaml/xenstored/Makefile attempting to simplify it as I went.  What's not clear is why LIBS is a special name.

~Andrew

#4 lore raw
In reply to Jason Andryuk
Quoted 16 lines · Jason Andryuk
Quoted 15 lines · Andrew Cooper
Quoted 13 lines · Jason Andryuk

make clean fails in the bindings tests:

make[7]: Entering directory '/home/amd/xen/tools/ocaml/tests/bindings'
rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.cmxs *.annot *.spot *.spit unix.cmxa -ccopt -L -ccopt ....
rm: invalid option -- 'c'
Try 'rm --help' for more information.

Split the compiler flags out of the LIBS variable, since LIBS is passed to rm.  The individual *.cxma files are deleted in their respective directories.

Fixes d97847e858f1 ("tools/ocaml: Gitlab CI test for bindings")
Quoted 8 lines
Quoted 3 lines

Lovely...  Sorry for breaking this.

Thanks.  I just double checked and unix.cmxa isn't in the directory on a successful build.  So the whole thing could be moved to LIBFLAGS or a suitable name.

Regards,
Jason

Could we follow tools/ocaml/xenstored/Makefile further and move to BINDINGSLIBS or something like that?

#5 lore raw
Quoted 28 lines · Andrii Sultanov
Quoted 26 lines · Jason Andryuk
Quoted 14 lines · Andrew Cooper
Quoted 13 lines · Jason Andryuk

make clean fails in the bindings tests:

make[7]: Entering directory '/home/amd/xen/tools/ocaml/tests/bindings' rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.cmxs *.annot *.spot *.spit unix.cmxa -ccopt -L -ccopt ....
rm: invalid option -- 'c'
Try 'rm --help' for more information.

Split the compiler flags out of the LIBS variable, since LIBS is passed
to rm.  The individual *.cxma files are deleted in their respective directories.

Quoted 6 lines
Quoted 2 lines
Fixes d97847e858f1 ("tools/ocaml: Gitlab CI test for bindings")

Lovely...  Sorry for breaking this.

Thanks.  I just double checked and unix.cmxa isn't in the directory on a successful build.  So the whole thing could be moved to LIBFLAGS or a suitable name.

Quoted 6 lines
Quoted 2 lines

Regards,
Jason

Could we follow tools/ocaml/xenstored/Makefile further and move to BINDINGSLIBS or something like that?

Yeah, lets do that.  It keeps it firmly away from variable names which have common meanings.

I'll fix up on commit.

~Andrew