conda-forge / r-jpeg-feedstock

A conda-smithy repository for r-jpeg.
BSD 3-Clause "New" or "Revised" License
0 stars 6 forks source link

Cryptic dependency on `jpeg` #13

Open mfansler opened 1 year ago

mfansler commented 1 year ago

This package links against libjpeg during compilation but was not explicitly declared in the metadata until https://github.com/conda-forge/r-jpeg-feedstock/pull/12. We should patch the repository metadata to specify the jpeg version that it is compatible with.

Due to r-base switching from jpeg to libjpeg-turbo as the libjpeg provider, users are currently prone to DLL incompatibilities.

Example

## osx-64 builds, where r-base uses "libjpeg-turbo" and r-jpeg uses "jpeg"
$ mamba create -yn foo -c conda-forge r-base=4.2.3=h1f61658_1 r-jpeg=0.1_10=r42h815d134_0
# ...
$ conda run -n foo R -e 'library(jpeg)'

R version 4.2.3 (2023-03-15) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(jpeg)
Error: package or namespace load failed for ‘jpeg’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/mfansler/miniconda3/envs/foo/lib/R/library/jpeg/libs/jpeg.dylib':
  dlopen(/Users/mfansler/miniconda3/envs/foo/lib/R/library/jpeg/libs/jpeg.dylib, 6): Library not loaded: @rpath/libjpeg.9.dylib
  Referenced from: /Users/mfansler/miniconda3/envs/foo/lib/R/library/jpeg/libs/jpeg.dylib
  Reason: image not found
Execution halted
ERROR conda.cli.main_run:execute(47): `conda run R -e library(jpeg)` failed. (See above for error)
mfansler commented 1 year ago

Here's a similar issue: https://github.com/conda-forge/r-tiff-feedstock/issues/14