toolkit: validate arguments *after* modification is complete#7
toolkit: validate arguments *after* modification is complete#7iabdalkader merged 1 commit intomicropython:work-v1.104.0from tinyvision-ai-inc:pr-fix-path-validation
Conversation
|
Whoa I'm surprised to see you here!
It's fine, improvements to the tools are welcome! How are you liking the tools so far? Are going in the right direction? |
I like MicroPython. :) Small world!
The ideal direction really! |
|
Thanks for the contribution! But, would it be simpler to just adjust --- a/toolkit/bin/application_package.ds
+++ b/toolkit/bin/application_package.ds
@@ -1,4 +1,4 @@
-set semihosting args ../build/AppTocPackage.bin 0x8057bf50
+set semihosting args build/AppTocPackage.bin 0x8057bf50^M
continue
wait
reset reset.hardware? |
|
Actually, your fix is correct, the code should definitely validate the paths after modifying them. But, IMO the modification to strip out |
Agreed. I aimed for lightest modification to the tools assuming new releases coming, should I try again by performing a bit more rework? |
Yes, that makes a lot of sense, that's also the approach we took. But, I think in this case, removing the code that strips out
Yes please! |
|
First an extra commit to illustrate the various locations where the It seems like the AlifSemi team prefers The long-term solution might be to use a Below just the fix discussed: |
The configuration file bin/application_package.ds was using a relative path, which had to be stripped away from every other location. This removes the "../" from both the configuration file and the "app-write-mrap.py" script Signed-off-by: Josuah Demangeon <me@josuah.net>
dpgeorge
left a comment
There was a problem hiding this comment.
Looks good, thanks for updating!
I tested it on a board, deploying the firmware, and it still works like it did before this PR.
The current toolkit modifies path on MacOS and Linux platforms. Perform this validation only after the path is modified to allow the script to be run on Linux and MacOSX without error.
Before:
After:
P.S.: Since we I benefit from this repo I try to contribute back... but we can silently maintain our own fork to avoid burdening MicroPython with extra Alif maintenance work.