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

Add support for Rust via cargo #742

Closed
seivan opened this issue Feb 13, 2025 · 3 comments · Fixed by #750
Closed

Add support for Rust via cargo #742

seivan opened this issue Feb 13, 2025 · 3 comments · Fixed by #750
Assignees
Labels
enhancement New feature or request

Comments

@seivan
Copy link

seivan commented Feb 13, 2025

Not exactly sure how, but I imagine it's:

Recognize Rust

Should add "rust": "rs" to
https://github.com/stateful/runme/blob/654dda374d6968620bbcc2ce4a6ef0567c88535a/internal/command/command_file.go#L106
and
https://github.com/stateful/runme/blob/654dda374d6968620bbcc2ce4a6ef0567c88535a/internal/runner/command.go#L598
(Why aren't these shared?)

Figure out Rust script

My suggestion is to use rust-script like

	"rust":   {"rust-script"},
	"rs":     {"rust-script"}

to
https://github.com/stateful/runme/blob/654dda374d6968620bbcc2ce4a6ef0567c88535a/internal/command/command.go#L260
and
https://github.com/stateful/runme/blob/654dda374d6968620bbcc2ce4a6ef0567c88535a/internal/runner/command.go#L625

Run the Rust script

This looks like it runs a sample code, but I am not exactly sure, but whatever it is it could be adjusted for Rust as well.

https://github.com/stateful/runme/blob/654dda374d6968620bbcc2ce4a6ef0567c88535a/internal/command/command_file_test.go#L62


Now regarding actually running, or more specifically running anything, I strongly advice looking into this tool this would simplify running any code cell, and even take advantage of docker to deal with system dependencies.
But that's a different issue

@sourishkrout
Copy link
Contributor

Nice, it's working, @seivan. I'm planning to get this into the next minor release.

Image

@sourishkrout sourishkrout self-assigned this Feb 20, 2025
@sourishkrout sourishkrout added the enhancement New feature or request label Feb 20, 2025
@seivan
Copy link
Author

seivan commented Feb 21, 2025

Nice, it's working, @seivan. I'm planning to get this into the next minor release.

Hell yeah, you actually managed to get it to work!

Did you use #743 or rust-script

Edit: One thing to make sure if is make sure is not to clutters the filesystem with whatever artifacts and builds that are made by using some $TMPDIR or just delete after execution, because Rust builds get massive.

I am not 100% sure how Runme currently builds and executes and what the lifecycle is.

@sourishkrout
Copy link
Contributor

Will be included in next minor or patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants