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

Task automation for the repo #179

Open
vados-cosmonic opened this issue Nov 29, 2024 · 3 comments
Open

Task automation for the repo #179

vados-cosmonic opened this issue Nov 29, 2024 · 3 comments

Comments

@vados-cosmonic
Copy link

The instructions in the README are certainly very easy to follow at present, but I wanted to add some leverage there with a top level Make file -- and want to gauge interest/see if that's something people would be open to.

GNU make is great and all, but to avoid the pitfalls and complexity that can sometimes come with it, I'd like to do one of the following:

  • Create a top level Rust workspace so we can leverage cargo xtask (no extra dependencies, but would require the Rust toolchain more strongly -- e.g. we could update the documentation to run xtasks that run cmake underneath)

  • Use a more general task runner like just

My goals with this change are to add a little leverage to enable easier setup and ongoing usage for devs -- whether it's explicitly checking whether dependencies are downloaded, checking/printing versions of all involved tooling, orchestrating multi-language build targets, etc.

@tschneidereit
Copy link
Member

I agree that more automation for some of the core bootstrapping and development loop tasks would be great, yes!

At the same time, I'd be a bit wary of adding additional requirements that have to be met before anything else happens. Right now, that's just CMake and rustup, and arguably we could eliminate the latter if we wanted to.

One option to perhaps explore is whether CMake workflows get us sufficiently far: combined with presets, they would allow us to reduce the "clone the repo --> have tests passing" process to something like

  1. install CMake and rustup
  2. clone the repo
  3. run cmake --workflow --preset test-debug

After these steps, we'd have a cmake-build-debug folder with a build that has passed tests.

@vados-cosmonic
Copy link
Author

At the same time, I'd be a bit wary of adding additional requirements that have to be met before anything else happens.

Yeah I definitely understand/agree with this -- one thing I want to note is that cargo xtask is actually not a separate tool -- it's a convention (and Cargo.toml config) rather than something you need to install!

So running an xtask looks like this:

cargo xtask deploy

Right now, that's just CMake and rustup, and arguably we could eliminate the latter if we wanted to.

Ah did I miss this? When you say rustup do you mean literally rustup and not a-version-of-the-rust-toolchain-is-installed?

Given the Rust bits, I was assuming we could depend on cargo being present/installed. If we can't then cargo xtask is certainly a new dep.

One option to perhaps explore is whether CMake workflows get us sufficiently far: combined with presets, they would allow us to reduce the "clone the repo --> have tests passing" process to something like

TIL about CMake workflows! I'm not so familiar with CMake but I guess the two no-dep choices are:

  • CMake workflows
  • cargo xtask

I like the xtask mostly because I'm more familiar with Rust than CMake, and since it's a fully general language we can make use of the Rust ecosystem (for better or worse, complexity wise!).

What do you think -- if CMake workflows looks more exciting I can take a stab at building it out to see how it would work, but IMO we could orchestrate CMake itself (and optionally even install it, if it's missing) from xtask.

@andreiltd
Copy link
Contributor

andreiltd commented Dec 2, 2024

Oh, I only just saw this. I've been maintaining a justfile for myself but maybe someone can find it useful too. I pushed it here:
#180

just has pretty much become the standard nowadays. So +1 from me :)

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