Skip to content
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

POSIX subsys: Need more fine-grained enable options #12965

Closed
pfalcon opened this issue Feb 1, 2019 · 1 comment · Fixed by #18780
Closed

POSIX subsys: Need more fine-grained enable options #12965

pfalcon opened this issue Feb 1, 2019 · 1 comment · Fixed by #18780
Assignees
Labels
area: POSIX POSIX API Library Enhancement Changes/Updates/Additions to existing features

Comments

@pfalcon
Copy link
Contributor

pfalcon commented Feb 1, 2019

Currently, we have a "master switch" of CONFIG_POSIX_API which enables a lot of POSIX subsys functionality at once, and just a few sub-options to control some areas (Pthreads, etc.).

One of things which CONFIG_POSIX_API does it automatically adds headers under includes/posix/ to the include paths. Unfortunately, how they're implemented now is very fragile, and making any step further than the current tests (we don't even have POSIX samples!) go, leads to header/symbold conflicts and build errors. That's a separate matter (I'll post another ticket on that), and resolving that would likely take more time.

What I would like to do with scope of this ticket is:

  1. Add separate option to control inclusion of POSIX headers.
  2. Add options for things which are currently automatically enabled by CONFIG_POSIX_API: clock_gettime(), etc.
  3. Then keep the current definition of CONFIG_POSIX_API, by making it select all the finer-grained options.

The purpose of these changes is to allow to gradual porting of applications. E.g., if an app needs just clock_gettime(), I should be able to pull in just that, instead of the whole POSIX subsystem, which is, again, likely will lead to header/symbol conflicts.

@pfalcon pfalcon added Enhancement Changes/Updates/Additions to existing features area: POSIX POSIX API Library labels Feb 1, 2019
@pfalcon
Copy link
Contributor Author

pfalcon commented Feb 1, 2019

@nashif, @galak, @ramakrishnapallala, @nniranjhana: FYI

This comes from experience in porting https://github.com/open62541/open62541 to Zephyr (which is a Linaro project to try and see how far we're along the "take an existing 3rd-party lib and just run it with Zephyr" approach).

cc'ing you so there was a place to discuss details if needed, and these changes didn't come as a surprise (because for me some recent changes related to POSIX subsys were a surprise).

@pfalcon pfalcon self-assigned this Feb 1, 2019
pfalcon added a commit to pfalcon/zephyr that referenced this issue Feb 22, 2019
Basic requirements:
1. It should be possible to control whether include/posix/ is
added to include search path or not.
2. It should be possible to use individual parts of POSIX API,
without bringing in everything else. For example, if user is
interested in just sleep(), should be possible to enable just
that.
3. Keep existing CONFIG_POSIX_API as "master switch", which
enables "a lot of POSIX APIs".

Fixes: zephyrproject-rtos#12965

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
pfalcon added a commit to pfalcon/zephyr that referenced this issue May 28, 2019
Basic requirements:
1. It should be possible to control whether include/posix/ is
added to include search path or not.
2. It should be possible to use individual parts of POSIX API,
without bringing in everything else. For example, if user is
interested in just sleep(), should be possible to enable just
that.
3. Keep existing CONFIG_POSIX_API as "master switch", which
enables "a lot of POSIX APIs".

Fixes: zephyrproject-rtos#12965

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
pfalcon added a commit to pfalcon/zephyr that referenced this issue Sep 3, 2019
Allow to enable individual POSIX components, like Pthreads.
CONFIG_POSIX_API now just enables all of individual POSIX components,
and sets up environment suitable to easily port POSIX applications to
Zephyr.

Fixes: zephyrproject-rtos#12965

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
pfalcon added a commit to pfalcon/zephyr that referenced this issue Sep 11, 2019
Allow to enable individual POSIX components, like Pthreads.
CONFIG_POSIX_API now just enables all of individual POSIX components,
and sets up environment suitable to easily port POSIX applications to
Zephyr.

Fixes: zephyrproject-rtos#12965

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
galak pushed a commit that referenced this issue Sep 26, 2019
Allow to enable individual POSIX components, like Pthreads.
CONFIG_POSIX_API now just enables all of individual POSIX components,
and sets up environment suitable to easily port POSIX applications to
Zephyr.

Fixes: #12965

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library Enhancement Changes/Updates/Additions to existing features
Projects
None yet
1 participant