cucumber / common

A home for issues that are common to multiple cucumber repositories
https://cucumber.io/docs
MIT License
3.36k stars 695 forks source link

gherkin/c build broken and no solution in documentation #752

Closed RuyBlast closed 4 years ago

RuyBlast commented 4 years ago

Summary

Gherkin/c build is broken. No working solution is provided to overcome this.

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context & Motivation

I would like to build gherkin/c in order to use cucumber for ocaml. I do not need the latest version, I would be happy with a recent working one, how could I build such a version ? (I suppose I could come back to a git commit where it was working, couldn't I ?)

Your Environment

I am new to cucumber, so sorry if I am misleading something. Thanks in advance for your answer :)

aslakhellesoy commented 4 years ago

The gherkin/c build was only disabled from CI a few weeks ago because some shared acceptance tests were failing. It should still compile and work fine.

Can you share your errors?

RuyBlast commented 4 years ago

Thanks for your answer. Here is the response I get to the cmake --build . --target install command: Scanning dependencies of target gherkin [ 1%] Building C object CMakeFiles/gherkin.dir/src/file_reader.c.o [ 3%] Building C object CMakeFiles/gherkin.dir/src/file_utf8_source.c.o [ 5%] Building C object CMakeFiles/gherkin.dir/src/print_utilities.c.o [ 7%] Building C object CMakeFiles/gherkin.dir/src/string_utilities.c.o [ 8%] Building C object CMakeFiles/gherkin.dir/src/unicode_utilities.c.o [ 10%] Building C object CMakeFiles/gherkin.dir/src/utf8_source.c.o [ 12%] Building C object CMakeFiles/gherkin.dir/src/parser.c.o [ 14%] Building C object CMakeFiles/gherkin.dir/src/token_scanner.c.o [ 16%] Building C object CMakeFiles/gherkin.dir/src/file_token_scanner.c.o [ 17%] Building C object CMakeFiles/gherkin.dir/src/string_token_scanner.c.o [ 19%] Building C object CMakeFiles/gherkin.dir/src/token_matcher.c.o [ 21%] Building C object CMakeFiles/gherkin.dir/src/token.c.o [ 23%] Building C object CMakeFiles/gherkin.dir/src/token_queue.c.o [ 25%] Building C object CMakeFiles/gherkin.dir/src/item_queue.c.o [ 26%] Building C object CMakeFiles/gherkin.dir/src/gherkin_line.c.o [ 28%] Building C object CMakeFiles/gherkin.dir/src/error.c.o [ 30%] Building C object CMakeFiles/gherkin.dir/src/error_list.c.o [ 32%] Building C object CMakeFiles/gherkin.dir/src/dialect.c.o [ 33%] Building C object CMakeFiles/gherkin.dir/src/ast_builder.c.o [ 35%] Building C object CMakeFiles/gherkin.dir/src/ast_node.c.o [ 37%] Building C object CMakeFiles/gherkin.dir/src/gherkin_document.c.o [ 39%] Building C object CMakeFiles/gherkin.dir/src/feature.c.o [ 41%] Building C object CMakeFiles/gherkin.dir/src/rule.c.o [ 42%] Building C object CMakeFiles/gherkin.dir/src/scenario.c.o [ 44%] Building C object CMakeFiles/gherkin.dir/src/background.c.o [ 46%] Building C object CMakeFiles/gherkin.dir/src/comment.c.o [ 48%] Building C object CMakeFiles/gherkin.dir/src/data_table.c.o [ 50%] Building C object CMakeFiles/gherkin.dir/src/doc_string.c.o [ 51%] Building C object CMakeFiles/gherkin.dir/src/example_table.c.o [ 53%] Building C object CMakeFiles/gherkin.dir/src/step.c.o [ 55%] Building C object CMakeFiles/gherkin.dir/src/table_cell.c.o [ 57%] Building C object CMakeFiles/gherkin.dir/src/table_row.c.o [ 58%] Building C object CMakeFiles/gherkin.dir/src/tag.c.o [ 60%] Building C object CMakeFiles/gherkin.dir/src/compiler.c.o [ 62%] Building C object CMakeFiles/gherkin.dir/src/pickle.c.o [ 64%] Building C object CMakeFiles/gherkin.dir/src/pickle_cell.c.o [ 66%] Building C object CMakeFiles/gherkin.dir/src/pickle_id_creator.c.o [ 67%] Building C object CMakeFiles/gherkin.dir/src/pickle_location.c.o [ 69%] Building C object CMakeFiles/gherkin.dir/src/pickle_row.c.o [ 71%] Building C object CMakeFiles/gherkin.dir/src/pickle_step.c.o [ 73%] Building C object CMakeFiles/gherkin.dir/src/pickle_string.c.o [ 75%] Building C object CMakeFiles/gherkin.dir/src/pickle_table.c.o [ 76%] Building C object CMakeFiles/gherkin.dir/src/pickle_tag.c.o [ 78%] Building C object CMakeFiles/gherkin.dir/src/event.c.o [ 80%] Building C object CMakeFiles/gherkin.dir/src/attachment_event.c.o [ 82%] Building C object CMakeFiles/gherkin.dir/src/gherkin_document_event.c.o [ 83%] Building C object CMakeFiles/gherkin.dir/src/pickle_event.c.o [ 85%] Building C object CMakeFiles/gherkin.dir/src/source_event.c.o [ 87%] Building C object CMakeFiles/gherkin.dir/src/ast_printer.c.o [ 89%] Building C object CMakeFiles/gherkin.dir/src/pickle_printer.c.o [ 91%] Linking C static library libgherkin.a [ 91%] Built target gherkin Scanning dependencies of target gherkinexe [ 92%] Building C object CMakeFiles/gherkinexe.dir/src/gherkin_cli.c.o [ 94%] Linking C executable gherkinexe libgherkin.a(error_list.c.o) : Inside fonction « calculate_string_length_for_number » : error_list.c:(.text+0xabb) : undefined reference towards « log10 » collect2: error: ld returned 1 exit status CMakeFiles/gherkinexe.dir/build.make:95: recipe for target 'gherkinexe' failed make[2]: [gherkinexe] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/gherkinexe.dir/all' failed make[1]: [CMakeFiles/gherkinexe.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

