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

Can we set keep.source to true by default when package is installed? #50

Closed
jaspercooper opened this issue May 18, 2018 · 3 comments
Closed

Comments

@jaspercooper
Copy link
Contributor

@nfultz has outlined the problem very nicely here

Basically, construct_design_code() is using getSrcref() to grab the source code of the designer functions in the package. That's great and works fine locally because we can set the project to run R CMD INSTALL --no-multiarch --with-keep.source DesignLibrary by default.

The problem arises in two instances:

  1. I don't think that R CMD CHECK has keep.source as an option, so our checks will always break. Is there a way to set global variables when the check runs, before the package is installed?
  2. When users don't specify that source should be kept when installing, the package breaks massively.
    This breaks bigly:
    detach("package:DesignLibrary", unload = TRUE)
    devtools::install_github("DeclareDesign/DesignLibrary")
    library(DesignLibrary)
    simple_two_arm_designer()
    This works:
    detach("package:DesignLibrary", unload = TRUE)
    devtools::install_github("DeclareDesign/DesignLibrary", keep_source = TRUE)
    library(DesignLibrary)
    simple_two_arm_designer()

@nfultz is there a way to ensure that keep.source is always true when the package is built? Can we set R_KEEP_PKG_SOURCE=yes as a side effect before installing the package on the user's computer, for example?

@jaspercooper
Copy link
Contributor Author

OK I fixed 1 in 6a56044

jaspercooper added a commit that referenced this issue May 22, 2018
- note designer functions still don't work during package compilation due to problems discussed in #50
@jaspercooper
Copy link
Contributor Author

This is breaking everything too often -- I think we need to remove reliance on getSrcref()

@jaspercooper
Copy link
Contributor Author

This has been fixed using the handler by @clabima and @nfultz

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

No branches or pull requests

1 participant