deterministic error message #190
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#190
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When there are several errors in the user code, it should be deterministic which one is printed.
Currently you can get a different one by just re-running the compiler, which makes debugging very tedious.
For example those are consecutive runs without touching anything:
The last error message is also particularly bad without any kind of provenance information.
#193
Well this is actually not that hard, we could just combine the error messages from all threads together. This undeterministic error message is due to having several errors in different threads, and we currently only report the first one.
Apart from this, I guess we should also need a diagnostic struct to store both errors and warnings, so we could solve #118.
For error messages regarding tuples, unknown exceptions etc., we will need to change the return type of a lot of functions to result. Will fix this later.
There's still plenty of non-determinism. Without changing anything:
Are there any instructions on how to reproduce this issue with
nac3devices.py
? I wasn't able to find adevice_db.py
which enablesnac3devices.py
to be compiled.After digging into the codebase, it seems like the non-determinism might be due to the compiler using multiple threads for compilation. Compounded by the fact that 1. use multiple threads may change the compilation order of files, and 2. the compiling thread will stop compilation upon its first error, it seems like the only way to solve this issue is to continue compilation until all jobs have been completed.
Edit: But based on how compilation is performed (i.e. via decorator hooks) I am not sure if there is a way to collect all errors during compilation...