building from root fails #183

Closed
dvberkel opened this Issue Mar 20, 2016 · 11 comments

Projects

None yet

2 participants

@dvberkel
Contributor

I am just starting out with gherkin but I found that the repository does not build out of the box, even after having installed the prerequisites in CONTRIBUTING.md and the language specific CONTRIBUTING.md. Going into each language subdirectory I found the following languages not compiling.

  1. python
  2. go
  3. objective-c
  4. perl

In the comments you can find details about the problems I experienced, and possible solutions. If there is a tick mark before the language that problem is solved. If the language is strike through it is not solved and is not worked upon.

@dvberkel
Contributor

Regarding python. After doing pip install -r requirements.txt as suggested in the CONTRIBUTING.md the nosetests command still can not be found. Below is the output of the make command

mono ../bin/berp.exe -g ../gherkin.berp -t gherkin-python.razor -o gherkin/parser.py
Berp Parser Generator 1.0.1.0
Copyright (C) 2014, Gaspar Nagy (http://gasparnagy.com)
Licensed under the Apache License, Version 2.0 (the "License")
    http://www.apache.org/licenses/LICENSE-2.0

Generating parser for grammar 'gherkin.berp' using template 'gherkin-python.razor'.
Loading grammar...
The grammar was loaded with 14 tokens and 25 rules.
Calculating parser states...
34 states calculated for the parser.
Generating parser class...
Parser class generated to 'gherkin/parser.py'.
# Remove BOM
tail -c +4 gherkin/parser.py > gherkin/parser.py.nobom
mv gherkin/parser.py.nobom gherkin/parser.py
cp ../gherkin-languages.json gherkin/gherkin-languages.json
python --version
Python 2.7.10
nosetests
make: nosetests: Command not found
Makefile:18: recipe for target '.built' failed
make: *** [.built] Error 127

This could well be a path problem on my side, and I will investigate further.

@dvberkel
Contributor

Regarding go. I did not have go installed. In my defense, it was not listed in the main CONTRIBUTING.md. I will install go and see if anything it makes cleanly and report back.

@dvberkel
Contributor

Regarding objective-c. I do not have xcodebuild installed. This prerequisite is not mentioned in either of the CONTRIBUTING.md files. Below is the output for the make command

mono ../bin/berp.exe -g ../gherkin.berp -t gherkin-objective-c-header.razor -o Gherkin/GHParser.h
Berp Parser Generator 1.0.1.0
Copyright (C) 2014, Gaspar Nagy (http://gasparnagy.com)
Licensed under the Apache License, Version 2.0 (the "License")
    http://www.apache.org/licenses/LICENSE-2.0

Generating parser for grammar 'gherkin.berp' using template 'gherkin-objective-c-header.razor'.
Loading grammar...
The grammar was loaded with 14 tokens and 25 rules.
Calculating parser states...
34 states calculated for the parser.
Generating parser class...
Parser class generated to 'Gherkin/GHParser.h'.
mono ../bin/berp.exe -g ../gherkin.berp -t gherkin-objective-c-implementation.razor -o Gherkin/GHParser.m
Berp Parser Generator 1.0.1.0
Copyright (C) 2014, Gaspar Nagy (http://gasparnagy.com)
Licensed under the Apache License, Version 2.0 (the "License")
    http://www.apache.org/licenses/LICENSE-2.0

Generating parser for grammar 'gherkin.berp' using template 'gherkin-objective-c-implementation.razor'.
Loading grammar...
The grammar was loaded with 14 tokens and 25 rules.
Calculating parser states...
34 states calculated for the parser.
Generating parser class...
Parser class generated to 'Gherkin/GHParser.m'.
rm -f .xcodeproj_built_debug
xcodebuild -version
make: xcodebuild: Command not found
Makefile:54: recipe for target '.xcodeproj_built_debug' failed
make: *** [.xcodeproj_built_debug] Error 127
@dvberkel
Contributor

Regarding perl. cpanm can not seem to install the dependencies in the correct place. Although this is probably solvable, the CONTRIBUTING.md does not mention how to resolve it. Full output of the make command is

cpanm --installdeps .
!
! Can't write to /usr/local/share/perl/5.20.2 and /usr/local/bin: Installing modules to /home/dvberkel/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl/5.20.2 and /usr/local/bin)
!   - Configure local::lib your existing local::lib in this shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on .
Configuring /home/dvberkel/scratch/projects/gherkin/perl ... OK
<== Installed dependencies for .. Finishing.
touch .cpanfile_dependencies
mono ../bin/berp.exe -g ../gherkin.berp -t gherkin-perl.razor -o lib/Gherkin/Generated/Parser.pm
Berp Parser Generator 1.0.1.0
Copyright (C) 2014, Gaspar Nagy (http://gasparnagy.com)
Licensed under the Apache License, Version 2.0 (the "License")
    http://www.apache.org/licenses/LICENSE-2.0

Generating parser for grammar 'gherkin.berp' using template 'gherkin-perl.razor'.
Loading grammar...
The grammar was loaded with 14 tokens and 25 rules.
Calculating parser states...
34 states calculated for the parser.
Generating parser class...
Parser class generated to 'lib/Gherkin/Generated/Parser.pm'.
# Remove BOM
tail -c +4 lib/Gherkin/Generated/Parser.pm > lib/Gherkin/Generated/Parser.pm.nobom
mv lib/Gherkin/Generated/Parser.pm.nobom lib/Gherkin/Generated/Parser.pm
perl helper-scripts/build_languages.pl < ../gherkin-languages.json > lib/Gherkin/Generated/Languages.pm
Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the Cpanel::JSON::XS module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at helper-scripts/build_languages.pl line 5.
BEGIN failed--compilation aborted at helper-scripts/build_languages.pl line 5.
Makefile:80: recipe for target 'lib/Gherkin/Generated/Languages.pm' failed
make: *** [lib/Gherkin/Generated/Languages.pm] Error 2
make: *** Deleting file 'lib/Gherkin/Generated/Languages.pm'
@dvberkel
Contributor

solution for perl. The perl build can be fixed by following the suggestion that the cpanm command gives. I.e. running the command as sudo. I ended up doing

sudo cpanm --installdeps .
@aslakhellesoy
Member

Hey @dvberkel I hope to take a closer look at this next week. We obviously want to have a push button build so it's super useful to get feedback on how we can improve that. Thanks!

@dvberkel
Contributor

@aslakhellesoy the idea of a push button build is great and I really think you are close. I will keep reporting my progress on getting the various languages to build so that should help in achieving that goal.

@dvberkel
Contributor

solution for go. Installing go as per the instructions and makeing solved my problem.

@dvberkel
Contributor

I have looked into the objective-c problem. I am on a Ubuntu machine and various sources on the net, e.g. this stackoverflow thread, say that it is not possible to use xcodebuild on Linux.

I am not entirely sure if this is actually the case. For one, Travis CI can build Gherkin just fine. But unless someone can come up with some advice, I am going to leave it as not working.

@dvberkel
Contributor

solution for python. The nosetests program was installed into ~/.local/bin directory which was not on my path. Adding it made the problem with the python build go away.

@dvberkel
Contributor

I am closing this issue because I resolved the problems I experienced in building Gherkin.

@dvberkel dvberkel closed this Mar 21, 2016
@dvberkel dvberkel added a commit to dvberkel/gherkin that referenced this issue Mar 21, 2016
@dvberkel dvberkel Add go as a build prerequisite
As mentioned in [issue 183](cucumber#183) `go` was not listed as a prerequisite for the build. This commit adds `go` to the list of prerequisites.
f4ba695
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment