Repository navigation
use ucrtbase.dll with R 4.2.0 or newer - #11207
Conversation
| #ifdef _WIN32 | ||
| // initialize runtime library | ||
| Version rVersion(getDLLVersion()); | ||
| bool isUcrt = rVersion >= Version("4.2.0"); |
There was a problem hiding this comment.
Will r >= 4.2 on windows always be ucrt? Aren't there some exceptions based on windows version? I recall Tomas K saying something to that effect
There was a problem hiding this comment.
I believe so, but we should probably have a better check for this. The note at https://cran.r-project.org/bin/windows/base/ says:
This build requires UCRT, which is part of Windows since Windows 10 and Windows Server 2016. On older systems, UCRT has to be installed manually from here.
Let me see if there's a better place for me to figure this out.
There was a problem hiding this comment.
I just wanted to clarify that to use
UTF-8 as the native encoding in R 4.2, if you are using long-term
support Windows servers, you need Windows Server 2022 (Windows Server
2016 is not enough). If you run R 4.2 on Windows Server 2016, it will
still use the Windows default encoding (as R 4.1 and older).
More precisely, as "R for Windows FAQ" says,
For UTF-8 to be the native encoding, you need R at least 4.2 and at least
Windows 10 (version 1903) on desktop systems, Windows Server 2022 on
long-term support server systems or Windows Server 1903 from the semi-annual
channel.
| { | ||
| // on Windows, check if we're using UCRT | ||
| std::string crt; | ||
| Error error = rstudio::r::exec::evaluateString("R.version$crt", &crt); |
There was a problem hiding this comment.
Thanks, this seems less error prone than just checking the R version
* use ucrtbase.dll with R 4.2.0 or newer * ask R whether UCRT is being used * log errors * ignore errors when reading R.version
…on-auto-select * 'main' of github.com:rstudio/rstudio: (40 commits) update to Electron 18.2.3 ensure new instance is created when opening remote session file Update NEWS.md Fix flags not being passed through constructor in R version selectors remove unnecessary package install gpg1 for signing skip adding compiler definitions find jdk on my Intel Mac produce builds for fedora36 use ucrtbase.dll with R 4.2.0 or newer (#11207) Outline uses quarto style labels, `#| label: <name>` (#11192) Allow fallback unknown text file types to open in Desktop same as in server update embedded libclang to 13.0.1 (#11186) Addresses handling of native pipe args with no placeholder (#11194) New project fails earlier when directory already exist (#11191) remove unused gwt class replacements (#11193) update Electron NEWS make message box API aware of this option whitespace tweak naming tweaks from PR feedback ...
Intent
Addresses #11206.
Approach
Newer versions of R will set errno in ucrtbase.dll, so read it from there instead of msvcrt.dll.
Automated Tests
N/A
QA Notes
Given a file with the contents:
(Screaming is an important part of the test procedure)
Run this test with both R 4.2.0 and R 3.6.3, just to confirm we did indeed fix the issue with R 4.2.0, and didn't break anything for R 3.6.3.
Checklist
NEWS.md