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

Replace #include of c files with build system source selection #285

Closed
skliper opened this issue Nov 8, 2019 · 3 comments · Fixed by #443 or #444
Closed

Replace #include of c files with build system source selection #285

skliper opened this issue Nov 8, 2019 · 3 comments · Fixed by #443 or #444
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Nov 8, 2019

Is your feature request related to a problem? Please describe.
#include of a c file is not acceptable flight coding style for some organizations and complicates formal verification processes

Describe the solution you'd like
Source selection should be done via build system

Describe alternatives you've considered
None.

Additional context
None.

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the 5.1.0 milestone Nov 30, 2019
@skliper
Copy link
Contributor Author

skliper commented Dec 22, 2019

Moved from #327

osal/src/os/posix/osfileapi.c

*/
--
81 | #include "../portable/os-impl-posix-io.c"
  | The #include pre-processor directive should only be used to include header files.

*/
88 | #include "../portable/os-impl-posix-files.c"
  | The #include pre-processor directive should only be used to include header files.
89


*/
--
95 | #include "../portable/os-impl-posix-dirs.c"
  | The #include pre-processor directive should only be used to include header files.

posix/osapi.c:

/* use the portable version of OS_ConsoleWrite_Impl() */
--
2411 | #include "../portable/os-impl-console-directwrite.c"
  | The #include pre-processor directive should only be used to include header files.

posix/osloader.c

*/
--
32 | #include "../portable/os-impl-posix-dl.c"
  | The #include pre-processor directive should only be used to include header files.

posix/osnetwork.c

*/
--
58 | #include "../portable/os-impl-bsd-sockets.c"
  | The #include pre-processor directive should only be used to include header files.

posix/osselect.c

/* Leverage the portable UNIX-style Select API for POSIX */
--
35 | #include "../portable/os-impl-bsd-select.c"
  | The #include pre-processor directive should only be used to include header files.

posix/ostimer.c

/* POSIX implements clock_gettime and clock_settime that can be used */
--
566 | #include "../portable/os-impl-posix-gettime.c"
  | The #include pre-processor directive should only be used to include header files.

@jphickey jphickey self-assigned this Feb 13, 2020
@jphickey
Copy link
Contributor

A "work in progress" concept is pushed to my osal fork, for review and discussion:

See: https://github.com/jphickey/osal/tree/jph-wip-fix-285-includes

@skliper
Copy link
Contributor Author

skliper commented Apr 15, 2020

High priority change, submit the pull request on top of other pending merges if you have to.

jphickey added a commit to jphickey/osal that referenced this issue Apr 20, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit to jphickey/osal that referenced this issue Apr 20, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit to jphickey/osal that referenced this issue Apr 20, 2020
@jphickey jphickey linked a pull request Apr 20, 2020 that will close this issue
jphickey added a commit to jphickey/osal that referenced this issue Apr 20, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit to jphickey/osal that referenced this issue Apr 20, 2020
jphickey added a commit to jphickey/osal that referenced this issue Apr 20, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit to jphickey/osal that referenced this issue Apr 20, 2020
jphickey added a commit to jphickey/osal that referenced this issue Apr 21, 2020
jphickey added a commit to jphickey/osal that referenced this issue Apr 21, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit to jphickey/osal that referenced this issue Apr 21, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit to jphickey/osal that referenced this issue Apr 29, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit that referenced this issue Apr 29, 2020
Fix #285, Refactor OSAL to avoid inclusion of C files
Manually merged to address merge conflicts
astrogeco pushed a commit that referenced this issue Apr 29, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
astrogeco pushed a commit that referenced this issue Apr 29, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
astrogeco pushed a commit that referenced this issue Apr 29, 2020
jphickey added a commit that referenced this issue Apr 30, 2020
Fix #285, Refactor OSAL to avoid inclusion of C files
Manually merged to address merge conflicts
jphickey added a commit to jphickey/osal that referenced this issue Apr 30, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit that referenced this issue Apr 30, 2020
Fix #285, Refactor OSAL to avoid inclusion of C files
Manually merged to address merge conflicts
jphickey added a commit to jphickey/osal that referenced this issue Apr 30, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit that referenced this issue Apr 30, 2020
Fix #285, Refactor OSAL to avoid inclusion of C files
Manually merged to address merge conflicts
jphickey added a commit to jphickey/osal that referenced this issue Apr 30, 2020
Fix nasa#285, Refactor OSAL to avoid inclusion of C files
Manually merged to address merge conflicts
jphickey added a commit to jphickey/osal that referenced this issue May 4, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit to jphickey/osal that referenced this issue May 4, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit to jphickey/osal that referenced this issue May 4, 2020
Use separate source files and CMake-based source selection
based on feature configuration, rather than using the C
preprocessor for including/excluding different OSAL function
groups.

Refactor all implementation units to provide a separate header
file for each functional group/subsystem.  Remove "static"
declaration on internal helper functions so they can be invoked
from unit test.
jphickey added a commit to jphickey/osal that referenced this issue May 4, 2020
Use separate source files and CMake-based source selection
to configure OSAL features, rather than using the C preprocessor.

All implementation units now provide a separate header
file for each functional group/subsystem.

This commit covers the OSAL main FSW code and particularly the
"portable" implementation blocks to follow this model.  Includes
minor updates to UT stubs due to header file changes.
jphickey added a commit to jphickey/osal that referenced this issue May 4, 2020
Use separate source files and CMake-based source selection
to configure OSAL features, rather than using the C preprocessor.

This commit covers the OSAL coverage test.  This had been using
inclusion of a C file to allow access to static functions/variables.
This updates all UT code to correspond with the FSW code changes.
All "static" helper functions become non-static so unit test can
invoke directly.  Prototype is in a private header, so
the functions are still not exposed in the API.
jphickey added a commit to jphickey/osal that referenced this issue May 4, 2020
Permissive mode is required for testing on POSIX when
running as a normal (non-root) user.
jphickey added a commit to jphickey/osal that referenced this issue May 4, 2020
Permissive mode is required for testing on POSIX when
running as a normal (non-root) user.
astrogeco added a commit that referenced this issue May 4, 2020
Fix #285, Refactor OSAL to avoid inclusion of C files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment