Skip to content
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

The "throw an exception when compilation fails" behavior is broken (also, why throw exceptions at all?) #40

Open
ztellman opened this issue Jan 27, 2025 · 3 comments

Comments

@ztellman
Copy link
Collaborator

The current implementation throws an exception when getting a warning such as:

java: Some input files use unchecked or unsafe operations.
java: Recompile with -Xlint:unchecked for details.

This is clearly not a compilation error. Also, I don't really understand why you added the "throw an exception" behavior. As implemented, an error on the initial compile will prevent the background loop from initializing. This seems very much at odds with how I've used Virgil in the past. Can you expand on why you thought it was necessary?

@alexander-yakushev
Copy link
Collaborator

Hi Zach! I'll look and reply a bit later. You can revert to 0.3.0 meanwhile.

@alexander-yakushev
Copy link
Collaborator

Thank you for the report! You are right on both counts. Warnings shouldn't throw an exception in any case. Regarding why exception is thrown at all – it makes sense for the workflow where compile-java is invoked manually for faster feedback. Naturally, it doesn't suit the watch-and-recompile workflow.

My latest commit addresses both issues. It's going to be released as 0.3.2.

@alexandergunnarson
Copy link

alexandergunnarson commented Jan 28, 2025

Wow, I literally just encountered this issue this morning and had the same questions, only to see it fixed in 0.3.2. Thanks for the quick fix @alexander-yakushev!

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

No branches or pull requests

3 participants