aslakhellesoy commented 4 years ago

Have you tried the regular make build? I know nothing about cmake, and I have suggested we get rid of it because not enough people know how to maintain it. See https://github.com/cucumber/cucumber/pull/555#issuecomment-526751915

RuyBlast commented 4 years ago

It looks like it worked with make (make default), thanks a lot ! (I didn'it try to use the library yet but it should work fine !) Thanks for your help ! As make command seems to work and cmake do not, maybe the README.md should be modified ? (because it suggests only cmake as a building step). Best !

aslakhellesoy commented 4 years ago

Glad it worked for you! The CMake build is not executed by CI, nor is it something the regular maintainers are familiar with.

Let’s see if somebody enables it in CI (and fixes it if it’s broken) within the next month. If not we might as well delete it.

/cc @Corristo @brasmusson

RuyBlast commented 4 years ago

In fact, it looks like the file libs/libgherkin.so.7.0.4 has a problem : even after adding it to the path of LD_LIBRARY_PATH, or putting it in a directory listed by cat /etc/ld.so.conf.d/*.conf, the file_reader.h is not found by my system (while it should be). [EDIT : it is more likely that I have a problem on my workstation exposing .so files, because I could build cucumber.ml with a workaround (using -I/path-to-built-gherkin-c/libs -I/path-to-built-gherkin-c/include) in dune file to build cucumber.ml library] Thanks a lot for your help @aslakhellesoy !

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.

stale[bot] commented 4 years ago

This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.