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

ps_cpu_count returning NA on Windows 10 #77

Closed
hongooi73 opened this issue Mar 22, 2020 · 7 comments · Fixed by #86
Closed

ps_cpu_count returning NA on Windows 10 #77

hongooi73 opened this issue Mar 22, 2020 · 7 comments · Fixed by #86
Labels
bug an unexpected problem or unintended behavior

Comments

@hongooi73
Copy link

hongooi73 commented Mar 22, 2020

Both with logical=TRUE and FALSE. This is with Win 10 Pro 1909, build 18383.

r$> ps::ps_cpu_count(TRUE)
[1] NA

r$> ps::ps_cpu_count(FALSE)
[1] NA

r$> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] pkgdepends_0.0.0.9006

loaded via a namespace (and not attached):
 [1] rstudioapi_0.9.0  rematch2_2.1.0    rappdirs_0.3.1    uuid_0.1-4
 [5] debugme_1.1.0     R6_2.4.1          rlang_0.4.5       fansi_0.4.0
 [9] tools_3.6.2       pkgbuild_1.0.6    lpSolve_5.6.15    pkgcache_1.0.6
[13] utf8_1.1.4        cli_2.0.2         withr_2.1.2       assertthat_0.2.1
[17] rprojroot_1.3-2   digest_0.6.23     tibble_2.1.3      crayon_1.3.4
[21] processx_3.4.2    zip_2.0.4         callr_3.4.2       vctrs_0.2.4
[25] ps_1.3.2          curl_4.3          glue_1.3.2        compiler_3.6.2
[29] pillar_1.4.3      desc_1.2.0        filelock_1.0.2    backports_1.1.5
[33] prettyunits_1.1.1 jsonlite_1.6.1    pkgconfig_2.0.3

image

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label May 6, 2020
@gaborcsardi
Copy link
Member

I am on the same exact versions, and get the correct answers:

> ps::ps_cpu_count(TRUE)
[1] 8
> ps::ps_cpu_count(FALSE)
[1] 8

@gaborcsardi
Copy link
Member

OK, this has to do with the ps binary package built on an older version of Windows. If you install the source package from CRAN, then in works.

@hongooi73
Copy link
Author

Wow, good find. I wonder what a good long-term solution is? CRAN isn't going to have multiple binaries for different versions of Windows, I don't think. Also, how many other packages might be similarly affected?

@gaborcsardi
Copy link
Member

The windows APIs are very stable, so I don't think this is a common thing. I am not even sure why it is happening, but I would need an old windows first to debug it.

@hongooi73
Copy link
Author

Winbuilder runs Windows Server 2008, and Azure has images available for Server 2008 R2. Is that ok? I can spin up a VM for you if necessary.

@gaborcsardi
Copy link
Member

R2 is not ok, because CRAN uses a plain 2008, I think. :( I have one on a VM.

But I need to submit ps now to fix a build issue on Solaris, so I'll have to come back to this later.

@gaborcsardi
Copy link
Member

Maybe I can use a workaround on windows for now, I think I'll do that.

gaborcsardi added a commit that referenced this issue Aug 10, 2020
We cannot choose between OSes using macros,
because the binaries built on one system must
work on another.

Closes #77.
gaborcsardi added a commit that referenced this issue Aug 11, 2020
We cannot choose between OSes using macros,
because the binaries built on one system must
work on another.

Closes #77.
gaborcsardi added a commit that referenced this issue Aug 11, 2020
We cannot choose between OSes using macros,
because the binaries built on one system must
work on another.

Closes #77.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants