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

Fix95, CI build multiple targets #758

Conversation

JandlynBentley-at-NASA
Copy link
Contributor

@JandlynBentley-at-NASA JandlynBentley-at-NASA commented Jun 23, 2020

Describe the contribution
Added a CPU2 as a second target to the build configuration to ensure build system is functioning properly with Travis CI for multiple targets.

Also added the following files:

  • cpu2_cfe_es_startup.scr
  • cpu2_platform_cfg.h
  • cpu2_msgids.h

Resolves: cFS bundle's issue 95 nasa/cFS#95

Testing performed
Steps taken to test the contribution:
Went through the build steps from "Build and Run" section of https://github.com/nasa/cFS

Expected behavior changes
Expected to see cpu2 in the exe directory, but it did not appear; still only cpu1 was made for me.
However, this worked for Chris Knight after he cloned cFS and pulled from my fork (cpu1 and cpu2 were made).

System(s) tested on

  • Hardware: Mac OS
  • OS: Ubuntu 18.04 via VirtualBox

Contributor Info - All information REQUIRED for consideration of pull request
Jandlyn Bentley, NASA-GSFC

Jandlyn Bentley added 2 commits June 23, 2020 16:44
Added a second CPU to the build configuration to ensure the build system is functioning properly with Travis CI for multiple targets.

Resolves: nasa#95
After adding the second CPU (by uncommenting CPU2 from targets.cmake), added in necessary scr and header files for cpu2.
Combined, this should make cpu2 in the exe directory.

This build configuration if successful will ensure the build system is functioning properly with Travis CI for multiple targets.

Resolves: nasa#95
@JandlynBentley-at-NASA
Copy link
Contributor Author

In my original commits from git, it looks like it might be linking to the cFE issue #95 which is not correct. This pull request is intended to resolve nasa/cFS#95.

Comment on lines +93 to +98

# CPU2 is uncommented to test Travis CI's ability to build multiple targets, ensuring
# the build system is functioning properly.
SET(TGT2_NAME cpu2)
SET(TGT2_APPLIST sample_app sample_lib ci_lab to_lab sch_lab)
SET(TGT2_FILELIST cfe_es_startup.scr)
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't change the default behavior of cFE out of the box. This should be part of CI if you want to check 2 targets with CI.

@JandlynBentley-at-NASA JandlynBentley-at-NASA marked this pull request as draft June 24, 2020 13:24
@skliper
Copy link
Contributor

skliper commented Jun 24, 2020

In my original commits from git, it looks like it might be linking to the cFE issue #95 which is not correct. This pull request is intended to resolve nasa/cFS#95.

You need to open an issue in this repository specific to the changes you are doing here. As noted above, don't change the default, out-of-the-box behavior of cFE/cFS. You can add the sample configuration files (which is what I recommend you write the issue to do), but the actual configuration change to build 2 targets should be done with CI from cFS.

@JandlynBentley-at-NASA
Copy link
Contributor Author

I didn't see how to make adjustments in .travis.yml because it looks like CI only does one build for all targets.

@skliper
Copy link
Contributor

skliper commented Jun 24, 2020

I didn't see how to make adjustments in .travis.yml because it looks like CI only does one build for all targets.

The CI in nasa/cFE doesn't build anything. That's why the issue is in cFS, at which it does a matrix build of the entire framework. I recommend from cFS, write a script to reconfigure the system to build 2 CPUs (the part that I said don't do in this repo), and add another build to the cFS matrix that calls that script and does the two CPU build.

@skliper
Copy link
Contributor

skliper commented Jun 24, 2020

In fact it may make more sense to not add these files, since they are (I assume?) just a copy of the cpu1 files. Rather just copy them from cpu1_* as part of the script. Otherwise we'd now have 2 sets of files that we need to keep up to date. The copy is trivial and I'd think it would always work if just building.

@CDKnightNASA
Copy link
Contributor

We currently have targets.cmake with (commented out) CPU2 & CPU3, either we should remove those entries and have .travis.yml create entries or we should have all of the relevant files in sample_defs to support CPU2/3 if they are uncommented and just have .travis.yml uncomment the entries. We can discuss at CCB today?

@JandlynBentley-at-NASA
Copy link
Contributor Author

The only reference I could find regarding multiple targets in the Travis CI documentation was here: https://docs.travis-ci.com/user/build-stages/#naming-your-build-stages

It looks like we'd have to make two scripts?

@skliper skliper added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Jun 24, 2020
@CDKnightNASA
Copy link
Contributor

The only reference I could find regarding multiple targets in the Travis CI documentation was here: https://docs.travis-ci.com/user/build-stages/#naming-your-build-stages

It looks like we'd have to make two scripts?

What I suggest you do is have travis alter the targets.cmake and create the addl. .scr and .h files, then just do a single build (which will create multiple CPU's).

@jphickey
Copy link
Contributor

Note you can put targets inside an "if" statement like this:

if (TEST_TARGETS GREATER 1)
   set(TGT2_NAME cpu2)
   ...
endif()

Note this isn't a pattern I'd recommend projects clone for their own mission config, but it works for CI. We can also have CI-specific "defs" directories stored in a separate CI repo. Ideally for an extended validation test we should build with other CFS apps, and old/imported configs like real projects would. This may not always work, but we should know if we broke it, as it means we probably need to add something in the release notes to guide users that are upgrading.

@astrogeco astrogeco removed the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants