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

R: Move to UCRT on Windows #1654

Open
2 of 4 tasks
xhochy opened this issue Mar 28, 2022 · 8 comments
Open
2 of 4 tasks

R: Move to UCRT on Windows #1654

xhochy opened this issue Mar 28, 2022 · 8 comments

Comments

@xhochy
Copy link
Member

xhochy commented Mar 28, 2022

CRAN is moving to use URCT as the C library next month. This will potentially lead to interoperability issues between R packages from conda-forge and ones from CRAN. This leads to the following questions/potential issues:

  1. Can we update our mingw-toolchain to support UCRT based builds?
  2. Do we need to introduce a mutex to not mix old and new builds?
  3. Will this have an impact on the interoperability between the non-R and R packages?

Useful background information:

Things to do

@jakirkham
Copy link
Member

cc @conda-forge/r

@isuruf
Copy link
Member

isuruf commented Mar 29, 2022

Can we update our mingw-toolchain to support UCRT based builds?

Yes, but will need a lot of work.

Do we need to introduce a mutex to not mix old and new builds?

Yes, there is already an epoch which is used by all m2w64-* packages and we can update the epoch. Downstream packages have the epoch in run, but we should add it to downstream packages. It's important to not mix.

Will this have an impact on the interoperability between the non-R and R packages?

No, it will make the interoperability better. (CRT objects can be allocated and deallocated across DLL boundaries with MSVC and MinGW ucrt build)

@jeroen
Copy link

jeroen commented Mar 31, 2022

Hello, upstream maintainer of many R packages and former R toolchain maintainer here :)

The safest and easiest solution would be to start using the toolchain from the rtools42 bundle provided by CRAN:

This contains the mingw-w64 gcc-10.3 toolchain that has been tested to work with all CRAN packages, and also includes all 3rd party system libs as assumed by CRAN packages.

Using custom compilers will become increasingly difficult, because R packages either have to hardcode the linker flags for external libraries as they work with rtools42, or alternatively download their own static ucrt external libraries at install time. Trying to make those packages work with your custom toolchains will probably be an ongoing maintenance nightmare :)

@jakirkham
Copy link
Member

xref: #1044

@dpryan79
Copy link

Given that this is presumably limiting the R 4.2.0 builds should windows builds "simply" be skipped for R packages for now?

@scdub
Copy link

scdub commented Oct 28, 2022

I realize this is a massive undertaking and will require non-trivial resources being drawn away from other important work. Is there a place to discuss this effort and when it might make sense for conda-forge? I'm aware of a few workflows which are broken on 4.1 but do work on 4.2 on Windows because of the change in toolchains. Thanks for everything you all do.

@h-vetinari
Copy link
Member

h-vetinari commented May 6, 2023

The safest and easiest solution would be to start using the toolchain from the rtools42 bundle provided by CRAN

Some additional context from conda-forge/r-base-feedstock#210 for those arriving on this issue:

Is there a reason not to use rtools as jeroen suggested [...]?

For two reasons,

  1. We want the builds to be compatible with the rest of the conda ecosystem.
  2. rtools uses static builds which we do not want to do.

@jakirkham
Copy link
Member

Given this migration is now underway with R 4.4 in conda-forge ( conda-forge/conda-forge-pinning-feedstock#6040 ), should we close this out?

Admittedly the migration is not done, but it is moving at a good clip. Efforts are probably best directed to the various r-*-feedstocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants