Skip to content

Conversation

mihem
Copy link
Contributor

@mihem mihem commented Jan 25, 2025

@b-rodrigues this fixes a bug i had since the beginning in vscode after running rix and took me some time to figure out.

Warning message:
In file(con, "w") :
  cannot open file '/tmp/RtmpRf8FWl/vscode-R/workspace.json': No such file or directory

So vscode-R saves tmp files in tempdir

print(list.files(tempdir(), recursive = TRUE))
[1] "vscode-R/addins.json"    "vscode-R/response.lock" 
[3] "vscode-R/response.log"   "vscode-R/workspace.json"
[5] "vscode-R/workspace.lock"

rix deletes tmp files that are created (which is good i think) but also deletes all other tmp files, e.g. these vscode-R files, which produce these warning in vscode-R.

I tried to fix this by creating a rix_tmp specific folder.
At least in my case this fixes this issue

@b-rodrigues
Copy link
Contributor

So if I understand correctly, the vscode-r extension also uses the same tempdir as the R session? So when you start a session in VS Code and generate a default.nix expression you get that error message?

@mihem
Copy link
Contributor Author

mihem commented Jan 26, 2025

Yeah, vscode-R seems to also use tempdir. So I you start a R session in VS Code everything works fine. But after you run rix, those temporary files that vscode-R needs are deleted because of rix. So as long as the session continues, you get this warning message. You can just create a new R session and it's gone. But when I tried to debugging the get_cloest_commit stuf, this got really annoying because it was showing up all the time.
In general I would also think that it's dangerous if rix just deleted all temporary files? So it's safer to create a separate folder and only remove this folder when rix is finished.

@b-rodrigues
Copy link
Contributor

At first we actually had a separate temp folder but had many issues with some unit tests and trying to rebuild vignettes. I think that now it should be fine, though, as the vignettes are static now.

@b-rodrigues
Copy link
Contributor

closing in favour of #403 (comment)

@b-rodrigues b-rodrigues closed this Feb 1, 2025
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 this pull request may close these issues.

2 participants