Closed Aariq closed 1 year ago
Does Windows have a hostname
command? If not the null result might happen when fqdn
tries to call it here.
That might be the case. I see the following in the Windows build logs:
sethostname: Use the Network Control Panel Applet to set hostname.
hostname -s is not supported.
Warning in system2("hostname", "-f", stdout = TRUE) :
running command '"hostname" -f' had status 1
Error in if (is.localhost(host)) { :
missing value where TRUE/FALSE needed
Calls: test_remote -> remote.execute.cmd
Would this work? https://rdrr.io/cran/R.utils/man/getHostname.System.html
I can't get the getHostname()
function to work, but the following works (returns the same as the current fqdn) on Windows 10, WSL, Ubuntu 20.4 and the PEcAn docker container with Ubuntu 20.4:
as.character(Sys.info()["nodename"])
That is close to what is done in getHostname, see https://github.com/HenrikBengtsson/R.utils/blob/develop/R/System.R#L51
Bug Description
The windows build of
PEcAn.ED2
on r-universe is currently failing because of a failing test in test.met2model.R. The only thing that makes sense to me that would cause this is iffqdn()
returns NULL or a length 0 vector on Windows. I don't have a Windows machine to do local testing on. Tests forfqdn()
would help debug this.