-
Notifications
You must be signed in to change notification settings - Fork 681
netutils: Add BARE #3362
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
base: master
Are you sure you want to change the base?
netutils: Add BARE #3362
Conversation
|
@ghnotgood necessary to add to Kconfig
https://git.sr.ht/~fsx/cbare/tree/main/item/LICENSE as for cwebsocket https://github.com/apache/nuttx-apps/blob/master/netutils/cwebsocket/Kconfig |
acassis
left a comment
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.
@ghnotgood please include a Documentation about it into nuttx/Documentation/
|
@simbit18 thanks, I have updated the PR. |
|
@acassis the PR is already here apache/nuttx#18082 let me know if I need to write more. Thanks. |
Sorry, I missed that there! I just commented there |
|
@simbit18 About that MIT license... I did that but I don't know why? MIT should be ok to use for whatever when the MIT license file stays with the source code. The patch does not remove the LICENSE and therefore it should be ok. Moreover, other applications, like NNG, use MIT license but do not depend on it. |
|
I found apache/nuttx#8326 but I don't understand what can go wrong when MIT-licensed code is included in NuttX. Can anyone elaborate? |
|
@ghnotgood You need to be aware of the licences used; the same applies to BSD, GPL/LGPL, Eclipse Public Licences, etc. |
|
@simbit18 why you need that? or... to maybe ask better... what bad happens when |
@ghnotgood if the user don't enable CONFIG_ALLOW_MIT_COMPONENTS then the BARE will now show up and will not be compiled. It protects users that want to have final firmware only containing Apache code (for patent protections, etc) |
|
@acassis so you are saying that when developer builds NuttX with MIT-licensed code the resulting firmware looses patent protections of Apache license? |
no, but imagine if someone added MIT code that has a patent hidden behind it (sometimes they don't tell you), if that code is attached to NuttX and the firmware firmware has it, the Apache "protection" was lost! |
|
Thank you, I understand now. So the problem is MIT-licensed code implementing patent-protected ideas. I did a bit of parsing to find out the state of Apache protection in |
|
@ghnotgood Thank you for pointing this out. The licence must be added where necessary. |
|
license should also be added to the LICENSE file |
|
In any case, you never get bored on NuttX! :) |
BARE is a simple binary representation for structured application data. cbare, the BARE implementation ported by this commit, is an I/O agnostic C implementation of the BARE message encoding. Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
|
@raiden00pl I have updated the |
Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
|
Good work @ghnotgood, some observations/questions:
I think we need to implement some kind of LICENSE tracking, like I suggested in apache/nuttx#8326 Something like this: Or maybe something even better, like a license map to know which program/library added that license, for easy tracking: But this option could be disabled for deep embedded microcontrollers, to avoid wasting flash memory (also the license_str don't need to be included for each line, it could be resolved from license_bit). @ghnotgood @simbit18 @raiden00pl @xiaoxiang781216 what do you think? I can implement it if all here agree that this license tracking is important. Currenly our only alternative is searching for "SPDX-License-Identifier:" but it is difficult to know which files where used. Remember: not all files compiled by NuttX are used in the final firmware. |
|
Thank you @ghnotgood, this cbare looks interesting :-) The typo commit should go into a separate PR as it is not related to CBARE and needs commit subject fix right? We may pass it here but subject needs update as noted by ci check :-) |
| +#ifndef UNUSED | ||
| #define UNUSED(x) (void)(x) | ||
| +#endif | ||
|
|
||
| enum { | ||
| U8SZ = 1, | ||
| diff --git i/test/baretest.c w/test/baretest.c | ||
| index 1561f4c..9df740f 100644 | ||
| --- i/test/baretest.c | ||
| +++ w/test/baretest.c | ||
| @@ -10,7 +10,9 @@ | ||
| #include "alloc.h" | ||
| #include "die.h" | ||
|
|
||
| +#ifndef UNUSED | ||
| #define UNUSED(x) (void)(x) | ||
| +#endif |
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.
Since this modification is really small and it will not impact the original project, maybe you can consider submitting a PR to them, then we can remove this .patch later ;-)
|
@acassis I don't see any point in including license information in the firmware. The firmware doesn't care about licence. It's the user's responsibility to properly manage licenses and complete all licensing formal requirements. The licenses used by firmware should be easily accessible from the configuration, and that's how it is now. Licensing options are disabled by defaul so the user must consciously enable non-apach license and they always appear in defconfig. |
True, but in this case we need to do our best to guarantee:
We need to make things explicit to user, because the assumption that licenses are disabled by default is not true because it comes from defconfig and users/companies never pay attention. Remember the case of the drone company that released a PX4 firmware with memory display commands in the firmware? They never paid attention about these commands present in the nsh> until a user used that command to dump their entire proprietary firmware. |
|
@ghnotgood please fix ci check error: |
Summary
BARE 1 is a simple binary representation for structured application data.
cbare 2, the BARE implementation ported by this commit, is an I/O agnostic C implementation of the BARE message encoding.
Impact
Developers can
and then use
cbareAPI to serialize data.Testing
I have built NuttX with and without relevant configuration options enabled
I have run