JuliaCall icon indicating copy to clipboard operation
JuliaCall copied to clipboard

Support R v4.2.3 for openssl compatibility

Open schlichtanders opened this issue 11 months ago • 5 comments

The new version 0.17.6 depends on R>4.3, which is a problem with openssl support.

using CondaPkg and searching for r-juliacall we get the following r-base >=4.3,<4.4.0a0 restriction

julia> CondaPkg.withenv() do
           run(`micromamba search -c conda-forge r-juliacall`)
       end
Getting repodata from channels...

conda-forge/linux-64                                        Using cache
conda-forge/noarch                                          Using cache


r-juliacall 0.17.6 r43h93ab643_0 (+ 1 builds)
─────────────────────────────────────────────

 Name            r-juliacall
 Version         0.17.6
 Build           r43h93ab643_0
 Size            819 kB
 License         MIT
 Subdir          linux-64
 File Name       r-juliacall-0.17.6-r43h93ab643_0.conda
 URL             https://conda.anaconda.org/conda-forge/linux-64/r-juliacall-0.17.6-r43h93ab643_0.conda
 MD5             5fab13ed882fed43a6c794167cdfd72e
 SHA256          54f4b2233e663faa4b7033d8239b063b3902c408955e220cd48b7ef4ac54db15

 Dependencies:
  - julia
  - r-rjson
  - __glibc >=2.17,<3.0.a0
  - libgcc >=13
  - libstdcxx >=13
  - r-base >=4.3,<4.4.0a0
  - r-rcpp >=0.12.7
  - r-knitr >=1.28

 Other Versions (2):

  Version Build                     
 ────────────────────────────────────
  0.17.5  r40h7525677_0 (+ 6 builds)
  0.17.4  r40h7525677_0 (+ 1 builds)

Process(`micromamba search -c conda-forge r-juliacall`, ProcessExited(0))

This is unfortunate, as Julia itself is bound to openssl >=3,<3.1 because of OpenSSL_jll sticking to the long term support version of openssl.

This results in 0.17.5 being used in CondaPkg (if PythonCall is also installed which adds the openssl restriction). However 0.17.5 breaks on julia 1.11. When explicitly demanding 0.17.6, the following conda error is thrown

(testcondapkg) pkg> conda add r-juliacall==0.17.6
    CondaPkg Found dependencies: /home/myhome/.julia/dev/tmp/testcondapkg/CondaPkg.toml
    CondaPkg Found dependencies: /home/myhome/.julia/environments/v1.11/CondaPkg.toml
    CondaPkg Found dependencies: /home/myhome/.julia/dev/JolinWorkspaceServer/CondaPkg.toml
    CondaPkg Found dependencies: /home/myhome/.julia/dev/JolinWorkspace/CondaPkg.toml
    CondaPkg Found dependencies: /home/myhome/.julia/packages/PythonCall/Nr75f/CondaPkg.toml
    CondaPkg Resolving changes
             + r-juliacall
    CondaPkg Installing packages
             │ /home/myhome/.julia/artifacts/7973f2c7725e2d0eef7a95159454c4145f0945a2/bin/micromamba
             │ -r /home/myhome/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root
             │ install
             │ -y
             │ -p /home/myhome/.julia/dev/tmp/testcondapkg/.CondaPkg/env
             │ --override-channels
             │ --no-channel-priority
             │ conda-build[version='*']
             │ langchain[version='*']
             │ langchain-openai[version='*']
             │ libstdcxx-ng[version='>=3.4,<13.0']
             │ openssl[version='>=3, <3.1']
             │ python[version='>=3.8,<4',channel='conda-forge',build='*cpython*']
             │ r[version='*']
             │ r-base[version='*']
             │ r-codetools[version='*']
             │ r-globals[version='*']
             │ r-juliacall[version='==0.17.6']
             └ -c conda-forge
conda-forge/linux-64                                        Using cache
conda-forge/noarch                                          Using cache
error    libmamba Could not solve for environment specs
    The following packages are incompatible
    ├─ openssl >=3,<3.1  is requested and can be installed;
    └─ r-juliacall 0.17.6  is not installable because there are no viable options
       ├─ r-juliacall 0.17.6 would require
       │  └─ r-base >=4.3,<4.4.0a0  but there are no viable options
       │     ├─ r-base 4.3.0 would require
       │     │  ├─ krb5 >=1.20.1,<1.21.0a0  with the potential options
       │     │  │  ├─ krb5 1.20.1 would require
       │     │  │  │  └─ openssl >=3.0.7,<4.0a0  with the potential options
       │     │  │  │     ├─ openssl [3.0.10|3.0.11|...|3.0.9], which can be installed;
       │     │  │  │     ├─ openssl 3.1.0 conflicts with any installable versions previously reported;
       │     │  │  │     ├─ openssl 3.1.1 conflicts with any installable versions previously reported;
       │     │  │  │     ├─ openssl 3.1.2 conflicts with any installable versions previously reported;
       │     │  │  │     ├─ openssl [3.1.3|3.1.4|3.1.5|3.1.6|3.1.7] conflicts with any installable versions previously reported;
       │     │  │  │     ├─ openssl 3.2.0 conflicts with any installable versions previously reported;
       │     │  │  │     ├─ openssl [3.2.1|3.2.2|3.2.3] conflicts with any installable versions previously reported;
       │     │  │  │     ├─ openssl 3.3.0 conflicts with any installable versions previously reported;
       │     │  │  │     ├─ openssl 3.3.1 conflicts with any installable versions previously reported;
       │     │  │  │     ├─ openssl 3.3.2 conflicts with any installable versions previously reported;
       │     │  │  │     └─ openssl 3.4.0 conflicts with any installable versions previously reported;
       │     │  │  └─ krb5 1.20.1 would require
       │     │  │     └─ openssl >=1.1.1s,<1.1.2a , which conflicts with any installable versions previously reported;
       │     │  └─ libcurl [>=8.0.1,<9.0a0 |>=8.1.0,<9.0a0 ] but there are no viable options
       │     │     ├─ libcurl [8.10.0|8.10.1] would require
       │     │     │  └─ openssl >=3.3.2,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     ├─ libcurl 8.11.1 would require
       │     │     │  └─ openssl >=3.4.0,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     ├─ libcurl [8.1.2|8.2.0|8.2.1] would require
       │     │     │  └─ openssl >=3.1.1,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     ├─ libcurl 8.3.0 would require
       │     │     │  └─ openssl >=3.1.2,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     ├─ libcurl 8.4.0 would require
       │     │     │  └─ openssl >=3.1.3,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     ├─ libcurl 8.5.0 would require
       │     │     │  └─ openssl >=3.2.0,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     ├─ libcurl [8.6.0|8.7.1] would require
       │     │     │  └─ openssl >=3.2.1,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     ├─ libcurl 8.8.0 would require
       │     │     │  └─ openssl >=3.3.0,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     ├─ libcurl [8.8.0|8.9.0|8.9.1] would require
       │     │     │  └─ openssl >=3.3.1,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     └─ libcurl [8.0.1|8.1.0|8.1.1|8.1.2] would require
       │     │        └─ openssl >=3.1.0,<4.0a0 , which conflicts with any installable versions previously reported;
       │     ├─ r-base [4.3.0|4.3.1] would require
       │     │  ├─ libcurl >=8.2.0,<9.0a0 , which cannot be installed (as previously explained);
       │     │  └─ libssh2 >=1.11.0,<2.0a0  but there are no viable options
       │     │     ├─ libssh2 1.11.0 would require
       │     │     │  └─ openssl >=3.1.1,<4.0a0 , which conflicts with any installable versions previously reported;
       │     │     └─ libssh2 1.11.1 would require
       │     │        └─ openssl >=3.4.0,<4.0a0 , which conflicts with any installable versions previously reported;
       │     ├─ r-base 4.3.1 would require
       │     │  └─ libcurl >=8.3.0,<9.0a0 , which cannot be installed (as previously explained);
       │     ├─ r-base 4.3.2 would require
       │     │  └─ libcurl >=8.4.0,<9.0a0 , which cannot be installed (as previously explained);
       │     ├─ r-base [4.3.2|4.3.3] would require
       │     │  └─ libcurl >=8.5.0,<9.0a0 , which cannot be installed (as previously explained);
       │     ├─ r-base [4.3.3|4.4.2] would require
       │     │  └─ libcurl >=8.11.1,<9.0a0 , which cannot be installed (as previously explained);
       │     ├─ r-base [4.3.3|4.4.1|4.4.2] would require
       │     │  └─ libcurl >=8.10.1,<9.0a0 , which cannot be installed (as previously explained);
       │     ├─ r-base [4.3.3|4.4.0|4.4.1] would require
       │     │  └─ libcurl >=8.8.0,<9.0a0 , which cannot be installed (as previously explained);
       │     ├─ r-base [4.3.3|4.4.1] would require
       │     │  └─ libcurl [>=8.9.0,<9.0a0 |>=8.9.1,<9.0a0 ], which cannot be installed (as previously explained);
       │     └─ r-base 4.3.3 would require
       │        └─ libcurl >=8.7.1,<9.0a0 , which cannot be installed (as previously explained);
       └─ r-juliacall 0.17.6 would require
          └─ r-base >=4.4,<4.5.0a0 , which cannot be installed (as previously explained).
