-
Notifications
You must be signed in to change notification settings - Fork 215
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
Fix #261, #312, and #362, OSAL build cleanup (multiple issues) #404
Fix #261, #312, and #362, OSAL build cleanup (multiple issues) #404
Conversation
@@ -1505,4 +1505,59 @@ void OS_printf_disable(void); | |||
void OS_printf_enable(void); | |||
/**@}*/ | |||
|
|||
|
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.
Curious on thoughts about these in osapi-os-core.h. I'd think they'd be candidates for a separate or different header.
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.
Yes, these could be split into a separate header file.
Note that OSAL is "caching" the value from the BSP here, so the API really is still an OSAL API, not a BSP API. The BSP sets the cache when it boots and the API just reads it and returns it to the app. I was hoping to avoid having an actual BSP API - the goal should be to hide the BSP details as much as we can, not expose it.
FWIW, we should also consider making the inc
directory structure more like other modules where we have the public API in fsw/inc
and the source in fsw/src
, rather than src/os/inc
where OSAL has it right now. That would be a follow-on change but this may actually make it easier by removing at least some build system references to osal/src/os/inc
.
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.
Thanks, that background helps... historically I've broken includes into smaller "topics" to limit conceptual impact of changes, but I realize OSAL has an established pattern. It has paid off for me in relation to review panels and operational software support processes.
I think cFS 7.0 is due a major directory restructure... very interested in an in-depth design/review CCB discussion on the topic.
CCB 20200408 - Concept approved. @acudmore will review by April 13 2020 |
This is a nice clean up. I like the layering of the OSAL BSP with PSP. Something I have been thinking about for a while but did not quite know how to tackle.
|
Do not clobber the CMAKE_C_FLAGS value as part of the OSAL build. Instead, use target_compile_options and target_include_directories as needed to set the compile options for specific targets. This also creates a separate CMakeLists.txt file for each OS/BSP implementation library rather than using aux_source_directory. Each implementation-specific build can then set any additional options as required for that platform. Note that any entity needing to compile/link with OSAL should now obtain the requisite compile flags and directories by querying the INTERFACE_COMPILE_DEFINITIONS and INTERFACE_INCLUDE_DIRECTORIES properties on the osal library target.
Refactor the OSAL BSP code so that a single BSP implementation can work for both normal applications as well as unit tests. This intoduces a new bsp implementation abstraction layer akin to the low level OS implementation layer. This handles dealing with bootloader/command line arguments, and debug console manipluation.
Build the full suite of OSAL coverage tests as part of the normal build when ENABLE_UNIT_TESTS is true. This will use the same target OSAL BSP to execute the tests as is used for the FSW.
0c0c06c
to
befa665
Compare
Force-push: rebased to current master branch |
Yes, I suppose it could be... I guess I didn't see the point in splitting those off to a separate file, because they are somewhat fixed and always used. Where the "impl" stuff has one subdirectory selected out of several choices, the "shared" stuff is always built in the same way from the same set, so splitting it into a separate subdirectory just meant yet another file to look at.
Yes, pretty much. an OBJECT library is just a collection of .o files, which are then brought into into the static lib (.a) using TARGET_OBJECTS expression. I had at one point done everything as .a files but ended up with some order-of-library dependency issues for the final link. This "object" approach yields fewer different .a files and less issues. The main thing to note with OBJECT is that it was added to CMake around 2.8.8, which was an issue for RHEL5 which only shipped 2.6.4. But now that's finally EOL, so RHEL6 is probably the most-ancient tool version used in production, which has 2.8.12, so it should be fine.
Not exactly, they'll be referenced from the other three implementations in the spots where they are relevant, similar to the way they |
@acudmore how do you feel about @jphickey's reply? |
Pushed a fix to resolve coverage test failures introduced by #387, recommending fasttrack |
Still failing bundle CI, specifically for BUILDTYPE=release, https://travis-ci.com/github/skliper/cFS/builds/160109318 /home/travis/build/skliper/cFS/osal/src/bsp/pc-linux/src/bsp_console.c: In function ‘OS_BSP_ConsoleOutput_Impl’: |
This ensures that the return value of the write() call is checked, and avoids a potential compiler warning. There is still no recourse if the write call fails, but it can retry if it was short.
Passes now, with https://travis-ci.com/github/skliper/cFS/builds/160232404 which includes nasa/cFE#585, and nasa/PSP#149 |
Jumped the gun... Coverage report no longer includes cFE coverage analysis, and report is misleading for osal since it includes the unit-test-coverage code statistics. Also actual coverage looks questionable, since not all files included by vxworks look like they are being analyzed. |
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.
Need to fix coverage reporting
No change required here, just requires changes in cFE to maintain functionality
See nasa/cFE#613..... As the apps now also share this pattern, it might be worth providing a cmake function to build and link a UT. The alternative might be to just continue setting |
Avoids calling write() if length is zero.
FYI - additional commit added to fixup the previous fixup, I realized it should have a check for DataLen>0 in the loop. (with a conforming "write()" it should work either way, but this is better). |
These changes are OK with me.. I did not mean to hold anything up, my questions were more for my knowledge. |
Describe the contribution
General cleanup and rework of the OSAL build scripts. Fixes several issues:
Fixes #312
Fixes #261
Fixes #362
Fixes #363
These are combined into a single pull request as they each depend on the previous fix - they cannot be easily isolated into separate pull requests. However, each specific issue fix is still an individual commit for review.
Summary of changes:
CMAKE_C_FLAGS
variable, instead use the preferred approach of using thetarget_include_directories
andtarget_compile_definitions
functions from CMake to manage the build flags per target.Testing performed
Expected behavior changes
System(s) tested on
Additional context
VxWorks testing limited to building only at this point. Runtime tests pending on MCP750 hardware availability.
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.