src: fix PyMain arguments forwarding#2288
Conversation
|
PTAL, signed the commit so that DCO check passes. |
|
-exit handles this case as mentioned in the issue so I see no need for this PR. Do you disagree? |
|
I guess I'm confused because OpenLane doesn't seem to be passing Are you saying that they depends on a buggy behavior? (i.e: the fact that before 47e8b5f#diff-7c2e2869b9670e340a14a2b2ed1cc45a9f85fb8b219a4c1f06fdd467f49375c1L216-L222 |
|
It may have been buggy before but I believe this is the correct behavior. This is how OR works in tcl mode so I would expect it to be the same with -python. |
So would you recommend instead to do a PR against OpenLane to add |
I see for tcl they use run_openroad_script which handles adding -exit. I don't know if that should be adapted to work with python or what you suggest is ok. Best to ask @donn |
|
I see a few other project not passing |
|
Lets' continue the discussion here: |
There was a problem hiding this comment.
Actually without this change, the python scripts wouldn't be able to process any args (since only the .py file would be passed to PyMain).
Is that intentional? (i.e: it was never supposed to be a supported usecase) because OpenLane seems to rely on this behavior quite a bit.
|
As commented in The-OpenROAD-Project/OpenLane#1388 (comment), reopening to continue to discuss this, as I can't seem to find a good way to pass |
|
OR doesn't take script arguments in TCL. It does seem like a nice capability though. If you want to rework this PR to take arguments but still respect the -exit convention (ie without it the tool stays open) I am open to it. |
It did seem that version <47e8b5f#diff-7c2e2869b9670e340a14a2b2ed1cc45a9f85fb8b219a4c1f06fdd467f49375c1L216-L222 supported it, which apparently ended up having OpenLane depend on it. Happy to re-work the PR, but it's unfortunate that OpenLane is broken with |
|
There is a CI problem but it isn't related to the python PR but to sta updates |
|
PTAL, added support for tests🚫 script, 🚫 arguments, 🚫
|
Signed-off-by: Johan Euphrosine <proppy@google.com>
|
rebased, with DCO signature. |
|
Does the order of args matter ? For example: |
|
|
@tspyrou suggested that we add unittest to validate that Most of the tests in https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/test seems to be "design-oriented"; @maliberty is there already some test infrastructure to put up some functional test for the CLI? or should we create one? |
|
Define what a 'functional test' means to you. We have tests in every tool, the top level tests are system level tests. |
I test that would encode the behavior in #2288 (comment) |
|
I don't think we need a whole infrastructure to test command line options. You can make a test like src/drt/test/gc_test.tcl that shells out |
|
Thanks for the reference! By infrastructure I mostly meant some test structure I can copy ;) |
This copy all the arguments, instead of just forwarding
argv[0], reusing the same code that was previously in 47e8b5f#diff-7c2e2869b9670e340a14a2b2ed1cc45a9f85fb8b219a4c1f06fdd467f49375c1L216-L222Fixes: #2287