diff --git a/NEWS.md b/NEWS.md index 8d9a6cae8..c67e0bc1c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,5 @@ # devtools (development version) -* On macOS, `install()` now generates `dSYM` sidecar files for native libraries by default. - * Functions that use httr now explicitly check that it is installed (@catalamarti, #2573). diff --git a/R/install.R b/R/install.R index f165f82d1..139dff158 100644 --- a/R/install.R +++ b/R/install.R @@ -26,6 +26,13 @@ #' binary artefacts (like \file{.o}, `.so`) from appearing in your local #' package directory, but is considerably slower, because every compile has #' to start from scratch. +#' +#' One downside of installing from a built tarball is that the package is +#' installed from a temporary location. This means that any source references, +#' at R level or C/C++ level, will point to dangling locations. The debuggers +#' will not be able to find the sources for step-debugging. If you're +#' installing the package for development, consider setting `build` to +#' `FALSE`. #' @param args An optional character vector of additional command line #' arguments to be passed to `R CMD INSTALL`. This defaults to the #' value of the option `"devtools.install.args"`. @@ -36,27 +43,6 @@ #' @param keep_source If `TRUE` will keep the srcrefs from an installed #' package. This is useful for debugging (especially inside of RStudio). #' It defaults to the option `"keep.source.pkgs"`. -#' @param generate_dsym (macOS only) If `TRUE`, and if the package includes a -#' native library (a `.so` file), a `dSYM` sidecar file is generated and -#' installed alongside the library. This file contains source and line -#' information that allows a debugger to step through original sources. -#' -#' Note that when `build` is set to `TRUE`, `install()` operates from a -#' temporary directory which causes the source paths to point to dangling -#' locations. You will need to remap these paths to the actual sources on your -#' disk, e.g. with lldb: -#' -#' ``` -#' # Get information about the dangling temporary path for a function in your -#' # library -#' image lookup -vn my_function -#' -#' # Remap the dangling location to the actual package path -#' settings set target.source-map /private/tmp/Rtmpnl5XgE/R.INSTALLe5133dcc3211/mypackage /path/to/mypackage -#' ``` -#' -#' To avoid this, set `build` to `FALSE` to install directly from the source -#' location instead of a "built" package tarball. #' @param ... additional arguments passed to [remotes::install_deps()] #' when installing dependencies. #' @family package installation @@ -71,7 +57,6 @@ install <- build_vignettes = FALSE, keep_source = getOption("keep.source.pkgs"), force = FALSE, - generate_dsym = TRUE, ...) { pkg <- as.package(pkg) @@ -92,7 +77,6 @@ install <- opts <- c( if (keep_source) "--with-keep.source", - if (is_macos && generate_dsym) "--dsym", "--install-tests" ) if (quick) { diff --git a/man/install.Rd b/man/install.Rd index 7aef39175..b00094edd 100644 --- a/man/install.Rd +++ b/man/install.Rd @@ -16,7 +16,6 @@ install( build_vignettes = FALSE, keep_source = getOption("keep.source.pkgs"), force = FALSE, - generate_dsym = TRUE, ... ) } @@ -34,7 +33,14 @@ demos, and vignettes, to make installation as fast as possible.} this ensures that the installation is completely clean, and prevents any binary artefacts (like \file{.o}, \code{.so}) from appearing in your local package directory, but is considerably slower, because every compile has -to start from scratch.} +to start from scratch. + +One downside of installing from a built tarball is that the package is +installed from a temporary location. This means that any source references, +at R level or C/C++ level, will point to dangling locations. The debuggers +will not be able to find the sources for step-debugging. If you're +installing the package for development, consider setting \code{build} to +\code{FALSE}.} \item{args}{An optional character vector of additional command line arguments to be passed to \verb{R CMD INSTALL}. This defaults to the @@ -79,27 +85,6 @@ It defaults to the option \code{"keep.source.pkgs"}.} \item{force}{Force installation, even if the remote state has not changed since the previous install.} -\item{generate_dsym}{(macOS only) If \code{TRUE}, and if the package includes a -native library (a \code{.so} file), a \code{dSYM} sidecar file is generated and -installed alongside the library. This file contains source and line -information that allows a debugger to step through original sources. - -Note that when \code{build} is set to \code{TRUE}, \code{install()} operates from a -temporary directory which causes the source paths to point to dangling -locations. You will need to remap these paths to the actual sources on your -disk, e.g. with lldb: - -\if{html}{\out{