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

Checking available packages is broken #37

Closed
barracuda156 opened this issue Oct 3, 2023 · 9 comments
Closed

Checking available packages is broken #37

barracuda156 opened this issue Oct 3, 2023 · 9 comments

Comments

@barracuda156
Copy link

--->  Testing R-densityarea
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-densityarea/R-densityarea/work/densityarea-0.1.0/densityarea.Rcheck’
* using R version 4.3.1 (2023-06-16)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-12 (MacPorts gcc12 12.3.0_0) 12.3.0
    GNU Fortran (MacPorts gcc12 12.3.0_0) 12.3.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* checking for file ‘densityarea/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘densityarea’ version ‘0.1.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... ERROR
Packages required but not available:
  'cli', 'dplyr', 'ggdensity', 'isoband', 'purrr', 'rlang', 'sf',
  'sfheaders', 'tibble', 'vctrs'

Packages suggested but not available:
  'forcats', 'ggplot2', 'knitr', 'ragg', 'readr', 'rmarkdown',
  'stringr', 'testthat', 'tidyr'

VignetteBuilder package required for checking but not installed: ‘knitr’

The suggested packages are required for a complete check.
Checking can be attempted without them by setting the environment
variable _R_CHECK_FORCE_SUGGESTS_ to a false value.

See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’
manual.
* DONE

Status: 1 ERROR

In reality, however, all needed packages are installed, and all their dependents work fine.

Not sure why this fails specifically here; maybe, due to bootstrapping renv? Why not use it normally, pre-installed one?

@JoFrhwld Could you please address this?

@barracuda156
Copy link
Author

In also fails with installation:

Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-densityarea/R-densityarea/work/densityarea-0.1.0" && /opt/local/bin/R CMD INSTALL . --library=/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-densityarea/R-densityarea/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library 
ERROR: dependencies ‘cli’, ‘dplyr’, ‘ggdensity’, ‘isoband’, ‘purrr’, ‘rlang’, ‘sf’, ‘sfheaders’, ‘tibble’, ‘vctrs’ are not available for package ‘densityarea’
* removing ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-densityarea/R-densityarea/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/densityarea’
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-densityarea/R-densityarea/work/densityarea-0.1.0" && /opt/local/bin/R CMD INSTALL . --library=/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-densityarea/R-densityarea/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library 
Exit code: 1
Error: Failed to destroot R-densityarea: command execution failed

@JoFrhwld
Copy link
Owner

JoFrhwld commented Oct 3, 2023

I've decided to use renv to keep the dev environment very explicit, and to make sure that I don't accidentally rely on packages installed globally & forget to explicitly add them to the Description.

If renv is really the culprit, you could try restoring the environment with

renv::restore()

Or, if you'd rather not, deleting the .Rprofile file will eliminate the activation of renv.

@barracuda156
Copy link
Author

@JoFrhwld Thank you. I guess, removing that file is the way to go, since portfile will take care of all dependencies, we just need to ensure nothing interferes to break what otherwise works.

@JoFrhwld
Copy link
Owner

JoFrhwld commented Oct 3, 2023

I'm not sure if you're asking if I've resolved the issue, or if you're asking me to remove renv from the github project. I'm also not sure if this is a problem related to MacPorts itself, or in the use of MacPorts.

For what it's worth, all of renv/, renv.lock and .Rprofile are included in .Rbuildignore, meaning they are absent from the package as available on CRAN. Just double checking

wget https://cloud.r-project.org/src/contrib/densityarea_0.1.0.tar.gz
tar -tf densityarea_0.1.0.tar.gz

produces

