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 #774, do not generate empty include file #775

Merged

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Jul 9, 2020

Describe the contribution
Detect the condition where no files were present to fulfill an config include file requirement, and report as an error rather than generating an empty file.

Fixes #774

Testing performed
Create a test config that refers to a nonexistent platform config called "foobar" by setting this in targets.cmake:
SET(TGT1_PLATFORM foobar)

Without this change, make prep still (seemingly) completes successfully but the cfe_platform_cfg.h is actually empty, which results in a later compiler error.

Expected behavior changes
After applying this change, the issue is reported as a make prep error instead, along with a list of files it checked for.

Example:

ERROR: No implementation for cfe_platform_cfg.h found
CMake Error at cmake/global_functions.cmake:119 (message):
  Tested:
  /home/joe/code/cfecfs/github/sample_defs/cfe_platform_cfg.h;/home/joe/code/cfecfs/github/sample_defs/foobar_platform_cfg.h
Call Stack (most recent call first):
  fsw/cfe-core/arch_build.cmake:14 (generate_config_includefile)
  cmake/arch_build.cmake:307 (include)
  CMakeLists.txt:119 (prepare)

No FSW changes - just reporting this configuration error.

System(s) tested on
Ubuntu 20.04

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

Report an error if no files are available to fulfill an
include file requirement, rather than leaving an empty file.
@jphickey jphickey changed the base branch from master to integration-candidate July 9, 2020 22:04
@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Jul 9, 2020
@jphickey
Copy link
Contributor Author

jphickey commented Jul 9, 2020

Note to reviewers - this patch is against the current IC. It might be worth a fast track/hotfix?

Not a major issue, but avoids a bit of a head scratcher if/when you mis-configure your targets.cmake file.

@jphickey jphickey marked this pull request as ready for review July 10, 2020 13:15
Copy link
Contributor

@CDKnightNASA CDKnightNASA left a comment

Choose a reason for hiding this comment

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

def have run into this personally and with other new users

@astrogeco astrogeco merged commit 9205e1d into nasa:integration-candidate Jul 15, 2020
@astrogeco astrogeco removed the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Aug 18, 2020
@skliper skliper added this to the 6.8.0 milestone Aug 21, 2020
@jphickey jphickey deleted the fix-774-empty-include-error branch October 14, 2020 03:27
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.

generate_config_includefile should display an error if no files are found at all
4 participants