We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If/when process_set_argv0 is stabilized, we can modify ensure_sealed to set argv[0], which is a current limitation of pentacle.
process_set_argv0
ensure_sealed
argv[0]
Tracking issue: rust-lang/rust#66510
Diff on 5c1b0e0 that works with rustc 1.43.0-nightly (75cf41afb 2020-03-04):
rustc 1.43.0-nightly (75cf41afb 2020-03-04)
diff --git a/src/lib.rs b/src/lib.rs index 57ffcb9..886f473 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,12 +19,12 @@ //! } //! ``` +#![feature(process_set_argv0)] #![deny( missing_copy_implementations, missing_debug_implementations, missing_docs, - rust_2018_idioms, - unstable_features + rust_2018_idioms )] #![warn(clippy::pedantic)] @@ -67,9 +67,13 @@ pub fn ensure_sealed() -> Result<()> { if is_sealed_inner(&file) { Ok(()) } else { - Err(SealedCommand::new(&mut file)? - .args(std::env::args_os().skip(1)) - .exec()) + let mut command = SealedCommand::new(&mut file)?; + let mut args = std::env::args_os().fuse(); + if let Some(arg0) = args.next() { + command.arg0(arg0); + } + command.args(args); + Err(command.exec()) } } diff --git a/tests/ensure_sealed.rs b/tests/ensure_sealed.rs index 185d084..bcda8c6 100644 --- a/tests/ensure_sealed.rs +++ b/tests/ensure_sealed.rs @@ -12,4 +12,5 @@ fn main() { pentacle::ensure_sealed().unwrap(); assert_eq!(pentacle::is_sealed(), true); + assert!(std::env::args().next().unwrap().contains("ensure_sealed")); }
The text was updated successfully, but these errors were encountered:
process_set_argv0 was stabilized in 1.45. Can you apply the patch?
Sorry, something went wrong.
Yes. I'll see if I can do that this week.
a4454be
Successfully merging a pull request may close this issue.
If/when
process_set_argv0
is stabilized, we can modifyensure_sealed
to setargv[0]
, which is a current limitation of pentacle.Tracking issue: rust-lang/rust#66510
Diff on 5c1b0e0 that works with
rustc 1.43.0-nightly (75cf41afb 2020-03-04)
:The text was updated successfully, but these errors were encountered: