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

huak panicked at git package with @ specifier #712

Open
narma opened this issue Aug 10, 2023 · 9 comments
Open

huak panicked at git package with @ specifier #712

narma opened this issue Aug 10, 2023 · 9 comments
Labels
bug Something isn't working
Milestone

Comments

@narma
Copy link

narma commented Aug 10, 2023

command huak add --group dev black

Actually it failed in parse_version_specifiers_str with following input
dsproto @ git+ssh://[email protected]/dataspike-io/proto.git@a4d900ee9b9084d54d7a895b8aa1b9e366043211

Crash report:

name = "huak"
operating_system = "Ubuntu 22.04 (jammy) [64-bit]"
crate_version = "0.0.19"
explanation = """
Panic occurred in file 'src/huak/package.rs' at line 95
"""
cause = "package version specifier(s)"
method = "Panic"
backtrace = """

   0: 0x563f27d08851 - core::panicking::panic_display::ha103dd28e5023b08
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:147
   1: 0x563f27d087fb - core::panicking::panic_str::h940bf021f492dc8c
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:131
   2: 0x563f2788c246 - core::option::expect_failed::h09b982639336e7ea
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/option.rs:2045
   3: 0x563f2791edc6 - <huak::package::Package as core::str::traits::FromStr>::from_str::h2ddcf3820a1b6fe6
   4: 0x563f278f3527 - huak::python_environment::PythonEnvironment::installed_packages::h2da3e714ed8c231b
   5: 0x563f279377f8 - huak::ops::add::add_project_optional_dependencies::h1f5112ea26d4ecf0
   6: 0x563f278910f3 - huak::cli::Cli::run::h3b2926740f9fb80d
   7: 0x563f278a617b - huak::main::hf6e7d75493193a6d
   8: 0x563f278a9143 - std::sys_common::backtrace::__rust_begin_short_backtrace::hcbd7532e3ac9aab6
   9: 0x563f278a9159 - std::rt::lang_start::{{closure}}::hb810a0c820204af6
  10: 0x563f27cdb1dc - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hd6efcd3bec896f2c
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287
                 - std::panicking::try::do_call::hce04e543bb1f4cbb
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487
                 - std::panicking::try::h3342dd4e1f680968
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451
                 - std::panic::catch_unwind::h148ce1e59ac0cee7
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140
                 - std::rt::lang_start_internal::{{closure}}::h25f9dda2057a67fe
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148
                 - std::panicking::try::do_call::h7caaaeaf9401650b
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487
                 - std::panicking::try::he7d15285746cbbc2
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451
                 - std::panic::catch_unwind::h89fb4f50c0301fe0
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140
                 - std::rt::lang_start_internal::h078acd489417d3c1
                at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148
  11: 0x563f278a67c5 - main
  12: 0x7f78dc93fd90 - <unresolved>
  13: 0x7f78dc93fe40 - __libc_start_main
  14: 0x563f2788c8c2 - <unresolved>
  15:        0x0 - <unresolved>"""
@narma narma added the bug Something isn't working label Aug 10, 2023
@narma narma changed the title huak add causes crash huak panicked at package with @ specifier Aug 10, 2023
@narma
Copy link
Author

narma commented Aug 10, 2023

Actually it failed in parse_version_specifiers_str with following input
dsproto @ git+ssh://[email protected]/dataspike-io/proto.git@a4d900ee9b9084d54d7a895b8aa1b9e366043211

It's my dependency from pyproject.toml

@narma narma changed the title huak panicked at package with @ specifier huak panicked at git package with @ specifier Aug 10, 2023
@narma
Copy link
Author

narma commented Aug 10, 2023

Rust backtrace on latest master

thread 'main' panicked at 'package version specifier(s)', crates/huak_ops/src/package.rs:96:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_fmt
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/core/src/panicking.rs:67:14
   2: core::panicking::panic_display
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/core/src/panicking.rs:150:5
   3: core::panicking::panic_str
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/core/src/panicking.rs:134:5
   4: core::option::expect_failed
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/core/src/option.rs:1932:5
   5: core::option::Option<T>::expect
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/core/src/option.rs:898:21
   6: <huak_ops::package::Package as core::str::traits::FromStr>::from_str
             at /home/alzo/s/huak/crates/huak_ops/src/package.rs:95:24
   7: huak_ops::python_environment::PythonEnvironment::installed_packages
             at /home/alzo/s/huak/crates/huak_ops/src/python_environment.rs:211:31
   8: huak_ops::ops::add::add_project_optional_dependencies
             at /home/alzo/s/huak/crates/huak_ops/src/ops/add.rs:97:20
   9: huak::cli::add
             at /home/alzo/s/huak/crates/huak_cli/src/cli.rs:366:13
  10: huak::cli::Cli::run
             at /home/alzo/s/huak/crates/huak_cli/src/cli.rs:217:17
  11: huak::main
             at /home/alzo/s/huak/crates/huak_cli/src/main.rs:17:11
  12: core::ops::function::FnOnce::call_once
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@cnpryer
Copy link
Owner

cnpryer commented Aug 10, 2023

Hi, thanks for the report! What does the version spec look like for the dsproto project?

@narma
Copy link
Author

narma commented Aug 10, 2023

dependency for dsproto declared as "dsproto @ git+ssh://[email protected]/dataspike-io/[email protected]" in my pyproject.toml

@cnpryer
Copy link
Owner

cnpryer commented Aug 10, 2023

What happens if you change to a pep440-compliant version https://peps.python.org/pep-0440/#pre-releases

@cnpryer
Copy link
Owner

cnpryer commented Aug 10, 2023

I have #714 which should at least prevent panics in the future.

@narma
Copy link
Author

narma commented Aug 11, 2023

What happens if you change to a pep440-compliant version https://peps.python.org/pep-0440/#pre-releases

But it actually it's not a version, it's a git tag, it could be also a branch or commit. And it works with pdm.

I have #714 which should at least prevent panics in the future.

Yes, now it prints follwing and exit
error: a version number could not be parsed: dsproto @ git+ssh://[email protected]/dataspike-io/proto.git@a4d900ee9b9084d54d7a895b8aa1b9e366043211

@cnpryer
Copy link
Owner

cnpryer commented Aug 11, 2023

Thanks! It's been a bit, so this is helpful to see. I'll think about a possible temporary solution.

@cnpryer
Copy link
Owner

cnpryer commented Feb 17, 2024

cc #890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants