-
Notifications
You must be signed in to change notification settings - Fork 761
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
load_all should not touch the DESCRIPTION file with roxygen2::update_collate #723
Comments
I agree with the principle that However, if #649 were reverted, then bug #623 would come back. That is, it wouldn't even be possible to run |
Fix me if I am wrong, but my understanding is that devtools is for package development, and if you want to use the package, in your case by multiple R processes in parallel, then you can just install it, and load it with Because if you really want to use |
Hi @renozao PS Your philosophy of keeping the concepts of the packages separate has some attractions to me, but there are things that |
I am using it on a cluster with independent jobs, not real parallel R If the purpose is to be able to run document, then shouldn't the The current solution might actually be fine, as long as it only writes the On Monday, February 23, 2015, Gábor Csárdi <[email protected]
|
@renozao Maybe so for your case. But I think that the general point of "do not run |
Thanks. I'll have to think a bit. The problem I was having is that underneath the hood, I was enormously confused when it first happened to me because I resorted to commenting out new bits of my code to try and track down the error - at some stage 'nuff of my issue, I'll have a think about your problem. |
Hi @renozao I agree with @gaborcsardi about the dangers of running multiple R processes on the same directory. But putting aside those reservations, I have created a branch in my forked (for my own learning and development) copy of roxygen2 which does what you suggested, ie only tries to rewrite the DESCRIPTION file if the collate entry has changed. If you want to try it out, it is available at http://github.com/Geoff99/roxygen/tree/only-update-changed-collate You'd have to download and install it from github (and probably, if you are using Windows as I do, you might have to restart your R session before it would be available). Let me know if you try it out and it does what you want. It seems to work for me - but I'm not doing anything in parallel. |
@gaborcsardi: when you say toolchain, do you mean in the case there is compiled code or even in plain R packages? @Geoff99: I understand the objective of calling |
I'm not prepared to make any guarantees that |
Hi @hadley As the person who wanted (and still does) the Based on my recent experiences, I'll wait to hear back whether my branch makes life easier for the use case that initiated this issue, before I even think about submitting a pull request.. It's only a few lines, but not as crisply elegant as I would like. I'm not able to test it myself, and indeed, the more I thought about it, the harder I found it to think of how I might develop a reproducible parallel |
@renozao Even in plain R packages. E.g. if you export a new function via roxygen, then devtools will need to rewrite the
Maybe you were just lucky. Obviously, if |
Hi @gaborcsardi . I totally agree with you about the possibility of race conditions (even though I have never yet felt confident enough to try anything remotely parallel in R). Using the default arguments in |
To clarify my thoughts and use case:
What happens is that there is a race condition due to parallel jobs trying to re-write a file with its very same content. |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
Hi,
the recent change in
load_all
usingupdate_collate
(PR #649) has a deep impact when loading the package on parallel jobs, has it simply creates a massively invalidDESCRIPTION
file, with each job writing bits of the file in random places.More generally, I think
load_all
should not touch any of the package files: it is meant to load the package as is, and by all means should honor what the user wrote in the DESCRIPTION file, even if it is incorrect.If collate order must be updated, the user can call
collate_update
, and may be suggested to do so if a computed collate order is not as in the original file.I would really stick to the rule:
load_all
emulates what library does, i.e., read/load package files without trying to fix things, roxygen2 helps writing/generating package files.Thank you.
The text was updated successfully, but these errors were encountered: