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

Generate bindings in xtasks, not in the build script #189

Open
yutannihilation opened this issue Oct 29, 2023 · 3 comments
Open

Generate bindings in xtasks, not in the build script #189

yutannihilation opened this issue Oct 29, 2023 · 3 comments

Comments

@yutannihilation
Copy link
Contributor

This is inspired by extendr/extendr#611. I think this repository should also have xtasks.

There are mainly two motivations to separate the bindings generation from the compilation:

  1. make the compilation of less troubles like Should not use libR-sys 0.5.0 extendr#580
  2. target wasm (I'm not sure if this is even possible, but I think it's a matter of time until not a few package authors and users wish the Rust-powered package on webR)
@CGMossa
Copy link
Member

CGMossa commented Oct 29, 2023

I'm glad you like xtask! I've been working on a libR-sys xtask for a while now... But I was attempting to see, if I could make a new feature with it.

I'll post what I have later..

@JosiahParry
Copy link

I would like to help work on this. What would we like the xtask ui to be like?

If i understand correctly the xtask should be ran once per distro and R version. If a machine has more than one version of R available we can build bindings for all versions of R on that distro. We inherit the target from the machine running the xtask.

Should it look something like libr-sys xtask --build --versions 4.2 4.3 4.4 ? Where we can provide multiple versions in the flag?

@CGMossa
Copy link
Member

CGMossa commented Jun 25, 2024

I think a good initial interface, is the one that makes the environment variables of build.rs available as command-line commands.

I don't think you can add versions. What you can do, is add r_home as a path, and then that should be the thing that can be configured (via rig, or whatever the way it is done in CI).

Regarding clap and its Rust requirements, we don't actually need to observe any restrictions like that in xtask. It is a simple binary compiled to help CI for libR-sys. We make sure that publish = false in the Cargo.toml of xtask as well, so that works.

I briefly experimented with what other features a libR-sys xtask should contain, and got these going: https://github.com/CGMossa/miniextendr/tree/main/xtask/ I don't think this is useful, however.

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

3 participants