From e043ff2efa006b4eea3acf8f689b99054e96dad0 Mon Sep 17 00:00:00 2001 From: Jim Hester Date: Mon, 5 Aug 2019 10:24:36 -0400 Subject: [PATCH] Better error message when build tools are not found Fixes #68 --- NEWS.md | 4 +++- R/build-tools.R | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index f1d6b6b..769340a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ - # dev +* `check_build_tools()` now has a more helpful error message which points you + towards ways to debug the issue (#68). + * `pkgbuild_process` now do not set custom compiler flags, and it uses the user's `Makevars` file (@gaborcsardi, #76). diff --git a/R/build-tools.R b/R/build-tools.R index 0380c30..e6e8064 100644 --- a/R/build-tools.R +++ b/R/build-tools.R @@ -38,7 +38,9 @@ has_build_tools <- function(debug = FALSE) { #' @rdname has_build_tools check_build_tools <- function(debug = FALSE) { if (!has_build_tools(debug = debug)) - stop("Could not find tools necessary to compile a package", call. = FALSE) + stop( + "Could not find tools necessary to compile a package\n", + "Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.", call. = FALSE) invisible(TRUE) }