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

make prep broken out of the box #629

Closed
skliper opened this issue Apr 21, 2020 · 3 comments · Fixed by #634
Closed

make prep broken out of the box #629

skliper opened this issue Apr 21, 2020 · 3 comments · Fixed by #634
Assignees
Labels
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Apr 21, 2020

Describe the bug
Prep fails out of the box when following README instructions:

-- Configuring for system arch: cpu1
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- OMIT_DEPRECATED=false: Deprecated elements included in build
Error: "" is not a valid BSP type
CMake Error at /export/home/jhageman/cFS/cFS-GitHub/osal/CMakeLists.txt:66 (message):
  OSAL_SYSTEM_BSPTYPE must be set to the appropriate BSP

To Reproduce
Steps to reproduce the behavior:

  1. Follow the README instructions, make prep fails.

Expected behavior
Expected it to default to pc-linux as in the past.

Code snips
The following does not set OSAL_SYSTEM_BSPTYPE since CFE_SYSTEM_PSPNAME and OSAL_SYSTEM_OSTYPE is defined...

cFE/cmake/arch_build.cmake

Lines 275 to 289 in 0648a47

# Check that PSPNAME, BSPTYPE, and OSTYPE are set properly for this arch
if (NOT CFE_SYSTEM_PSPNAME OR NOT OSAL_SYSTEM_OSTYPE)
if (CMAKE_CROSSCOMPILING)
message(FATAL_ERROR "Cross-compile toolchain ${CMAKE_TOOLCHAIN_FILE} must define CFE_SYSTEM_PSPNAME and OSAL_SYSTEM_OSTYPE")
elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR
"${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
# Export the variables determined here up to the parent scope
SET(CFE_SYSTEM_PSPNAME "pc-linux" PARENT_SCOPE)
SET(OSAL_SYSTEM_BSPTYPE "pc-linux" PARENT_SCOPE)
SET(OSAL_SYSTEM_OSTYPE "posix" PARENT_SCOPE)
else ()
# Not cross compiling and host system is not recognized
message(FATAL_ERROR "Do not know how to set CFE_SYSTEM_PSPNAME and OSAL_SYSTEM_OSTYPE on ${CMAKE_SYSTEM_NAME} system")
endif()
endif (NOT CFE_SYSTEM_PSPNAME OR NOT OSAL_SYSTEM_OSTYPE)

System observed on:

  • Hardware: cFS Dev Server
  • OS: Ubuntu 18.04
  • Versions: master bundle

Additional context
Short term work around - pass in SIMULATION=native at prep, or likely can define the target system in targets.cmake (2nd approach not tested yet)

Reporter Info
Jacob Hageman - NASA/GSFC

@skliper skliper added the bug label Apr 21, 2020
@skliper skliper added this to the 6.8.0 milestone Apr 21, 2020
@skliper
Copy link
Contributor Author

skliper commented Apr 21, 2020

Looks like the sample toolchains set OSAL_SYSTEM_BSPNAME, not OSAL_SYSTEM_BSPTYPE. I don't really follow the logic for the "guess" in arch_build.cmake. Seems like it would be safer just to error if any of the three aren't defined, otherwise it may overwrite customization set in the toolchain file (require all 3 to be defined, don't overwrite from deep in the build if 1 is missing).

@stanislaw
Copy link
Contributor

I had this today too:

Was anything renamed recently?

--- a/sample_defs/toolchain-cpu1.cmake
+++ b/sample_defs/toolchain-cpu1.cmake
@@ -20,6 +20,6 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE   NEVER)
 # These variable settings are specific to cFE/OSAL and determines which
 # abstraction layers are built when using this toolchain
 SET(CFE_SYSTEM_PSPNAME      "pc-linux")
-SET(OSAL_SYSTEM_BSPNAME     "pc-linux")
+SET(OSAL_SYSTEM_BSPTYPE     "pc-linux")
 SET(OSAL_SYSTEM_OSTYPE      "posix")

skliper added a commit to skliper/cFE that referenced this issue Apr 21, 2020
Also removes overwrite of CFE_SYSTEM_PSPNAME,
OSAL_SYTEM_BSPTYPE, OSAL_SYSTEM_OSTYPE if one
is missing from arch_build.cmake.
@jphickey
Copy link
Contributor

The difference is that in the current master branch OSAL_SYSTEM_BSPTYPE is required to be specified, whereas before it was ignored and only CFE_SYSTEM_PSPNAME was used. Now the PSP and OSAL BSP are used together so they are both required. The mismatch/typo in the example toolchain-cpuX.cmake has existed for a long time but it never mattered until now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants