-
Notifications
You must be signed in to change notification settings - Fork 40
feat: Add force mode, improve exception handling, correct debug log and direct command input with testing #365
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
Conversation
Looks good, but there is one issue that is still persistent: |
Are you calling by parameter or calling it from inside the CLI? Because if it is called by parameter, the fix will need to be in another PR, since this will be linking to #319 |
By param -fs/-ts act the same. |
Yes, this is because the command execution happens at the CLI initialisation, which cmd2 geraintne the application will start up successfully, despite having an error. As a result, I will need to change how this should behave. |
76895fc
to
b40cf06
Compare
Halting of the shell is depends on the return value of the command. If it rturn true, then the shell will be closed. We might want to unify how we handle error in the shell. Do we always return true (exit) on error, or raise an exception? |
We should raise an exception, returning true in case of an error just feels wrong. As a simplification, we could automatically call the |
I have updated the logic to add an interactive mode. Now, when the user is in interactive mode, it will always stay in the shell no matter what error is raised. When it is not in interactive mode, it will always set the exit code to 1, and it depends on whether the user wants to force execution. If force is enabled, it will keep running even if there is an error; otherwise, it will terminate the shell. I have added the load_fabric command on start up. |
6200111
to
27939b0
Compare
I like to know what the expected behaviour is for the global environment. The current implementation is that the env variable overrides the user-supplied path, which seems a bit odd to me. |
You are right, this is a bug then. |
Is the interactive mode the default for the tcl and FABulous script execution? If I add an error, it still tries to run the whole flow afterwards. As an example, I added a new primitive to the fabric, which I didn't add to yosys prims lib.
I would expect that after a failed synthesis, the execution stops, but it still tires PnR, which also fails, but still adds the message This behavior is the same for the manual shell execution, as well as FABulous Script and TCL script. |
At least for
This is what we usually have; the CLI is the interactive mode. This basically enables force mode, so the user will never exit the shell when they encounter an error running any command. I will update those "super command" behaviours. |
I'll open an issue for that.
We should add some documentation about this.
Ok, I'll convert the PR to draft, until it's done. |
It's still the same for the run_FABulous_bitstream command. Each CLI, TCL or FS does not break execution properly in case of an Error. |
The error handling seems to work now! But it seems, that broke the force mode, which now seems to also exits on errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR!
Looks like everything is working fine now.
I've added a few minor comments, if these are fixed, we can merge that PR. :)
ca4ee2a
into
FPGA-Research:FABulous2.0-development
Introduce a force mode to allow commands to run despite errors, and enhance exception handling by overriding the onecmd method to catch exceptions properly.
Adjust the debug log level to only display debug logs when the debug flag is set.
add the
-p
option for pass cmd directly into the CLI.Add tests for the start-up script.
Make the existing test pytest discoverable.