densityarea/
densityarea/NAMESPACE
densityarea/README.md
densityarea/data/
densityarea/data/s01.rda
densityarea/man/
densityarea/man/density_area.Rd
densityarea/man/figures/
densityarea/man/figures/README-unnamed-chunk-8-1.png
densityarea/man/figures/README-unnamed-chunk-17-1.png
densityarea/man/figures/README-unnamed-chunk-6-1.png
densityarea/man/figures/logo.svg
densityarea/man/figures/README-unnamed-chunk-19-1.png
densityarea/man/figures/README-unnamed-chunk-20-1.png
densityarea/man/figures/README-unnamed-chunk-4-1.png
densityarea/man/figures/README-unnamed-chunk-2-1.png
densityarea/man/figures/README-unnamed-chunk-11-1.png
densityarea/man/figures/README-unnamed-chunk-13-1.png
densityarea/man/figures/README-unnamed-chunk-15-1.png
densityarea/man/figures/README-unnamed-chunk-9-1.png
densityarea/man/density_polygons.Rd
densityarea/man/s01.Rd
densityarea/DESCRIPTION
densityarea/build/
densityarea/build/vignette.rds
densityarea/build/partial.rdb
densityarea/tests/
densityarea/tests/testthat/
densityarea/tests/testthat/test-sf_return.R
densityarea/tests/testthat/test-test_rename.R
densityarea/tests/testthat/test-list_return.R
densityarea/tests/testthat/test-expand_range.R
densityarea/tests/testthat/test-multi_polygon.R
densityarea/tests/testthat/test-test_range.R
densityarea/tests/testthat.R
densityarea/vignettes/
densityarea/vignettes/sf-operations.Rmd
densityarea/vignettes/densityarea.Rmd
densityarea/R/
densityarea/R/helper_funs.R
densityarea/R/data.R
densityarea/R/data_checks.R
densityarea/R/density_area.R
densityarea/NEWS.md
densityarea/MD5
densityarea/inst/
densityarea/inst/examples/
densityarea/inst/examples/density_area_example.R
densityarea/inst/examples/density_polygon_example.R
densityarea/inst/doc/
densityarea/inst/doc/sf-operations.Rmd
densityarea/inst/doc/sf-operations.R
densityarea/inst/doc/sf-operations.html
densityarea/inst/doc/densityarea.R
densityarea/inst/doc/densityarea.html
densityarea/inst/doc/densityarea.Rmd

If the issue above results from the version on CRAN, then it's probably not due to renv, and probably beyond my ability to address.

@barracuda156
Copy link
Author

@JoFrhwld I generally prefer using upstream GitHub repos whenever they have tarballs over CRAN. And I think I used a tarball from here when I wrote a portfile. Cannot verify at the moment, it is on another machine, and it’s 4 AM here, so all testing will be done tomorrow.

We can remove unwanted files in post-extract stage, so if the breakage results from bootstrapped renv, it is a trivial fix which we can handle locally.

Please allow me until tomorrow to verify it works as we think. I will close the issue as resolved, if it does. And then I can add densityarea to Macports.

@barracuda156
Copy link
Author

So yes, deleting the file solves the problem, tests run and pass:

--->  Extracting densityarea-0.1.0.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-densityarea/R-densityarea/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/R-densityarea/densityarea-0.1.0.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
--->  Configuring R-densityarea
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-densityarea/R-densityarea/work/densityarea-0.1.0" && /opt/local/bin/R CMD build . --no-manual --no-build-vignettes 
* checking for file ‘./DESCRIPTION’ ... OK
* preparing ‘densityarea’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘densityarea_0.1.0.tar.gz’

--->  Building R-densityarea
--->  Testing R-densityarea
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-densityarea/R-densityarea/work/densityarea-0.1.0/densityarea.Rcheck’
* using R version 4.3.1 (2023-06-16)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-12 (MacPorts gcc12 12.3.0_0) 12.3.0
    GNU Fortran (MacPorts gcc12 12.3.0_0) 12.3.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* checking for file ‘densityarea/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘densityarea’ version ‘0.1.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘densityarea’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... NOTE
  Note: found 2534 marked UTF-8 strings
* checking LazyData ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking files in ‘vignettes’ ... WARNING
Files in the 'vignettes' directory but no files in 'inst/doc':
  ‘densityarea.Rmd’ ‘sf-operations.Rmd’
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘testthat.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... WARNING
Directory 'inst/doc' does not exist.
Package vignettes without corresponding single PDF/HTML:
  ‘densityarea.Rmd’
  ‘sf-operations.Rmd’
* checking running R code from vignettes ...
  ‘densityarea.Rmd’ using ‘UTF-8’... OK
  ‘sf-operations.Rmd’ using ‘UTF-8’... OK
 NONE

Thank you!

@JoFrhwld
Copy link
Owner

JoFrhwld commented Oct 4, 2023

Great! Glad we could resolve it.

@barracuda156
Copy link
Author

P. S. By the way, maybe remove that file from the tarball too? It is not an issue for Macports anymore (since we have a fix), but provisionally it may put in trouble someone installing the package from tarball (and not CRAN or via git repo cloning).

@JoFrhwld
Copy link
Owner

JoFrhwld commented Oct 4, 2023

I've added a .gitattributes file with

.Rprofile export-ignore

Which, I believe, will now exclude it from github releases.

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

2 participants