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

Always print output when refreshing cache #177

Merged
merged 2 commits into from
Nov 27, 2023
Merged

Conversation

thomas-bc
Copy link
Contributor

Related Issue(s) nasa/fprime#1992

Change Description

Fix nasa/fprime#1992

When cmake_refresh_cache() is triggered, always print the cmake regeneration output.

Rationale

  • This is consistent with the behavior that fprime-util build et al. have when target exists but requires a refresh (e.g. .fpp file was modified). Output of regeneration is printed out.
  • Imo it helps new users (who may not be familiar with CMake) in understanding the build process. Target doesn't exist -> needs a refresh. Target is out of date -> needs a refresh. Refresh is the same thing happening under the hood in both cases (also fprime-util generate), and the familiar-looking output confirms that.
  • Clears out any confusion with regards to F´ Util Prints "Error Not Found" Before Regenerating fprime#1992

Comment

This has the side effect of also printing the Built target noop to the screen... which I don't really like.
I've been looking in other ways to do this, but was unsuccessful. A fix could be to go in the CMakeHandler._communicate and explicitly skip lines that equal Built target noop\n, but that sounds rather ugly...
Do you have any suggestion?

@thomas-bc thomas-bc requested a review from LeStarch November 7, 2023 00:38
@LeStarch
Copy link
Collaborator

LeStarch commented Nov 8, 2023

We could rename the target to "refresh".

Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

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

Requires the following:

  • Run "refresh_cache" instead of "noop" if it exists, else run "noop"

print_output=self.verbose,
)
# Backwards compatibility: refresh_cache was named noop until v3.3.x
if self.is_target_supported(build_dir, "noop"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given the slowness of printing targets, perhaps it is faster to run "refresh_cache" and trap "No rule to make target `llkjldksjlksdj'. Stop." and then run "noop"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Will revisit with the ninja support work.

@LeStarch LeStarch merged commit a764e07 into nasa:devel Nov 27, 2023
24 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.

F´ Util Prints "Error Not Found" Before Regenerating
2 participants