extendr / rextendr

An R package that helps scaffolding extendr-enabled packages or compiling Rust code dynamically
https://extendr.github.io/rextendr/
Other
197 stars 27 forks source link

feat: System checks on `SystemRequirements` (cargo, rustc, msrv) #379

Closed albersonmiranda closed 2 months ago

albersonmiranda commented 2 months ago

What type of PR is this? (check all applicable)

Description

This PR updates use_cran_defaults() to check SystemRequirements field in DESCRIPTION and perform a system check for both Rust and Cargo tools. If any of them is not found, build fails with a message to install them. If they are found, it checks for the minimum version of rustc. If it is lower than specified in SystemRequirements, build fails with a message stating both installed and minimum version required. Finally, if all tests pass, it prints the version of cargo and rustc found, which will be used to build the package.

Related Tickets & Documents

Added/updated tests?

Goal is code coverage percentage at 80% and above.

Release checklist

CGMossa commented 2 months ago

Just wanted to say, this looks impressive already. Keep up the good work @albersonmiranda!

albersonmiranda commented 2 months ago

@Ilia-Kosenkov After https://github.com/extendr/extendr/pull/844 it is now passing R CMD Check locally and it's ready to review.

Ilia-Kosenkov commented 2 months ago

I got it that the version in DESCRIPTION is annoying for snapshot tests, I will fix it after you merge this.