-
Notifications
You must be signed in to change notification settings - Fork 17.2k
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
AP_Scripting: no warning if no ./scripts and no real filesystem #28012
AP_Scripting: no warning if no ./scripts and no real filesystem #28012
Conversation
it is possible to build for boards without storage (so no Posix, no Fatafs), but still have scripts in ROMFS. In this case we will use the backend AP_Filesystem_backend base class when doing file operations. This will alway fail to open directories, so when we try to load scripts from SCRIPTS_DIRECTORY it will always fail. This leads to a warning being emitted: Lua: State memory usage: 2796 + 5227 AP: Lua: open directory (./scripts) failed AP: hello, world Time has wrapped Which isn't great. Detect we are working on this filesystem and don't warn.
109676b
to
b686722
Compare
My testing was done on SDMODELH7v1 with this hwdef modification:
|
The advantage of the define approach is that we can error out at compile time if someone has scripting turned on and no way to load a script. |
That could/should be done as a separate check. I think it would be something like this:
I've no idea where that might live, however. Perhaps at the top of the file I'm modifying in here? The reason I think these are separate things is that the user might be pointing |
We a check in config.h already, I think it would have to be updated as you sugest.
|
|
it is possible to build for boards without storage (so no Posix, no Fatafs), but still have scripts in ROMFS.
In this case we will use the backend AP_Filesystem_backend base class when doing file operations. This will alway fail to open directories, so when we try to load scripts from SCRIPTS_DIRECTORY it will always fail.
This leads to a warning being emitted:
Lua: State memory usage: 2796 + 5227
AP: Lua: open directory (./scripts) failed
AP: hello, world
Time has wrapped
Which isn't great.
Detect we are working on this filesystem and don't warn.
Alternative to https://github.com/ArduPilot/ardupilot/pull/27404/files
I've tested this on CubeOrange - warning is still emitted there (even if you're running scripts out of ROMFS already!)