Skip to content

Make RStudio debug symbols available #9158

Open

Description

@jmcphers

RStudio is now built with debug information using CMake's RelWithDebInfo target, which produces a release build that nonetheless includes debug symbols. Those debug symbols are uploaded to Sentry.io, the service that provides our crash handling.

https://github.com/rstudio/rstudio/blob/master/docker/jenkins/sentry-upload.sh

The executables are then stripped before being included in RStudio's release binaries.

rstudio/CMakeGlobals.txt

Lines 317 to 342 in 6a2405d

macro(add_stripped_executable _target)
add_executable(${_target} ${ARGN})
# only strip debug info in release package builds
if(RSTUDIO_PACKAGE_BUILD AND CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
if(UNIX AND NOT APPLE)
# strip debug info
add_custom_command(TARGET ${_target} POST_BUILD
COMMAND objcopy --only-keep-debug ${_target} ${_target}.debug
COMMAND objcopy --strip-debug --strip-unneeded ${_target}
COMMAND objcopy --add-gnu-debuglink=${_target}.debug ${_target}
COMMENT "Stripping ${_target}")
elseif(APPLE)
if(${ARGV1} STREQUAL "MACOSX_BUNDLE")
set(STRIP_TARGET "${_target}.app/contents/MacOS/${_target}")
else()
set(STRIP_TARGET "${_target}")
endif()
add_custom_command(TARGET ${_target} POST_BUILD
COMMAND dsymutil -o ./${_target}.dSYM ${STRIP_TARGET}
COMMAND strip ${STRIP_TARGET}
COMMENT "Stripping ${STRIP_TARGET}")
endif()
endif()
define_source_file_names("${_target}")
endmacro(add_stripped_executable)

However, even though we produce the debug symbols during the build, there is no way for customers or even RStudio's development team to get a hold of the symbols for a particular build. They can be downloaded from Sentry, but only one file at a time.

It would be unnecessary to provide the debug symbols in the release builds, but it would be very helpful to make a package of symbols available separately for each release to aid in debugging thornier issues in the wild.

Activity

  1. added
    tech debt
    on Mar 26, 2021
  2. added this to the 1.5 milestone on Mar 26, 2021
  3. modified the milestones: 2024, Tech Debt on Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildsdiagnosticssupporttech debt

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions