Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

@bettinaheim
Copy link
Contributor

@bettinaheim bettinaheim commented Mar 16, 2021

The current behavior is that if the precondition verification fails for rewrite steps, then the step is skipped and the compilation succeeds with a warning. While overall this seems reasonable behavior given that rewrite steps may come from a 3rd party, I also found this rather suboptimal for testing: When I set up the test for qir emission for a targeted executable, the test could technically succeed when/because the targeting step is skipped (since we test for a specific .ll it will fail regardless, but still seems risky since it is easy to overlook that the transformation in question is not executed when e.g. updating the test).
I hence went ahead and added a command line flag to force execution of rewrite steps and generate an error when the precondition is not met (see the doc comments for more detail).

@ScottCarda-MS
Copy link
Contributor

This should just be a matter of elevating the warning thrown by precondition failure to be treated as an error. That's a .NET thing right? I would be surprised if this issue needs changes to the code, but maybe @bettinaheim, you have already looked into that?

@bamarsha
Copy link
Contributor

No, diagnostic severities are handled by the Q# compiler, not by .NET or MSBuild.

@bettinaheim
Copy link
Contributor Author

Incorporated into #915.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants