-
Notifications
You must be signed in to change notification settings - Fork 26
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
musl+gcompat error #57
Comments
How is it possible not to have the executable path? Isn't this against the standard?
Damn... |
I've reproduced this on an M1 Mac:
|
@Conaclos Looks like this will be working in Rust 1.79: rust-lang/rust#124447. |
Nice! Even better then fixing it locally. |
I ran into this problem, but in a different context: I have a project that uses the same codebase for both native and wasm builds. I get this error on the wasm build. At the moment I'm handling it in my app, but it feels like the wrong place to handle it. In theory, I think adding a conditional to pub fn from_env() -> Self {
let mut args: Vec<_> = std::env::args_os().collect();
if args.len() > 0 {
args.remove(0);
}
Arguments(args)
} Would a PR adding that conditional be accepted, @RazrFalcon? Or should I just stick to the workaround in my project? (Either way, thank you for making pico-args!) |
The problem is that I have to know if the first argument an exe path or not and I don't. You logic will not work for the most basic cases like The only solution I can think of is adding |
Hi! I tried to use a rust crate that relies on pico-args using Alpine Linux (Musl-based distrib) and gcompat (glibc compatibility layer). I got the following error:
Message: removal index (is 0) should be < len (is 0)
at the following line: https://github.com/RazrFalcon/pico-args/blob/master/src/lib.rs#L127
It could be nice to add a defensive check and then removing the path only if it is present.
The text was updated successfully, but these errors were encountered: