Skip to content

Remove generate_dsym argument #2600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025
Merged

Remove generate_dsym argument #2600

merged 1 commit into from
Apr 4, 2025

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Apr 4, 2025

Follow up for #2598

It's not necessary to generate a dSYM file if you use build = FALSE.

The problem with build = TRUE is that if you're not generating dSYM files, the linker inserts paths to object files that contain the DWARF debug info and these paths are pointing to dangling temporary locations:

> nm -a /Users/lionel/R/Library/4.4-aarch64/rlang/libs/rlang.so | grep OSO
0000000067ef7d43 - 00 0001   OSO /private/tmp/RtmpIM0xjp/R.INSTALLe9c020cfb3cd/rlang/src/capture.o
0000000067ef7d43 - 00 0001   OSO /private/tmp/RtmpIM0xjp/R.INSTALLe9c020cfb3cd/rlang/src/internal.o
0000000067ef7d43 - 00 0001   OSO /private/tmp/RtmpIM0xjp/R.INSTALLe9c020cfb3cd/rlang/src/rlang.o
0000000067ef7d43 - 00 0001   OSO /private/tmp/RtmpIM0xjp/R.INSTALLe9c020cfb3cd/rlang/src/version.o

The workaround implemented in the linked PR is to generate a dSYM file that contains the DWARF info. But this debug info itself points to source files in the dangling temporary directory, forcing the user to remap these files in the debugger, which is quite cumbersome.

With build = FALSE the package is installed directly from source so the recorded paths to object files are correct:

> nm -a /Users/lionel/R/Library/4.4-aarch64/rlang/libs/rlang.so | grep OSO
0000000067ed4ae1 - 00 0001   OSO /Users/lionel/Sync/Projects/R/r-lib/rlang/src/capture.o
0000000067ef785b - 00 0001   OSO /Users/lionel/Sync/Projects/R/r-lib/rlang/src/internal.o
0000000067ef785b - 00 0001   OSO /Users/lionel/Sync/Projects/R/r-lib/rlang/src/rlang.o
0000000067ed4ae1 - 00 0001   OSO /Users/lionel/Sync/Projects/R/r-lib/rlang/src/version.o

There is no need to generate a dSYM file in that case. The only advantage of that file is that you are allowed to delete the object files in the source repo and still preserve full debug information but in practice I think most of us keep their src directory dirty.

Generating these files gets in the way of various dev workflows since they are not ignored by default so it's better not to have to deal with those. For instance I saw that NOTE during check:

N  checking if this is a source package ...
   Found the following apparent object files/libraries:
     src/rlang.so.dSYM/Contents/Resources/DWARF/rlang.so
   Object files/libraries should not be included in a source package.

It's not necessary if you use `build = FALSE` and generating these files
gets in the way since they are not ignored by default.
@lionel- lionel- requested a review from gaborcsardi April 4, 2025 06:54
Copy link
Member

@gaborcsardi gaborcsardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lionel- lionel- merged commit 2aa51ef into r-lib:main Apr 4, 2025
14 checks passed
@lionel- lionel- deleted the unfeature/dsym branch April 4, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants