Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make test failure and other compilation errors #225

Open
aryx opened this issue Jul 5, 2021 · 6 comments
Open

make test failure and other compilation errors #225

aryx opened this issue Jul 5, 2021 · 6 comments
Assignees

Comments

@aryx
Copy link
Collaborator

aryx commented Jul 5, 2021

I did make setup, and make build, but then make test fails with:

...
eq: Generating initial 'grammar.json' from 'grammar.js'.
seq: Simplifying 'grammar.json' for ocaml-tree-sitter.
ocaml-tree-sitter: too many arguments, don't know what to do with `src/grammar.json'
Usage: ocaml-tree-sitter [OPTION]... LANG GRAMMAR_JSON
Try `ocaml-tree-sitter --help' for more information.
make[6]: *** [Makefile:48: src/grammar.json] Error 1
make[6]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core/test/seq'
make[5]: *** [Makefile:26: gen] Error 2
make[5]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core/test/seq'
make[4]: *** [Makefile:19: build] Error 2
make[4]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core/test/seq'
make[3]: *** [Makefile:24: test] Error 2
make[3]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core/test'
make[2]: *** [Makefile:57: e2e] Error 2
make[2]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core'
make[1]: *** [Makefile:47: test] Error 2
make[1]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core'
make: *** [Makefile:43: test] Error 2

@aryx
Copy link
Collaborator Author

aryx commented Jul 5, 2021

then I tried cd lang/go; make but then got this failure:

[pad@yrax go (main)]$ make
make gen
make[1]: Entering directory '/home/pad/github/ocaml-tree-sitter-semgrep/lang/go'
make gen-c
make[2]: Entering directory '/home/pad/github/ocaml-tree-sitter-semgrep/lang/go'
if [ ! -e src/parser.c ] \
          || [ ! -e "../semgrep-grammars/lang/go/src/grammar.json" ] \
          || [ "../semgrep-grammars/lang/go/src/grammar.json" -nt src/parser.c ]; then \
  /home/pad/github/ocaml-tree-sitter-semgrep/scripts/ocaml-tree-sitter-gen-c; \
else \
  echo "src/parser.c for go is up to date."; \
fi
Missing local 'grammar.js' and missing '../semgrep-grammars/lang/go/src/grammar.json'.
One of these files must exist.
make[2]: *** [Makefile:48: src/grammar.json] Error 1
make[2]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/lang/go'
make[1]: *** [Makefile:26: gen] Error 2
make[1]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/lang/go'
make: *** [Makefile:19: build] Error 2

@aryx
Copy link
Collaborator Author

aryx commented Jul 5, 2021

ok, got it working a bit. I forgot 'make install' from the top.
But then when I do make test from the top I get this error:

...
make[5]: Entering directory '/home/pad/github/ocaml-tree-sitter-semgrep/core/test/seq'
/home/pad/github/ocaml-tree-sitter-semgrep/core/scripts/build-ocaml
         gcc lib/parser.o
parser.c: In function 'tree_sitter_seq':
parser.c:171:21: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  171 |     .symbol_names = ts_symbol_names,
      |                     ^~~~~~~~~~~~~~~
    ocamlopt bin/Main.exe (exit 2)
(cd _build/default && /home/pad/.opam/4.09.1/bin/ocamlopt.opt -w @[email protected]@30..39@[email protected]@[email protected] -strict-sequence -strict-formats -short-paths -keep-locs -g -o bin/Main.exe /home/pad/.opam/4.09.1/lib/easy-format/easy_format.cmxa /home/pad/.opam/4.09.1/lib/biniou/biniou.cmxa /home/pad/.opam/4.09.1/lib/yojson/yojson.cmxa /home/pad/.opam/4.09.1/lib/atdgen-runtime/atdgen_runtime.cmxa /home/pad/.opam/4.09.1/lib/ocaml/unix.cmxa -I /home/pad/.opam/4.09.1/lib/ocaml /home/pad/.opam/4.09.1/lib/ANSITerminal/ANSITerminal.cmxa -I /home/pad/.opam/4.09.1/lib/ANSITerminal /home/pad/.opam/4.09.1/lib/cmdliner/cmdliner.cmxa /home/pad/.opam/4.09.1/lib/ocaml/bigarray.cmxa -I /home/pad/.opam/4.09.1/lib/ocaml /home/pad/.opam/4.09.1/lib/sexplib0/sexplib0.cmxa /home/pad/.opam/4.09.1/lib/base/caml/caml.cmxa /home/pad/.opam/4.09.1/lib/parsexp/parsexp.cmxa /home/pad/.opam/4.09.1/lib/sexplib/sexplib.cmxa /home/pad/.opam/4.09.1/lib/ocaml/str.cmxa -I /home/pad/.opam/4.09.1/lib/ocaml /home/pad/.opam/4.09.1/lib/containers/monomorphic/containers_monomorphic.cmxa /home/pad/.opam/4.09.1/lib/containers/containers.cmxa /home/pad/.opam/4.09.1/lib/tsort/tsort.cmxa /home/pad/.opam/4.09.1/lib/result/result.cmxa /home/pad/.opam/4.09.1/lib/ppx_deriving/runtime/ppx_deriving_runtime.cmxa /home/pad/.opam/4.09.1/lib/tree-sitter/gen/tree_sitter_gen.cmxa /home/pad/.opam/4.09.1/lib/tree-sitter/bindings/tree_sitter_bindings.cmxa -I /home/pad/.opam/4.09.1/lib/tree-sitter/bindings /home/pad/.opam/4.09.1/lib/ppx_sexp_conv/runtime-lib/ppx_sexp_conv_lib.cmxa /home/pad/.opam/4.09.1/lib/tree-sitter/run/tree_sitter_run.cmxa lib/tree_sitter_seq.cmxa -I lib bin/.Main.eobjs/native/dune__exe__Main.cmx)
gcc: error: ": No such file or directory
File "caml_startup", line 1:
Error: Error during linking
    ocamlopt lib/tree_sitter_seq.cmxs (exit 2)
(cd _build/default && /home/pad/.opam/4.09.1/bin/ocamlopt.opt -w @[email protected]@30..39@[email protected]@[email protected] -strict-sequence -strict-formats -short-paths -keep-locs -g -shared -linkall -I lib -o lib/tree_sitter_seq.cmxs lib/tree_sitter_seq.cmxa)
gcc: error: ": No such file or directory
File "caml_startup", line 1:
Error: Error during linking
make[5]: *** [Makefile:63: build-ocaml] Error 1
make[5]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core/test/seq'
make[4]: *** [Makefile:20: build] Error 2
make[4]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core/test/seq'
make[3]: *** [Makefile:24: test] Error 2
make[3]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core/test'
make[2]: *** [Makefile:57: e2e] Error 2
make[2]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core'
make[1]: *** [Makefile:47: test] Error 2
make[1]: Leaving directory '/home/pad/github/ocaml-tree-sitter-semgrep/core'
make: *** [Makefile:43: test] Error 2

@aryx aryx changed the title make test failure make test failure and other compilation errors Jul 5, 2021
@mjambon
Copy link
Member

mjambon commented Jul 6, 2021

We get this when using the old version of ocaml-tree-sitter does this. It's currently built and installed when building semgrep, which isn't great.

@mjambon
Copy link
Member

mjambon commented Jul 6, 2021

We get this when using the old version of ocaml-tree-sitter does this. It's currently built and installed when building semgrep, which isn't great.

I was replying to the first error.

@mjambon
Copy link
Member

mjambon commented Jul 6, 2021

Please open a ticket for each error.

@mjambon
Copy link
Member

mjambon commented Jul 6, 2021

gcc: error: ": No such file or directory

I definitely had this error before. I think this was solved by installing clang; not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants