36
36
# ' @param keep_source If `TRUE` will keep the srcrefs from an installed
37
37
# ' package. This is useful for debugging (especially inside of RStudio).
38
38
# ' It defaults to the option `"keep.source.pkgs"`.
39
+ # ' @param generate_dsym (macOS only) If `TRUE`, and if the package includes a
40
+ # ' native library (a `.so` file), a `dSYM` sidecar file is generated and
41
+ # ' installed alongside the library. This file contains source and line
42
+ # ' information that allows a debugger to step through original sources.
43
+ # '
44
+ # ' Note that since `install()` operates from a temporary directory, the source
45
+ # ' paths will point to dangling locations. You will need to remap these paths
46
+ # ' to the actual sources on your disk, e.g. with lldb:
47
+ # '
48
+ # ' ```
49
+ # ' # Get information about the dangling temporary path for a function in your
50
+ # ' # library
51
+ # ' image lookup -vn my_function
52
+ # '
53
+ # ' # Remap the dangling location to the actual package path
54
+ # ' settings set target.source-map /private/tmp/Rtmpnl5XgE/R.INSTALLe5133dcc3211/mypackage /path/to/mypackage
55
+ # ' ```
39
56
# ' @param ... additional arguments passed to [remotes::install_deps()]
40
57
# ' when installing dependencies.
41
58
# ' @family package installation
@@ -50,6 +67,7 @@ install <-
50
67
build_vignettes = FALSE ,
51
68
keep_source = getOption(" keep.source.pkgs" ),
52
69
force = FALSE ,
70
+ generate_dsym = TRUE ,
53
71
... ) {
54
72
pkg <- as.package(pkg )
55
73
@@ -70,6 +88,7 @@ install <-
70
88
71
89
opts <- c(
72
90
if (keep_source ) " --with-keep.source" ,
91
+ if (is_macos && generate_dsym ) " --dsym" ,
73
92
" --install-tests"
74
93
)
75
94
if (quick ) {
0 commit comments