Skip to content

[RFC] Missing parts of libc required for CivetWeb #16683

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

Closed
PiotrZierhoffer opened this issue Jun 7, 2019 · 10 comments
Closed

[RFC] Missing parts of libc required for CivetWeb #16683

PiotrZierhoffer opened this issue Jun 7, 2019 · 10 comments
Labels
area: C Library C Standard Library area: Networking area: POSIX POSIX API Library RFC Request For Comments: want input from the community

Comments

@PiotrZierhoffer
Copy link
Collaborator

PiotrZierhoffer commented Jun 7, 2019

Introduction

This issue is created as prompted by the discussion on the Networking Forum.

We are working on implementing support for CivetWeb HTTP library (https://github.com/civetweb/civetweb), but it requires improvements in the libc layer. It's a good example of an external project using sockets APIs that should be relatively easy to integrate with Zephyr, as a proof of concept.

Problem description

CivetWeb uses different POSIX API calls, as any application or library runnable on Linux.

Using Newlib is not an option due to heavy conflicts with the POSIX layer (see #13787).

Improving minimal-libc requires some consideration to maintain compatibility with other layers.

Here we list features missing from minimal-libc that would be required for CivetWeb to work.

Detailed RFC

Here is the list of functions that are used by CivetWeb, with pull requests were applicable.
For some we will prepare stub implementations that will be enough to get the library to work.

Dependencies

This is relevant to the POSIX and libc layers. Also time Infrastructure is affected.

CC: @pfalcon @nashif @rakons @andrewboie @jukkar @laperie @tgorochowik

Concerns and Unresolved Questions

The main purpose of minimal-libc is to be, well, minimal. Further work should preserve this approach.

Time related functions rely on a concept of current time. Right now there is no such thing in Zephyr.

There is a proposal by @pfalcon we were about to follow, using the work he submitted via #15602

Current status

As suggested by @nashif (see #16451), we will now proceed with including relevant functions in the sample itself.

@PiotrZierhoffer PiotrZierhoffer added the RFC Request For Comments: want input from the community label Jun 7, 2019
@andrewboie
Copy link
Contributor

Using Newlib is not an option due to heavy conflicts with the POSIX layer (see #13787).

To me this seems like what we should be spending effort on fixing.

@pfalcon
Copy link
Collaborator

pfalcon commented Jun 7, 2019

Using Newlib is not an option due to heavy conflicts with the POSIX layer (see #13787).

To me this seems like what we should be spending effort on fixing.

Not only that, but the quoted issue, #13787, was made to draw attention to the problem, and gather interested parties to brainstorm and solve the issue. Not to provide interested parties with excuses for not doing that ;-).

@PiotrZierhoffer
Copy link
Collaborator Author

PiotrZierhoffer commented Jun 7, 2019

No excuses here, we'd love to see newlib and posix support to be top notch :)

And I think we discussed that already on the networking forum and there is an agreement in that matter. It doesn't mean though that this is the first step we should do, or can do, to keep the topic active.

@laperie asked me to create this issue to keep track of things. I added you to CC because we discussed these topics earlier.

@pfalcon
Copy link
Collaborator

pfalcon commented Jun 7, 2019

create this issue to keep track of things. I added you to CC because we discussed these topics earlier.

This is absolutely great that you posted this ticket and also RFC on the mainling list! The same should have been be done regarding CivetWeb (for as long as that effort is supposed to influence Zephyr back, and not just independent porting effort).

However, please kindly accept the possibility to receive criticism as a result of posting this RFC - that's done both for common good, and to potentially save your own efforts from going in the wrong direction.

@pfalcon
Copy link
Collaborator

pfalcon commented Jun 7, 2019

And I think we discussed that already on the networking forum

I find that discussion such insightful that I decided to put off other tasks assigned to me and cleaned up and flushed a number of patches I had in my queue:

I didn't lie however that POSIX/Newlib issues isn't going to be fixed, unless people will contribute to that fixing. It can be as small as testing and voting up, but it has to be there. For example, my patches above turn into the usual bikeshed playground (and I see the same happening with @tgorochowik's and @PiotrZierhoffer's patches). Again, there should be active interest to get that into working state, and common approach and understanding, or it will be drown in Zephyr's ever-growing patch well.

@PiotrZierhoffer
Copy link
Collaborator Author

@pfalcon, by all means, your insight and comments are always very welcome!

@pfalcon
Copy link
Collaborator

pfalcon commented Jun 8, 2019

This is absolutely great that you posted this ticket and also RFC on the mainling list!

Oops, multitasking too much. I saw a github notification in email, and my mind tricked me into seeing the desirable - that it was also posted on the Zephyr "devel" mailing list. Well, I'd suggest to do that anyway, even if a quick link to this ticket. Doing so helps the much wider audience to stay in loop on Zephyr's developments and progress. And as pointed several times already, gathering critical mass is a muss for such projects. Thanks in advance.

@PiotrZierhoffer
Copy link
Collaborator Author

@pfalcon , yeah, about multitasking - I missed your message, sorry for that. I will post to devel at once.

@pfalcon
Copy link
Collaborator

pfalcon commented Jul 19, 2019

@PiotrZierhoffer:

@pfalcon , yeah, about multitasking - I missed your message, sorry for that. I will post to devel at once.

Many thanks for posting, and sorry for lack of reply from my side - company sprint, followed by vacation. That's definitely helpful, as we clearly have different parties interested in this matter, while not aware of the current state of affairs, so any publicity efforts like that are required, even if seemingly don't lead to immediate responses.

I, from my side, have been working on "POSIX subsys maintenance approach RFC" which I promised, and I hope to post it shortly (definitely before going for another vacation streak by the end of next week).

@gmarull
Copy link
Member

gmarull commented Aug 11, 2022

civetweb is no longer a module, closing

@gmarull gmarull closed this as completed Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: C Library C Standard Library area: Networking area: POSIX POSIX API Library RFC Request For Comments: want input from the community
Projects
None yet
Development

No branches or pull requests

5 participants