-
Notifications
You must be signed in to change notification settings - Fork 121
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
Maybe should replace the cargo-script
with rust-script
#516
Comments
ya, i know of that. i also enable cargo play as an alternative. |
I tried it, and there is basically no problem. [tasks.hello]
script_runner = "@rust"
script = '''
fn main() {
println!("hello world!!");
}
''' |
And it not a cargo subcommand |
if its not a cargo subcommand it can still be used easily but will require a bit more code changes. |
rust-script is now supported. its not the default runner (just to make sure i do'nt break other projects for now) [env]
CARGO_MAKE_RUST_SCRIPT_PROVIDER = "rust-script" its currently in the 0.32.13 dev branch. |
@umaYnit once you verify this one is good for you, i'll publish a new cargo-make version with all the fixes i pushed based on your feedback |
@umaYnit seems cargo-script is really broken so will make rust-script default after all |
@umaYnit since cargo-script was so broken lately, i decided to also release a new cargo make version already. |
Execute compilation for the current project in rust-script, and the compiled product will be generated in the cache directory of rust-script, not the current project dir. test case: [config]
skip_core_tasks = true
[tasks.build]
# env = { "CARGO_MAKE_RUST_SCRIPT_PROVIDER" = "cargo-script" }
script_runner = "@rust"
script = '''
fn main() {
if !std::process::Command::new("cargo")
.args(&["make", "_build"])
.spawn()
.unwrap()
.wait()
.unwrap()
.success() { panic!() }
println!("success");
}
'''
[tasks._build]
command = "cargo"
args = ["build", "--release"] |
is that an issue? |
i think cargo script did the same |
cargo script not, will generated in project dir. |
strange. i always deleted some binary dir that cargo script created in the .cargo folder if i'm not wrong. |
I don’t see the relevant parameters in rust-script, maybe I should open an issue in rust-script. |
I tried to use
cargo-script
to write a build script, and My project was cross-compiled, so I tried to set a separate environment variable forcargo-script
, but it still didn’t work. My script like this.I checked the project and found this description:
And the issue pointed out that the project is not very actived, rust-script is a maintained fork of cargo-script.
DanielKeep/cargo-script#71
The text was updated successfully, but these errors were encountered: