Skip to content

Cannot recompile parser in v3 #1654

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

Closed
invartam opened this issue Jan 16, 2018 · 3 comments
Closed

Cannot recompile parser in v3 #1654

invartam opened this issue Jan 16, 2018 · 3 comments

Comments

@invartam
Copy link

Hello,

I need to force the recompilation of the parser because I have add some features in src/parser/seclang-parser.yy and src/parser/seclang-parser.ll.
But seclang-parser.cc and seclang-parser.hh exists already and when I do a make, they are not regeneratd with my new features.
I tried to do a ./configure --enable-parser-generation (found in configure.ac), but it didn't regenerate the parser.

So, is there a way to regenerate the parser with my new lex and yacc files ?

Thank you.

@victorhora
Copy link
Contributor

Hi @invartam,

I've been fairly successful in regenerating the parser when I needed to with the --enable-parser-generation flag.

Have you tried maybe doing a quick test with a fresh repo clone from Git and then doing a small change on the parser and then trigger the parser generation?

@invartam
Copy link
Author

invartam commented Jan 17, 2018

Hi @victorhora, thanks for your answer.

I've added a new log writer and a new config value in the parser to handle this new log writer.
Unfortunately when I compile with ./configure --enable-parser-generation, libmodsecurity say that my new keyword doesn't exist and the files seclang-parser.cc and seclang-scanner.cc are the same as before.
So, I think that they are not regenerated.

What do you think ?

@zimmerle zimmerle added this to the v3.0.1 milestone Feb 1, 2018
@victorhora
Copy link
Contributor

Hi @invartam,

I've just submitted PR #1675 to fix a small issue with the parser. The PR is similar to #1433. I've used --enable-parser-generation again it still works fine.

Notice that when adding config values to the parser they are usually added on both seclang-parser.cc and seclang_scanner.ll and then --enable-parser-generation merge the configuration values correctly into all the other parser files for yywrap / Bison to do their job.

I'm wondering if your new config values are missing in one of the parser files to cause this error?

Maybe you could use PR #1583 as reference that I submitted some time ago to add support for a config value for the AuditLogFormat value.

Let us know if the issue persists.

Thanks.

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

No branches or pull requests

3 participants