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

Fix #629, Define BSP type in sample config #630

Closed
wants to merge 1 commit into from

Conversation

skliper
Copy link
Contributor

@skliper skliper commented Apr 21, 2020

Describe the contribution
Update of OSAL_SYSTEM_BSPNAME to OSAL_SYSTEM_BSPTYPE in sample toolchains.
Fix #629

Testing performed
Steps taken to test the contribution:

  1. Readme build steps

Expected behavior changes
Builds out of the box with sample config

System(s) tested on

  • Hardware: cFS Dev Server 3
  • OS: Ubuntu 18.04
  • Versions: Master bundle + this commit

Additional context
None

Third party code
None

Contributor Info - All information REQUIRED for consideration of pull request
Jacob Hageman - NASA/GSFC

@skliper skliper requested a review from jphickey April 21, 2020 14:40
@skliper
Copy link
Contributor Author

skliper commented Apr 21, 2020

Priority request @astrogeco @jphickey, master is currently broken. Consider for fasttrack.

@skliper
Copy link
Contributor Author

skliper commented Apr 21, 2020

@dmknutsen - ping... to address the issue you identified

@skliper skliper added bug CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Apr 21, 2020
@skliper skliper added this to the 6.8.0 milestone Apr 21, 2020
Copy link
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to the "toolchain-cpuX" files are probably all that is needed here.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is important for the SIMULATION=native mode to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be improved such that it only overwrites what isn't supplied? Seems like overriding all three settings when one isn't supplied isn't very friendly to user configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only sets it if not already set and not crosscompiling. It shouldn't overwrite anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way, I'll take out. Seems like it would make sense to just default what isn't defined, vs set all three if one of the two is missing. Not very friendly/intuitive from my perspective. If I supply something, I'd expect it to be used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of this dates back that in previous CFE builds (before recent merges) only CFE_SYSTEM_PSPNAME and OSAL_SYSTEM_OSTYPE was required. That's why this "if" statement is only checking that those two are defined. The OSAL build later confirms that OSAL_SYSTEM_BSPTYPE and OSAL_SYSTEM_OSTYPE are defined (that's the error observed in #629).

It is true that it doesn't handle some but not all being specified but most of the time that's an error anyway, because there is not a default for cross compile. And for non-cross (native) there is only one right answer anyway which is pc-linux/posix.

I would propose rather than fixing that -- the whole thing could be generally simplified a bit -- we really should only need to specify a PSP type. We can't mix and match BSP/PSPs and OSs - although an OS can have more than one possible BSP/PSP, the reverse isn't true - each PSP is written for a specific OS. So by specifying a PSP that in turn can dictate what OS layer to compile, so the toolchain only needs to specify the PSP to use and everything else should fall from that.

But the "default" in arch_build.cmake still needs to be there, to handle the case where not crosscompiling and just building for the host machine, though. In this case no toolchain file is used and therefore these variables will be unset (rightfully).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm all for simplification, and definitely support a default. It was only the override I had concerns with, and that it looked to need a refresh based on the recent changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted #632. Looking at the code this might be fairly trivial/easy to do.

@jphickey
Copy link
Contributor

Also for process improvement -- why wasn't an issue like this caught by the CI? I personally don't usually test with "toolchain-cpu1.cmake" cross compile - I either build with SIMULATION=native or cross compile for either RTEMS or VxWorks

@skliper
Copy link
Contributor Author

skliper commented Apr 21, 2020

CI doesn't do a plain "make prep". Certainly open to improving it.

@jphickey
Copy link
Contributor

Also worth noting that the implicit use of a name-based toolchain-<cpuname>.cmake file was a backward compatibility hack to begin with -- I'd rather one specified the TGTx_SYSTEM variable instead and explicitly specified the toolchain to use for cross compile.

@skliper
Copy link
Contributor Author

skliper commented Apr 21, 2020

Removed arch_build change, note also submitted #633 to address toolchain hack.

@skliper
Copy link
Contributor Author

skliper commented Apr 21, 2020

#634 is a better solution, closing this as duplicate

@skliper skliper closed this Apr 21, 2020
@skliper skliper added duplicate and removed bug CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Apr 21, 2020
@jphickey
Copy link
Contributor

Maybe still worth discussing - not closing this entirely --

It is still incorrect that these example toolchain-cpu<x>.cmake files are setting a OSAL_SYSTEM_BSPNAME which is incorrect and not actually used anywhere.

If we go with the #634 proposal then then we should remove these lines entirely.

@skliper
Copy link
Contributor Author

skliper commented Apr 21, 2020

I vote for remove entirely w/ #634.

@skliper skliper reopened this Apr 22, 2020
@skliper skliper added bug CCB:Ready Ready for discussion at the Configuration Control Board (CCB) duplicate and removed duplicate bug CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Apr 22, 2020
@skliper skliper closed this Apr 22, 2020
@astrogeco
Copy link
Contributor

CCB 20200422 - Will close this PR and delete lines in cfe PR #634

@skliper skliper deleted the fix629-broken-config branch May 29, 2020 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make prep broken out of the box
3 participants