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

precommit fails to set up environment after upgrade to R 4.2.1 #424

Closed
3 tasks done
danielinteractive opened this issue Jun 28, 2022 · 5 comments
Closed
3 tasks done

Comments

@danielinteractive
Copy link

Before filing a bug

  • I have installed the latest dev version of {precommit} with remotes::install_github('lorenzwalthert/precommit')
  • I have installed the latest hook revisions (update with precommit::autoupdate())
  • I have installed the latest release of the upstream Python framework pre-comit as described under the update instructions.

Describe the bug

With R 4.2.1 (just upgraded) I cannot get precommit to run anymore correctly, it fails when setting up the environment.
I also followed the tipps at #342 (comment) but without success.

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/insightsengineering/tern.mmrm
  2. pre-commit install
  3. touch test
  4. git commit -m "test"
  5. precommit starts and gives following log with error:
[INFO] Installing environment for https://github.com/lorenzwalthert/precommit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/Rscript', '--no-save', '--no-restore', '--no-site-file', '--no-environ', '-e', 'renv::install(commandArgs(trailingOnly = TRUE))', 'insightsengineering/tern', 'assertthat', 'checkmate', 'dfoptim', 'dplyr', 'emmeans', 'insightsengineering/formatters', 'generics', 'ggplot2', 'lme4', 'lmerTest', 'magrittr', 'optimx', 'parallel', 'rlang', 'rtables', 'stats', 'utils')
return code: 1
expected return code: 0
stdout:
    Retrieving 'https://api.github.com/repos/insightsengineering/tern/tarball/63ec152b1eacfc4ad8a519d249095191c6e0fc7c' ...
    	OK [downloaded 582.7 Kb in 0.3 secs]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/assertthat_0.2.1.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/broom_0.8.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/dplyr_1.0.9.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/generics_0.1.2.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/tidyselect_1.1.2.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/tidyr_1.2.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/ggplot2_3.3.6.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/gtable_0.3.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/isoband_0.2.5.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/scales_1.2.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/farver_2.1.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/labeling_0.4.2.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/munsell_0.5.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/colorspace_2.0-3.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/RColorBrewer_1.1-3.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/viridisLite_0.4.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/car_3.1-0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/abind_1.4-5.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/pbkrtest_0.5.1.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/numDeriv_2016.8-1.1.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/lme4_1.1-29.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/minqa_1.2.4.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/nloptr_2.0.3.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/testthat_3.1.4.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/brio_1.1.3.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/praise_1.0.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/waldo_0.4.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/diffobj_0.3.5.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/RcppEigen_0.3.3.9.2.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/quantreg_5.93.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/MatrixModels_0.5-0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/SparseM_1.81.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/maptools_1.1-4.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/sp_1.5-0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/carData_3.0-5.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/checkmate_2.1.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/cowplot_1.1.1.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/emmeans_1.7.5.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/estimability_1.3.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/mvtnorm_1.1-3.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/xtable_1.8-4.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/forcats_0.5.1.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://api.github.com/repos/insightsengineering/formatters/tarball/a5d416318246f2b5305f83168fdd294102d008eb' ...
    	OK [downloaded 2.3 Mb in 0.7 secs]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/htmltools_0.5.2.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/base64enc_0.1-3.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/fastmap_1.1.0.tar.gz' ...
    	OK [file is up to date]
    Retrieving 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/gridExtra_2.3.tar.gz' ...
    	OK [file is up to date]
    
stderr:
    Fehler in state$requirements[[record$Package]] : 
      falsche Argumente um ein environment zu indizieren
    Ruft auf: <Anonymous> ... handler -> renv_retrieve_impl -> renv_retrieve_incompatible
    Traceback (most recent calls last):
    11: renv::install(commandArgs(trailingOnly = TRUE))
    10: retrieve(names(remotes))
     9: handler(package, renv_retrieve_impl(package))
     8: renv_retrieve_impl(package)
     7: renv_retrieve_github(record)
     6: renv_retrieve_package(record, url, path)
     5: renv_retrieve_successful(record, path)
     4: retrieve(package)
     3: handler(package, renv_retrieve_impl(package))
     2: renv_retrieve_impl(package)
     1: renv_retrieve_incompatible(record)
    Ausführung angehalten
    
Check the log at /home/users/sabanesd/.cache/pre-commit/pre-commit.log

Expected behavior

It should work (it has worked before upgrading R from 4.1.3)

Additional context

> sessionInfo()

R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C               LC_TIME=de_CH.UTF-8       
 [4] LC_COLLATE=de_DE.UTF-8     LC_MONETARY=de_CH.UTF-8    LC_MESSAGES=de_DE.UTF-8   
 [7] LC_PAPER=de_CH.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] mmrm_0.0.0.9001

loaded via a namespace (and not attached):
 [1] lattice_0.20-45     mvtnorm_1.1-3       grid_4.2.1          lifecycle_1.0.1     xtable_1.8-4       
 [6] nlme_3.1-157        backports_1.4.1     coda_0.19-4         rlang_1.0.3         estimability_1.3   
[11] cli_3.3.0           rstudioapi_0.13     checkmate_2.1.0     tools_4.2.1         emmeans_1.7.5      
[16] numDeriv_2016.8-1.1 parallel_4.2.1      compiler_4.2.1
@lorenzwalthert
Copy link
Owner

Thanks @danielinteractive. Can you provide the full log from /home/users/sabanesd/.cache/pre-commit/pre-commit.log, as indicated above?

@lorenzwalthert
Copy link
Owner

Do you think it's related to rstudio/renv#983?

@lorenzwalthert
Copy link
Owner

How did you install pre-commit?

@danielinteractive
Copy link
Author

thanks @lorenzwalthert , I think I solved it - problem was that one package was on CRAN but I gave the github prefix, plus PAT was missing which limited rate on github.com. Will confirm later tonight.

@danielinteractive
Copy link
Author

OK indeed this is fixed by stating dependency of another package this depends on explicitly. See corresponding PR insightsengineering/tern.mmrm#77

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