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't install package with latin1 encoding in R-devel #404

Closed
gaborcsardi opened this issue Aug 18, 2022 · 2 comments
Closed

Can't install package with latin1 encoding in R-devel #404

gaborcsardi opened this issue Aug 18, 2022 · 2 comments

Comments

@gaborcsardi
Copy link
Member

Probably a bug in desc. We are using gsub() on a string with invalid (?) encoding settings, and this is not allowed any more:

❯ pak::pkg_install("sfsmisc?source")
✔ Loading metadata database ... done

→ Will install 1 package.
→ The package (181.59 kB) is cached.
+ sfsmisc   1.1-13 👷🏼
ℹ No downloads are needed, 1 pkg (181.59 kB) is cached
ℹ Building sfsmisc 1.1-13
✔ Built sfsmisc 1.1-13 (1.9s)
Error:
! error in pak subprocess
Caused by error in `gsub("\n([^[:blank:]])", "\n \\1", val)`:
! input string 1 is invalid
Type .Last.error to see the more details.
❯ .Last.error
<callr_error/rlib_error_3_0/rlib_error/error>
Error:
! error in pak subprocess
Caused by error in `gsub("\n([^[:blank:]])", "\n \\1", val)`:
! input string 1 is invalid
---
Backtrace:
1. pak::pkg_install("sfsmisc?source")
2. pak:::remote(function(...) get("pkg_install_do_plan", asNamespace("pak"))(...), …
3. err$throw(res$error)
---
Subprocess backtrace:
 1. base::withCallingHandlers(cli_message = function(msg) { …
 2. get("pkg_install_do_plan", asNamespace("pak"))(...)
 3. pkgdepends::install_package_plan(plan = plan, lib = lib, num_workers = num…
 4. base::withCallingHandlers({ …
 5. pkgdepends:::handle_events(state, events)
 6. pkgdepends:::handle_event(state, i)
 7. proc$get_result()
 8. processx:::process_get_result(self, private)
 9. private$post_process()
10. pkgdepends:::install_extracted_binary(filename, lib_cache, pkg_cache, lib, …
11. pkgdepends:::add_metadata(pkg$path, metadata)
12. base::do.call(desc::desc_set, c(as.list(metadata), list(file = source_desc)))
13. (function (..., file = ".", normalize = FALSE) …
14. desc$write(file = file)
15. desc:::idesc_write(self, private, file)
16. base::write.dcf(mat, file = tmp, keep.white = names(private$data))
17. base::fmt(nmx[j], xj[i], foldable[j])
18. base::sprintf("%s: %s", tag, gsub("\n([^[:blank:]])", "\n \\1", val))
19. base::gsub("\n([^[:blank:]])", "\n \\1", val)
20. base::.handleSimpleError(function (e) …
21. global h(simpleError(msg, call))
@gaborcsardi
Copy link
Member Author

One could argue that it is a bug in base::write.dcf(), but that's not an easily winnable argument.... so we'll just need another workaround re. encodings in desc...

@gaborcsardi
Copy link
Member Author

Fixed in dev desc: r-lib/desc@f983d85

We'll require dev desc temporarily.

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