critical libmamba Could not solve for environment specs
ERROR: failed process: Process(`/home/myhome/.julia/artifacts/7973f2c7725e2d0eef7a95159454c4145f0945a2/bin/micromamba -r /home/myhome/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root install -y -p /home/myhome/.julia/dev/tmp/testcondapkg/.CondaPkg/env --override-channels --no-channel-priority "conda-build[version='*']" "langchain[version='*']" "langchain-openai[version='*']" "libstdcxx-ng[version='>=3.4,<13.0']" "openssl[version='>=3, <3.1']" "python[version='>=3.8,<4',channel='conda-forge',build='*cpython*']" "r[version='*']" "r-base[version='*']" "r-codetools[version='*']" "r-globals[version='*']" "r-juliacall[version='==0.17.6']" -c conda-forge`, ProcessExited(1)) [1]

It seems like r-base v4.2.3 is the most recent r version which works with openssl long term support version.

schlichtanders avatar Jan 16 '25 11:01 schlichtanders

I'm not sure why this problem happens. JuliaCall itself only requires R>=3.4.0 in the DESCRIPTION file. And I'm using R 4.2.1 on my main laptop, so it also should be fine with R 4.2.3.

Non-Contradiction avatar Jan 20 '25 01:01 Non-Contradiction

maybe some automatic version fixation from the conda-forge build using the feedstock?

schlichtanders avatar Jan 28 '25 21:01 schlichtanders

any plans to support openssl julia version (i.e. openssl long term support version)?

schlichtanders avatar Mar 02 '25 18:03 schlichtanders

maybe some automatic version fixation from the conda-forge build using the feedstock?

That's right. As far as there is a problem, it is with conda-forge, but it likely won't be changed.

Packages are currently built against R 4.3 and 4.4. If no packages were built previously when the pinned R version was lower then there will not be any packages for these earlier versions of R either.

You can see the current pins at:

https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/7d930f2b7fc0f73c40260f05e5bd3ecb63e463a7/recipe/conda_build_config.yaml#L906

So what's the solution?

Solution today: You can set openssl_version to ignore https://github.com/JuliaPy/CondaPkg.jl?tab=readme-ov-file#preferences . This should work as long as you don't use OpenSSL from R or Python. If you do, it may be that the code attempts to use functionality from newer versions of OpenSSL will fail since it won't be available since OpenSSL_jll "wins" by being loaded first when RCall.jl is used. If you load R first and use JuliaCall.jl, it may be that R's newer version of OpenSSL gets loaded first which should be fine.

Solution tomorrow?: I'm not sure, but I think it might be possible to do somehow do something like in https://github.com/JuliaLang/julia/pull/46976 where very early on in the loading process we look at what versions of OpenSSL we have available and make sure to load the newest.

frankier avatar Apr 15 '25 10:04 frankier

We are now on openssl 3.5 LTS. However, this is generally a tough ongoing issue as Julia and R are both built with different versions of OpenSSL.

ViralBShah avatar Nov 03 '25 17:11 ViralBShah