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

Failing windows build of PEcAn.ED2: bug in fqdn()? #3044

Closed
Aariq opened this issue Sep 22, 2022 · 5 comments · Fixed by #3058
Closed

Failing windows build of PEcAn.ED2: bug in fqdn()? #3044

Aariq opened this issue Sep 22, 2022 · 5 comments · Fixed by #3058
Assignees

Comments

@Aariq
Copy link
Collaborator

Aariq commented Sep 22, 2022

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 if fqdn() returns NULL or a length 0 vector on Windows. I don't have a Windows machine to do local testing on. Tests for fqdn() would help debug this.

@Aariq Aariq self-assigned this Sep 22, 2022
@Aariq Aariq mentioned this issue Sep 22, 2022
13 tasks
@infotroph
Copy link
Member

Does Windows have a hostname command? If not the null result might happen when fqdn tries to call it here.

@Aariq
Copy link
Collaborator Author

Aariq commented Sep 24, 2022

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

@robkooper
Copy link
Member

@dlebauer
Copy link
Member

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"])

@robkooper
Copy link
Member

That is close to what is done in getHostname, see https://github.com/HenrikBengtsson/R.utils/blob/develop/R/System.R#L51

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

Successfully merging a pull request may close this issue.

4 participants