r-rust / gifski

R wrapper for the 'gifski' Rust Cargo crate.
Other
73 stars 4 forks source link

`xz-utils` required for installation #29

Open bart1 opened 5 days ago

bart1 commented 5 days ago

I noticed installation failed in the docker container rocker/tidyverse see below. This is resolved when xz-utils are installed. It might be good to add this to the system requirements or atleast improve the error message

(base) ...@...:~$ docker run rocker/tidyverse /bin/bash -c 'apt-get update; apt-get install -yy  cargo; R -e "remotes::install_cran(\"gifski\")"'
Get:1 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Get:2 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Packages [15.3 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB]
Get:4 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [586 kB]
Get:5 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages [548 kB]
Get:6 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [725 kB]
Get:7 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]
Get:9 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [331 kB]
Get:10 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,808 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [117 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [19.3 MB]
Get:13 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages [548 kB]
Get:14 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages [18.4 kB]
Get:15 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [812 kB]
Get:16 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [932 kB]
Get:17 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [11.8 kB]
Fetched 26.4 MB in 4s (7,360 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libstd-rust-1.75 libstd-rust-dev rustc
Suggested packages:
  cargo-doc llvm-17 lld-17 clang-17
The following NEW packages will be installed:
  cargo libstd-rust-1.75 libstd-rust-dev rustc
0 upgraded, 4 newly installed, 0 to remove and 8 not upgraded.
Need to get 69.9 MB of archives.
After this operation, 296 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libstd-rust-1.75 amd64 1.75.0+dfsg0ubuntu1-0ubuntu7.1 [20.0 MB]
Get:2 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libstd-rust-dev amd64 1.75.0+dfsg0ubuntu1-0ubuntu7.1 [40.6 MB]
Get:3 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 rustc amd64 1.75.0+dfsg0ubuntu1-0ubuntu7.1 [3,183 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 cargo amd64 1.75.0+dfsg0ubuntu1-0ubuntu7.1 [6,053 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 69.9 MB in 5s (12.8 MB/s)
Selecting previously unselected package libstd-rust-1.75:amd64.
(Reading database ... 26884 files and directories currently installed.)
Preparing to unpack .../libstd-rust-1.75_1.75.0+dfsg0ubuntu1-0ubuntu7.1_amd64.deb ...
Unpacking libstd-rust-1.75:amd64 (1.75.0+dfsg0ubuntu1-0ubuntu7.1) ...
Selecting previously unselected package libstd-rust-dev:amd64.
Preparing to unpack .../libstd-rust-dev_1.75.0+dfsg0ubuntu1-0ubuntu7.1_amd64.deb ...
Unpacking libstd-rust-dev:amd64 (1.75.0+dfsg0ubuntu1-0ubuntu7.1) ...
Selecting previously unselected package rustc.
Preparing to unpack .../rustc_1.75.0+dfsg0ubuntu1-0ubuntu7.1_amd64.deb ...
Unpacking rustc (1.75.0+dfsg0ubuntu1-0ubuntu7.1) ...
Selecting previously unselected package cargo.
Preparing to unpack .../cargo_1.75.0+dfsg0ubuntu1-0ubuntu7.1_amd64.deb ...
Unpacking cargo (1.75.0+dfsg0ubuntu1-0ubuntu7.1) ...
Setting up libstd-rust-1.75:amd64 (1.75.0+dfsg0ubuntu1-0ubuntu7.1) ...
Setting up libstd-rust-dev:amd64 (1.75.0+dfsg0ubuntu1-0ubuntu7.1) ...
Setting up rustc (1.75.0+dfsg0ubuntu1-0ubuntu7.1) ...
Setting up cargo (1.75.0+dfsg0ubuntu1-0ubuntu7.1) ...
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...

R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> remotes::install_cran("gifski")
Installing 1 packages: gifski
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://p3m.dev/cran/__linux__/noble/latest/src/contrib/gifski_1.32.0-1.tar.gz'
Content type 'binary/octet-stream' length 7178057 bytes (6.8 MB)
==================================================
downloaded 6.8 MB

* installing *source* package ‘gifski’ ...
** package ‘gifski’ successfully unpacked and MD5 sums checked
** using staged installation
Using /usr/bin/cargo
Rustc version: rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball)
** libs
using C compiler: ‘gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0’
gcc -I"/usr/local/lib/R/include" -DNDEBUG   -I/usr/local/include   -pthread -fvisibility=hidden -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c wrapper.c -o wrapper.o
if [ -f myrustlib/vendor.tar.xz ]; then tar xf myrustlib/vendor.tar.xz && mkdir -p /tmp/RtmpEo5LiX/R.INSTALLd76999c2e3/gifski/src/.cargo && cp myrustlib/vendor-config.toml /tmp/RtmpEo5LiX/R.INSTALLd76999c2e3/gifski/src/.cargo/config.toml; fi
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
make: *** [Makevars:14: myrustlib/target/release/libmyrustlib.a] Error 2
ERROR: compilation failed for package ‘gifski’
* removing ‘/usr/local/lib/R/site-library/gifski’

The downloaded source packages are in
    ‘/tmp/RtmpyRrnWl/downloaded_packages’
> 
> 
Warning message:
In i.p(...) : installation of package ‘gifski’ had non-zero exit status
jeroen commented 5 days ago

Thanks. Using xz is the official R policy on Rust packages, so I think it should be part of the default R installation and we may assume it in packages. But maybe the rocker folks think different. https://cran.r-project.org/web/packages/using_rust.html

bart1 commented 3 days ago

Do you think this should then be brought up in the rocker repository for a general solution?

jeroen commented 3 days ago

Yes I think so. I don't think it makes sense for R packages to test for the presence of standard tooling that is assumed by R.