Skip to content
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

Blank lib_path in R/zzz.R in Mac OS X conda environment #78

Open
pschloss opened this issue Sep 21, 2022 · 1 comment
Open

Blank lib_path in R/zzz.R in Mac OS X conda environment #78

pschloss opened this issue Sep 21, 2022 · 1 comment
Labels
bug an unexpected problem or unintended behavior

Comments

@pschloss
Copy link

I've been trying to create a conda recipe to build archive. After much sleuthing, I tracked down an issue with Lines 2 and 9 in R/zzz.R

lib_path <- system.file("lib", .Platform$r_arch, paste0("libconnection", .Platform$dynlib.ext), package = "archive")

When I am building this using the default Mac OS X environment, .Platform$dynlib.ext is .so and so it happily finds libconnection.so and generates a full string for lib_path.

However, when I build this in a conda environment, .Platform$dynlib.ext is .dylib. This leads lib_path to being "", not finding libconnection.so and failing to load the library.

The solution that I've come up with is to replace those lines with

lib_path <- list.files(system.file("lib", package = "archive"), pattern="libconnection", full.names=TRUE)

I've tested this on a Mac OS X with R (>4.1) inside and outside of conda and it works.

I wonder whether you would have any interest in a pull request making this change.

@pschloss pschloss changed the title Blank lib_path in R/zzz.R Blank lib_path in R/zzz.R in conda environment Sep 21, 2022
@pschloss pschloss changed the title Blank lib_path in R/zzz.R in conda environment Blank lib_path in R/zzz.R in Mac OS X conda environment Sep 21, 2022
@gaborcsardi
Copy link
Member

I would rather fall back to libconnection.dylib if the first option was not found, instead of pattern matching.

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Sep 21, 2022
pschloss added a commit to pschloss/archive that referenced this issue Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy