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

Refactor locs, dependencies into generic sub build #2360

Merged
merged 8 commits into from
Nov 13, 2023

Conversation

LeStarch
Copy link
Collaborator

@LeStarch LeStarch commented Nov 7, 2023

Originating Project/Creator
Affected Component
Affected Architectures(s)
Related Issue(s)
Has Unit Tests (y/n)
Builds Without Errors (y/n)
Unit Tests Pass (y/n)
Documentation Included (y/n)

Change Description

Creates generic sub-builds and makes locs/dependencies into a sub-build. This replaces the hardcoded prescan function.

Rationale

Sub-builds are a standard pattern in CMake and this exposes this functionality in a generic form to users. Reworking pre-scan into this has the following advantages:

  1. "Rebuilding" loc/dependencies does not take substantial time after the first run
  2. Proper dependency tracking and rebuilds work
  3. -j will work for sub/builds and fpp-depend isn't mapped to the whole CPU.

Future Work

Note any additional work that will be done relating to this issue.

Review fixes tracked as check-list:

  • Remove commented out FPrime-Code
  • Remove comment link to pre-scan
  • Remove Fprime-Code.cmake
  • Change [prescan] to [subbuild] or [subbuild-name]
  • Always print executing step

@LeStarch
Copy link
Collaborator Author

LeStarch commented Nov 7, 2023

Note: although structurally much nicer, this slows down the initial generate time. Here are some numbers:

Original (Ref): initial generation
-- Configuring done (14.0s)
-- Generating done (0.6s)

This PR (Ref): initial generation w/ 16 jobs
-- Configuring done (17.7s)
-- Generating done (0.6s)

Original (Ref): re-generation
-- Configuring done (12.7s)
-- Generating done (0.5s)

This PR (Ref): initial re-generation w/ 16 jobs
-- Configuring done (6.0s)
-- Generating done (0.6s)

Notice that the re-generation (changed a model/CMakeLists.txt) is substantially faster.

Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

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

A couple of nits/comments, but overall looks good to me!

Ref/CMakeLists.txt Outdated Show resolved Hide resolved
Ref/SignalGen/CMakeLists.txt Show resolved Hide resolved
cmake/sub-build/sub-build.cmake Outdated Show resolved Hide resolved
cmake/sub-build/sub-build.cmake Outdated Show resolved Hide resolved
cmake/FPrime-Code.cmake Outdated Show resolved Hide resolved
cmake/sub-build/sub-build.cmake Show resolved Hide resolved
@LeStarch LeStarch mentioned this pull request Nov 10, 2023
Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

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

🚀

@LeStarch LeStarch merged commit 3f6b3a9 into nasa:devel Nov 13, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants