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
Whoops, I don't think a test feature flag exists #895
Conversation
It seems like this was a feature flag until it was removed in #786. This currently then fails to work because the build script expects to find the Line 35 in f1060df
Thus no lalrpop grammar gets built |
Thanks for the deep investigation! Took me a while to wrap my head around, but I guess the idea is that for non-test builds, we just use the bootstrapped binary, but for test, we use that bootstrapped binary to build the existing grammar and run tests against that. That seems to make sense. So you probably just want to turn the build.rs part into gating on |
Yeah that all makes sense to me. Unfortunately there is a wrinkle that |
Ah, that probably explains the original choice to add a test feature flag. I think just restoring the test feature flag seems like the least bad option to me. The whole "make a new crate as a dev-dependency" is a lot of complexity. I guess the other question is: do we really need this functionality? We check that we've updated the grammar on PRs, so we're not at risk of the latest grammar ending up untested. It's a potential trap for local iteration though, which is a downside. I'm not sure the cost of the test feature flag is enough to justify that tradeoff. |
I was thinking about it and it seems best to remove the special test path. It adds some extra complexity and potentially means that you are not syncing what you are testing with what you are trying to ship. More so, it's just kinda a bad user experience to have this non-standard hack... I think I've just always mindlessly used |
Yeah, I want to give this a second read with more focus on the details, but I really like the approach you have now after a quick first pass. |
I was poking at #892 and I noticed this warning pop up. I had to double check(and I see this is a common confusion it seems https://stackoverflow.com/questions/72908829/what-is-the-difference-between-cfgtest-and-cfgfeature-test).
Given the code in question, I think it just always pulled from
mod lrgrammar;
without issue?