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

Disambiguate fpp error messages. Fixes: #2618 #2620

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions cmake/autocoder/fpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,19 @@ function(locate_fpp_tools)
continue()
endif()
message(STATUS "[fpp-tools] ${${TOOL}} version ${CMAKE_MATCH_1} not expected version ${FPP_VERSION}")
set(FPP_REINSTALL_ERROR_MESSAGE
"fpp-tools version incompatible. Found ${CMAKE_MATCH_1}, expected ${FPP_VERSION}." PARENT_SCOPE
)
elseif(OUTPUT_TEXT MATCHES "requires 'java'")
set(FPP_ERROR_MESSAGE
"fpp-tools version incompatible. Found ${CMAKE_MATCH_1}, expected ${FPP_VERSION}" PARENT_SCOPE
"fpp tools require 'java'. Please install 'java' and ensure it is on your PATH." PARENT_SCOPE
)
else()
message(STATUS "[fpp-tools] ${PROGRAM} appears corrupt.")
message(STATUS "[fpp-tools] ${PROGRAM} installed incorrectly.")
set(FPP_REINSTALL_ERROR_MESSAGE "fpp tools installed incorrectly." PARENT_SCOPE)
endif()
else()
message(STATUS "[fpp-tools] Could not find ${PROGRAM}")
message(STATUS "[fpp-tools] Could not find ${PROGRAM}.")
endif()
set(FPP_FOUND FALSE PARENT_SCOPE)
return()
Expand Down
9 changes: 6 additions & 3 deletions cmake/required.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ find_program(FPUTIL NAMES fprime-util)

locate_fpp_tools()

set(TO_INSTALL_MESSAGE "Install with:\n 'pip install -r \"${FPRIME_FRAMEWORK_PATH}/requirements.txt\"'")

set(FRAGMENT "pip install -r \"${FPRIME_FRAMEWORK_PATH}/requirements.txt\"")
set(TO_INSTALL_MESSAGE "Install with:\n '${FRAGMENT}'")
set(TO_REINSTALL "Reinstall with:\n '${FRAGMENT} -U --force-reinstall'")
# Check python was found
if (NOT FPUTIL)
message(FATAL_ERROR " fprime-util was not found. ${TO_INSTALL_MESSAGE}")
elseif (NOT PYTHON)
message(FATAL_ERROR " python3 was not found. Please see: https://www.python.org/downloads/")
elseif (DEFINED FPP_ERROR_MESSAGE)
message(FATAL_ERROR " ${FPP_ERROR_MESSAGE}. ${TO_INSTALL_MESSAGE}")
message(FATAL_ERROR " ${FPP_ERROR_MESSAGE}")
elseif (DEFINED FPP_REINSTALL_ERROR_MESSAGE)
message(FATAL_ERROR " ${FPP_REINSTALL_ERROR_MESSAGE}. ${TO_REINSTALL}")
elseif(NOT FPP_FOUND)
message(FATAL_ERROR " fpp tools not found. ${TO_INSTALL_MESSAGE}")
endif()
Expand Down
Loading