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

Embedded nul in string #734

Closed
stephenashton-dhsc opened this issue Jan 9, 2025 · 3 comments
Closed

Embedded nul in string #734

stephenashton-dhsc opened this issue Jan 9, 2025 · 3 comments

Comments

@stephenashton-dhsc
Copy link

If I install the version of pak from CRAN, I sometimes get issues such as the following:

> pak::pkg_install("curl")
                                                                           
→ Will install 1 package.
→ The package (932.96 kB) is cached.
+ curl   6.1.0 [bld][cmp]
ℹ No downloads are needed, 1 pkg (932.96 kB) is cached
ℹ Building curl 6.1.0
✖ Failed to build curl 6.1.0 (1s)                           
Error:                                                      
! error in pak subprocess
Caused by error in `stop_task_build(state, worker)`:
! Failed to build source package curl.
Full installation output:
Error in rawToChar(block[seq_len(ns)]) : 
  embedded nul in string: 'PK\003\004\n\0\0\0\0\0EW)Z\0\0\0\0\0\0\0\0\0\0\0\0\005\0\0\0curl/PK\003\004\024\0\002\0\b\0BW)Z\xb9K\xea\xfc\xb0\003\0\00\006\0\0\020\0\0\0curl/DESCRIPTIONmTmO\xdbH\020\xfen\xc9\xffa\xe4/\004\x9d\xed$\xce'
Type .Last.error to see the more details.

However, if I switch to the prebuild binary version, there are no issues.

The sessionInfo() is:

> sessionInfo()
R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default


locale:
[1] LC_COLLATE=English_United Kingdom.utf8  LC_CTYPE=English_United Kingdom.utf8    LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.utf8    

time zone: Europe/London
tzcode source: internal

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

loaded via a namespace (and not attached):
[1] compiler_4.4.1  here_1.0.1      rprojroot_2.0.4 tools_4.4.1     pak_0.8.0   
@stephenashton-dhsc
Copy link
Author

Actually it's now failing under the pre-built version as well now.

I'll have a bit of a poke around as it might be an issue with my system.

@gaborcsardi
Copy link
Member

This is coming from utils::untar() when it is trying to uncompress the source R package file. First I would try to clean the cache to make sure it is not a corrupt package file:

pak::cache_clean()

This is the correct hash of the curl 6.1.0 source file:

pak::cache_list(package = "curl", platform = "source")[, c("version", "sha256")]
# A data frame: 1 × 2
  version sha256
  <chr>   <chr>
1 6.1.0   81d45525057fe21be3d57071e65032114c9014392454dd40ff32ca5e5ae2c539

@stephenashton-dhsc
Copy link
Author

That managed to fix it! 👍 Massive thanks!

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