ITADN

xfun: conflicts with xfun@0.53

#646OpenBjarkeHautop 创建于 2025-11-04
B
BjarkeHautopcommented
**Before filing a bug** - [x] I have installed the latest dev version of {precommit} with `remotes::install_github('lorenzwalthert/precommit')` - [x] I have installed the latest hook revisions (update with `precommit::autoupdate()`) - [x] I have installed the latest release of the upstream Python framework pre-comit as described under the [update instructions](https://lorenzwalthert.github.io/precommit/dev/articles/precommit.html#update). **Describe the bug** Dependency errors when using precommit. Says xfun: conflicts with xfun@0.53 $ git commit -m "test" [INFO] Initializing environment for https://github.com/lorenzwalthert/precommit. [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Initializing environment for https://github.com/pre-commit-ci/pre-commit-ci-config. [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: ('C:/PROGRA~1/R/R-45~1.1\\bin\\Rscript.exe', '--vanilla', 'C:\\Users\\name\\AppData\\Local\\Temp\\tmp_fkmnpbn\\script.R') return code: 1 stdout: # Bootstrapping renv 1.1.5 --------------------------------------------------- - Downloading renv ... OK - Installing renv ... OK - One or more packages recorded in the lockfile are not installed. - Use `renv::status()` for more details. The following package(s) will be installed: - pak [0.9.0] These packages will be installed into "~/.cache/pre-commit/reponkl02hgo/renv-default/renv/library/windows/R-4.5/x86_64-w64-mingw32". # Installing packages -------------------------------------------------------- - Installing pak ... OK [linked from cache] Successfully installed 1 package in 14 milliseconds. Traceback (most recent calls last): 6: renv::restore() 5: renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclude, prompt = prompt, project = project) 4: pak$pkg_install(pkg = remotes, ask = prompt) 3: remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), list(pkg = pkg, lib = lib, upgrade = upgrade, ask = ask, start = start, dependencies = dependencies, loaded = loaded_packages(lib))) 2: err$throw(res$error) 1: base::stop(cond) stderr: ℹ Loading metadata database ✔ Loading metadata database ... done Error: ! error in pak subprocess Caused by error: ! Could not solve package dependencies: * R.cache@0.17.0: dependency conflict * R.methodsS3@1.8.2: dependency conflict * R.oo@1.27.1: dependency conflict * R.utils@2.13.0: dependency conflict * R6@2.6.1: dependency conflict * Rcpp@1.1.0: dependency conflict * V8@8.0.1: dependency conflict * callr@3.7.6: dependency conflict * commonmark@2.0.0: dependency conflict * cpp11@0.5.2: dependency conflict * curl@7.0.0: dependency conflict * desc@1.4.3: dependency conflict * digest@0.6.37: dependency conflict * docopt@0.7.2: dependency conflict * purrr@1.1.0: dependency conflict * pkgbuild@1.4.8: dependency conflict * magrittr@2.0.4: dependency conflict * processx@3.8.6: dependency conflict * ps@1.9.1: dependency conflict * pkgload@1.4.1: dependency conflict * xmlparsedata@1.0.5: dependency conflict * brew@1.0-10: dependency conflict * cli@3.6.5: dependency conflict * codetools@0.2-20: dependency conflict * highr@0.11: Can't install dependency xfun (>= 0.18) * xfun: Conflicts with xfun@0.53 * knitr@1.50: Can't install dependency xfun (>= 0.51) * ... $ pre-commit --version pre-commit 4.3.0 **To Reproduce** Steps to reproduce the behavior: 1. Make a new R package using package template from RStudio: File -> New project... -> New directory -> New R package 2. Use precommit: > library(precommit) > use_precommit() ℹ Using local config from C:/Users/name/AppData/Local/R/win-library/4.5/precommit/pre-commit-config-pkg.yaml. ✔ Copied .pre-commit-config.yaml to C:/Users/name/Documents/GitHub/rprecommit ✔ Adding ^\.pre-commit-config\.yaml$ to C:/Users/name/Documents/GitHub/rprecommit/.Rbuildignore. • Edit .precommit-config.yaml to (de)activate the hooks you want to use. • All available hooks: https://pre-commit.com/hooks.html • R specific hooks: https://github.com/lorenzwalthert/precommit ✔ Ran `pre-commit autoupdate ()` to get the latest version of the hooks. ℹ Installing hooks in non-blocking background process. If you experience problems or prefer a blocking process, use `options("precommit.block_install_hooks" = TRUE)`. • Sign in with GitHub to authenticate <https://pre-commit.ci> and then come back to complete the set-up process. • It seems like you are using the roxygenize hook. This requires further edits in your `.pre-commit-config.yaml`, please run `precommit::snippet_generate('additional-deps-roxygenize')` to proceed. > precommit::snippet_generate('additional-deps-roxygenize') Generating snippet using CRAN versions. If you need another source, specify with syntax that `renv::install()` understands (see examples in help file). ✔ According to `DESCRIPTION``, there are no hard dependencies of your package. You are set. NULL 3. Commit with git: $ git add . warning: in the working copy of '.Rbuildignore', CRLF will be replaced by LF the next time Git touches it warning: in the working copy of '.gitignore', CRLF will be replaced by LF the next time Git touches it warning: in the working copy of 'DESCRIPTION', CRLF will be replaced by LF the next time Git touches it warning: in the working copy of 'NAMESPACE', CRLF will be replaced by LF the next time Git touches it warning: in the working copy of 'R/hello.R', CRLF will be replaced by LF the next time Git touches it warning: in the working copy of 'man/hello.Rd', CRLF will be replaced by LF the next time Git touches it warning: in the working copy of 'rprecommit.Rproj', CRLF will be replaced by LF the next time Git touches it $ git commit -m "test" [INFO] Locking pre-commit directory [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: ('C:/PROGRA~1/R/R-45~1.1\\bin\\Rscript.exe', '--vanilla', 'C:\\Users\\name\\AppData\\Local\\Temp\\tmpejlzrqbv\\script.R') return code: 1 stdout: # Bootstrapping renv 1.1.5 --------------------------------------------------- - Downloading renv ... OK - Installing renv ... OK - One or more packages recorded in the lockfile are not installed. - Use `renv::status()` for more details. The following package(s) will be installed: - pak [0.9.0] These packages will be installed into "~/.cache/pre-commit/reponkl02hgo/renv-default/renv/library/windows/R-4.5/x86_64-w64-mingw32". # Installing packages -------------------------------------------------------- - Installing pak ... OK [linked from cache] Successfully installed 1 package in 35 milliseconds. Traceback (most recent calls last): 6: renv::restore() 5: renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclude, prompt = prompt, project = project) 4: pak$pkg_install(pkg = remotes, ask = prompt) 3: remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), list(pkg = pkg, lib = lib, upgrade = upgrade, ask = ask, start = start, dependencies = dependencies, loaded = loaded_packages(lib))) 2: err$throw(res$error) 1: base::stop(cond) stderr: ℹ Loading metadata database ✔ Loading metadata database ... done Error: ! error in pak subprocess Caused by error: ! Could not solve package dependencies: * R.cache@0.17.0: dependency conflict * R.oo@1.27.1: dependency conflict * R6@2.6.1: dependency conflict * Rcpp@1.1.0: dependency conflict * R.utils@2.13.0: dependency conflict * R.methodsS3@1.8.2: dependency conflict * V8@8.0.1: dependency conflict * backports@1.5.0: dependency conflict * cli@3.6.5: dependency conflict * codetools@0.2-20: dependency conflict * digest@0.6.37: dependency conflict * here@1.0.2: dependency conflict * highr@0.11: Can't install dependency xfun (>= 0.18) * xfun: Conflicts with xfun@0.53 * hunspell@3.0.6: dependency conflict * jsonlite@2.0.0: dependency conflict * jsonvalidate@1.5.0: dependency conflict * knitr@1.50: Can't install dependency xfun (>= 0.51) * rprojroot@2.1.1: dependency conflict * spelling@2.3.2: Can't install dependency knitr * stringi@1.8.7: dependency conflict * styler@1.11.0: dependency conflict * vctrs@0.6.5: dependency conflict * stringr@1.5.2: dependency conflict * callr@3.7.6: dependency conflict * commonmark@2.0.0: dependency conflict * cpp11@0.5.2: dependency conflict * curl@7.0.0: dependency conflict * desc@1.4.3: dependency conflict * docopt@0.7.2: dependency conflict * xmlparsedata@1.0.5: dependency conflict * yaml@2.3.10: dependency conflict * brew@1.0-10: dependency conflict * evaluate@1.0.5: dependency conflict * fs@1.6.6: dependency conflict * glue@1.8.0: dependency conflict * withr@3.0.2: dependency conflict * xml2@1.4.1: dependency conflict * lazyeval@0.2.2: dependency conflict * lifecycle@1.0.4: dependency conflict * lintr@3.2.0: Can't install dependency knitr * rex@1.2.1: dependency conflict * rlang@1.1.6: dependency conflict * roxygen2@7.3.3: Can't install dependency knitr * magrittr@2.0.4: dependency conflict * pkgload@1.4.1: dependency conflict * pkgbuild@1.4.8: dependency conflict * processx@3.8.6: dependency conflict * ps@1.9.1: dependency conflict * purrr@1.1.0: dependency conflict --- Backtrace: 1. renv::restore() 2. renv:::renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclu… 3. pak$pkg_install(pkg = remotes, ask = prompt) 4. pak:::remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...)… 5. err$throw(res$error) --- Subprocess backtrace: 1. base::withCallingHandlers(cli_message = function(msg) { … 2. get("pkg_install_make_plan", asNamespace("pak"))(...) 3. prop$stop_for_solution_error() 4. private$plan$stop_for_solve_error() 5. pkgdepends:::pkgplan_stop_for_solve_error(self, private) 6. base::throw(new_error("Could not solve package dependencies:\n", msg, … 7. | base::signalCondition(cond) 8. global (function (e) … Execution halted Check the log at C:\Users\name\.cache\pre-commit\pre-commit.log **Expected behavior** That precommit works. **Additional context** - My operating system is: Windows 11 - [ ] My project uses {renv}. - [x] the output of `packageVersion('renv')` 1.1.5
2 条评论