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

Using create_package outside of Rstudio gives incorrect error message #1122

Closed
TimTaylor opened this issue Apr 29, 2020 · 4 comments
Closed

Using create_package outside of Rstudio gives incorrect error message #1122

TimTaylor opened this issue Apr 29, 2020 · 4 comments

Comments

@TimTaylor
Copy link

@TimTaylor TimTaylor commented Apr 29, 2020

Using create_package within an interactive session but outside of the RStudio console gives a misleading error message. Note the change of directory is successful even though the error message would indicate the folder does not exist. This error message does not appear when using RStudio.

R> getwd()
[1] "/home/tim"
R> usethis::create_package("test")
✔ Creating 'test/'Setting active project to '/home/tim/test'Creating 'R/'Writing 'DESCRIPTION'
Package: test
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R (parsed):
    * First Last <first.last@example.com> [aut, cre] (YOUR-ORCID-ID)
Description: What the package does (one paragraph).
License: `use_mit_license()`, `use_gpl3_license()` or friends to
    pick a license
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.0Writing 'NAMESPACE'Changing working directory to 'test/'
Error: Directory 'test' does not exist.
Run `rlang::last_error()` to see where the error occurred.Setting active project to '<no active project>'
R> getwd()
[1] "/home/tim/test"

R> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: openSUSE Tumbleweed

Matrix products: default
BLAS:   /usr/lib64/R/lib/libRblas.so
LAPACK: /usr/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C             
 [3] LC_TIME=en_GB.utf8        LC_COLLATE=en_GB.utf8    
 [5] LC_MONETARY=en_GB.utf8    LC_MESSAGES=en_GB.utf8   
 [7] LC_PAPER=en_GB.utf8       LC_NAME=C                
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C      

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_2.3.0 usethis_1.6.1 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6      rstudioapi_0.11   xml2_1.3.2        knitr_1.28       
 [5] magrittr_1.5      roxygen2_7.1.0    pkgload_1.0.2     R6_2.4.1         
 [9] rlang_0.4.5       fansi_0.4.1       stringr_1.4.0     tools_4.0.0      
[13] pkgbuild_1.0.7    xfun_0.13         sessioninfo_1.1.1 cli_2.0.2        
[17] git2r_0.26.1      withr_2.2.0       ellipsis_0.3.0    remotes_2.1.1    
[21] assertthat_0.2.1  digest_0.6.25     rprojroot_1.3-2   crayon_1.3.4     
[25] processx_3.4.2    purrr_0.3.4       callr_3.4.3       fs_1.4.1         
[29] ps_1.3.2          testthat_2.3.2    memoise_1.1.0     glue_1.4.0       
[33] stringi_1.4.6     compiler_4.0.0    desc_1.2.0        backports_1.1.6  
[37] prettyunits_1.1.1
@jennybc
Copy link
Member

@jennybc jennybc commented Apr 29, 2020

Suspect this is fundamentally the same complaint as #954 and (hopefully) fixed by #1024

jennybc added a commit that referenced this issue Apr 30, 2020
Fixes #1122

Now we send proj_activate() an absolutized, realized path, which leaves much less room for headache if input was a relative path.
@pachiras
Copy link

@pachiras pachiras commented Sep 16, 2020

Hello,

I'm new to creating R packages, but I'm having
the same problem with @tjtnew.

Had the problem solved in ver1.6.1?

> getwd()
[1] "/tmp"
> usethis::create_package("test")
✔ Creating 'test/'
✔ Setting active project to '/tmp/test'
✔ Creating 'R/'
✔ Writing 'DESCRIPTION'
Package: test
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R (parsed):
* First Last <first.last@example.com> [aut, cre] (YOUR-ORCID-ID)
Description: What the package does (one paragraph).
License: `use_mit_license()`, `use_gpl3_license()` or friends to
pick a license
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
✔ Writing 'NAMESPACE'
✔ Changing working directory to 'test/'
Error: Directory 'test' does not exist.
✔ Setting active project to '<no active project>'
> getwd()
[1] "/tmp/test"
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 8 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblas-r0.3.3.so

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8       LC_NAME=C
[9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] usethis_1.6.1

loaded via a namespace (and not attached):
[1] Rcpp_1.0.5       roxygen2_7.1.1   fansi_0.4.1      crayon_1.3.4
[5] rprojroot_1.3-2  assertthat_0.2.1 R6_2.4.1         lifecycle_0.2.0
[9] backports_1.1.9  git2r_0.27.1     magrittr_1.5     pillar_1.4.6
[13] stringi_1.5.3    rlang_0.4.7      cli_2.0.2        rstudioapi_0.11
[17] fs_1.5.0         xml2_1.3.2       vctrs_0.3.4      ellipsis_0.3.1
[21] desc_1.2.0       tools_4.0.2      stringr_1.4.0    glue_1.4.2
[25] purrr_0.3.4      xfun_0.17        compiler_4.0.2   pkgconfig_2.0.3
[29] knitr_1.29       tibble_3.0.3

@jennybc
Copy link
Member

@jennybc jennybc commented Sep 16, 2020

Had the problem solved in ver1.6.1?

No the commit linked above as the fix was made after the v1.6.1 release.

@pachiras
Copy link

@pachiras pachiras commented Sep 17, 2020

Thanks, @jennybc
I installed the package from GitHub and confirmed that the error disappeared.

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

3 participants