extendr / rextendr

An R package that helps scaffolding extendr-enabled packages or compiling Rust code dynamically
https://extendr.github.io/rextendr/
Other
175 stars 25 forks source link

Skip tests with "long path" on Windows with R < 4.3 #303

Closed yutannihilation closed 1 year ago

yutannihilation commented 1 year ago

It seems Rust (>= 1.71) has deeper directory structure than before (1.70), and, in some cases, it seems to hit Windows' path limit. Since long path is supported by Rtools 43 if the OS supports it, we don't see such failures on R 4.3. This pull request disables these tests in question on R 4.2 on Windows.

https://github.com/extendr/extendr/pull/586#issuecomment-1637936087

Ilia-Kosenkov commented 1 year ago

Let's define a dedicated method like skip_on_R42()

yutannihilation commented 1 year ago

Thanks, defined.

yutannihilation commented 1 year ago

Since this function is under tests/, I think this linting error is a false-positive, but I added testthat:: to suppress the error.

file=tests/testthat/helper.R,line=102,col=5,[object_usage_linter] no visible global function definition for ‘skip’
CGMossa commented 11 months ago

Maybe this helps, maybe it doesn't:

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\?\" prefix. For example, "\?\D:\very long path".

Source: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

yutannihilation commented 11 months ago

Thanks. I don't fully understand what's happening, but it seems R <= 4.2 doesn't support the long path, guessing from this blog post (confession: I only read some part of this, so I might be wrong).

https://blog.r-project.org/2023/03/07/path-length-limit-on-windows/index.html