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

Enable forceInstall=TRUE option to force re-installation of all packages and dependencies #183

Closed
stefanfritsch opened this issue Jul 3, 2015 · 5 comments
Assignees
Milestone

Comments

@stefanfritsch
Copy link

Hi,

on a project checkpoint maneuvered itself (once again) into a broken, inconsistent state with half the dependencies of the installed packages missing. This is most likely related to a Unable to parse 1 files (but that error is impossible to debug so I wouldn't know). :)

Now I know that the problem itself is not narrow enough for a bug report but you could include a force=TRUE option that reinstalls everything even if checkpoint thinks it already did that.

Right now I delete the snapshot directory. But that takes longer and means I have to reinstall everything in every project and not just the packages used in the project at hand.

Thank you
Stefan

@andrie
Copy link
Contributor

andrie commented Jul 3, 2015

I like the idea of a force = TRUE option. This is something we should look into. (Care to add the functionality and submit a pull request? ;-) )

The Unable to parse 1 files message should be easy to debug. The reason is that R does not consider that file to be free of syntax errors. checkpoint should tell you the name of the file in question.

Typically this happens if you have a syntax error (e.g. missing parentheses) in that script, or perhaps remnants of code or output that should really be commented out.

So, to debug, run the script in question and see where R throws an error.

If there is in fact a bug in the parsing code, then it would help if you can provide an example of a script that runs fine, but can not be parsed by checkpoint.

Also, as a last resort, you can create a "manifest" file consisting purely of library() statements containing all of the packages you need. In other words, create an R script that only contains library() calls.

(Any additional information you have will also be helpful.)

I hope this helps.

@stefanfritsch
Copy link
Author

If the .R had a syntax error it would be easy to debug. But the syntax is correct. :)

Part of the problem with the debugging is that the source file is huge and I'm currently not in a position to change that.

Basically my main issue with checkpoint is that it works fine if everyone follows best practice but I'd love to have some ways to get it going if the source is ugly. :)

@andrie
Copy link
Contributor

andrie commented Jul 7, 2015

Hi, Stefan

I'd love to receive an example of a file with valid syntax that cannot be parsed.

Meanwhile, you ask for a way "to get it going if the source is ugly".

My recommendation is to create a separate R script consisting purely of library() statements, each line listing a package that you require in your script. You never have to source() this file, but merely having it in your project folder will force checkpoint() to parse the file and discover the additional dependencies you need.

Good luck!

@andrie andrie self-assigned this Jul 14, 2015
@andrie andrie added this to the v0.3.14 milestone Sep 4, 2015
@andrie andrie modified the milestones: v0.3.15, v0.3.14 Sep 13, 2015
@andrie andrie changed the title [enhancement] This needs a force=TRUE option Enable force=TRUE option to force re-installation of all packages and dependencies Oct 27, 2016
@andrie
Copy link
Contributor

andrie commented Oct 28, 2016

I'm implementing this using a new argument forceInstall = FALSE

andrie added a commit that referenced this issue Oct 28, 2016
@andrie andrie added this to the v0.3.18 milestone Oct 28, 2016
andrie added a commit that referenced this issue Oct 28, 2016
* dev:
  Checks if the project looks like an R project and asks for confirmation. #227
  Add functionality to force re-installation of all discovered packages and dependencies. #183
  Run Travis tests also for NOT_CRAN="false"
  Test if logfile exists must be skipped on CRAN #225
  Add function to list checkpoint archives and remove archives #228
@andrie andrie changed the title Enable force=TRUE option to force re-installation of all packages and dependencies Enable forceInstall=TRUE option to force re-installation of all packages and dependencies Oct 28, 2016
@andrie andrie closed this as completed Oct 28, 2016
@stefanfritsch
Copy link
Author

Thanks a lot!

This was a major hurdle to adoption here.

I'm sorry that I couldn't be of more help with debugging and implementation. :(

Stefan

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

No branches or pull requests

2 participants