From a9167d7cccf4517284e725b42d8e1f7d4e247e99 Mon Sep 17 00:00:00 2001 From: Ted Stein Date: Tue, 13 Feb 2018 09:18:07 -0800 Subject: [PATCH] [cmake] Print out errors from failed stack steps Per [cmake docs](https://cmake.org/cmake/help/v3.0/command/execute_process.html), if you set both `OUTPUT_VARIABLE` and `ERROR_VARIABLE` to the same var, it will contain both streams' lines, merged in the order they were printed. --- compiler/stack_build.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/stack_build.cmake b/compiler/stack_build.cmake index dceb40ee..2b145d36 100644 --- a/compiler/stack_build.cmake +++ b/compiler/stack_build.cmake @@ -14,11 +14,11 @@ execute_process ( COMMAND ${STACK_EXECUTABLE} ${BOND_STACK_OPTIONS} setup WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE error - OUTPUT_QUIET - ERROR_QUIET) + OUTPUT_VARIABLE setup_output + ERROR_VARIABLE setup_output) if (error) - message (FATAL_ERROR) + message (FATAL_ERROR ${setup_output}) endif() set (buildGhcOptions "-O2") @@ -29,7 +29,7 @@ execute_process ( RESULT_VARIABLE error) if (error) - message (FATAL_ERROR) + message (FATAL_ERROR "build failed - scroll up for its output") endif() # Copy results to builddir @@ -37,10 +37,11 @@ execute_process ( COMMAND ${STACK_EXECUTABLE} ${BOND_STACK_OPTIONS} path --dist-dir WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE dist_dir - RESULT_VARIABLE error) + RESULT_VARIABLE error + ERROR_VARIABLE path_errors) if (error) - message (FATAL_ERROR) + message (FATAL_ERROR ${path_errors}) endif() string (STRIP ${dist_dir} dist_dir)