Skip to content

Workaround for missing yacc/lex targets#6

Merged
onelson merged 1 commit intoonelson:masterfrom
anrdnet:yacc-stub-workaround
Sep 28, 2022
Merged

Workaround for missing yacc/lex targets#6
onelson merged 1 commit intoonelson:masterfrom
anrdnet:yacc-stub-workaround

Conversation

@anrdnet
Copy link
Copy Markdown
Contributor

@anrdnet anrdnet commented Sep 27, 2022

We have very consistently run into #1 in our CI environment, and I think I have a partial explanation and workaround.

Upstream uses code generation for some C-files in the repository, but since the checked in files are always up to date there's no need for users to update them. This is the reason "maintainer-mode" exists which stubs these rules when disabled. The stub rules can easily be spotted during build since they print "NOT building lexer.c!" or "NOT building parser.c!" respectively.

In our CI environment we always get the error from #1 whenever one of the stub rules run. The reason the failure is uncommon is that usually the mtime of the C-file and its source is identical, making make skip the rule altogether. This is only a partial explanation since I don't know why the build fails when the stub rule is triggered or why this ordering of mtime is so uncommon in other environments.

The workaround is to make sure the C-files are always newer than the files they're built from. I realize it's not the cleanest workaround so feel free to come up with something better, but this hack has been working for us.

@onelson
Copy link
Copy Markdown
Owner

onelson commented Sep 28, 2022

@anrdnet thanks for the incredible detective work! I looked at this repeatedly and more or less figured the only thing I could do to improve this would be to unravel the jq build entirely so I could pare it down somehow.

I'll take another look with fresh eyes but certainly this workaround is better than the status quo. Maybe there's an improvement that can be discovered before cutting the next release.

@onelson onelson merged commit 06608f0 into onelson:master Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants