Skip to content

Generate dSYM file in install() on macOS #2598

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 2 commits into from
Apr 2, 2025
Merged

Generate dSYM file in install() on macOS #2598

merged 2 commits into from
Apr 2, 2025

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Apr 2, 2025

This dSYM file contains the file/line information that allows debuggers to figure out the source location.

As noted in the argument doc, generating this file is only one half of the battle. Because the package is built from a temporary location, the source info points to dangling paths. It is possible to remap these paths from lldb though.

@lionel- lionel- requested a review from gaborcsardi April 2, 2025 13:31
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! I didn't look at the NEWS changes. (Maybe worth undoing the whitespace changes to reduce the noise?)

Btw. this does not work for packages that use src/install.libs.R, unless the package author explicitly copies the debug files. (Which has its own advantages, e.g. avoiding binary packages that are hundreds of megabytes.)

@lionel-
Copy link
Member Author

lionel- commented Apr 2, 2025

@gaborcsardi Is there any way we could build the package in the original location and bundle it from there? A bit like we do with load_all(). This would ensure source info at R and library levels are correct. I looked into no-staged-install but that's not it.

@lionel-
Copy link
Member Author

lionel- commented Apr 2, 2025

Btw. this does not work for packages that use src/install.libs.R, unless the package author explicitly copies the debug files. (Which has its own advantages, e.g. avoiding binary packages that are hundreds of megabytes.)

Good to know thanks.

I reverted the accidental whitespace changes.

@lionel- lionel- merged commit 332ed7e into r-lib:main Apr 2, 2025
12 checks passed
@lionel- lionel- deleted the dsym branch April 2, 2025 14:19
@gaborcsardi
Copy link
Member

Compiling in the original location is the default for R CMD INSTALL, but for devtools::install() you need to use build = FALSE to get that.

If you also want to run R CMD build first, that copies the while package, and it also creates a (temporary in this case) source R package, so not much you can do there.

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