aswinnnn / pyscan

python dependency vulnerability scanner, written in Rust.
MIT License
184 stars 6 forks source link

cannot install via pip on Ubuntu 20.04 #10

Closed jugmac00 closed 1 year ago

jugmac00 commented 1 year ago

Describe the bug compilation error during installation

To Reproduce On Ubuntu 20.04, inside a Python 3.8 virtual environment, run pip install pyscan-rs..

❯ pip install pyscan-rs
Collecting pyscan-rs
  Using cached pyscan_rs-0.1.5.tar.gz (613 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyscan-rs
  Building wheel for pyscan-rs (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyscan-rs (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [190 lines of output]
      Running `maturin pep517 build-wheel -i /tmp/venv/bin/python --compatibility off`
      📦 Including license file "/tmp/pip-install-gagoeh84/pyscan-rs_ae881a838eaf4ff2971e48f40e49b2f3/LICENSE"
      🔗 Found bin bindings
      📡 Using build options bindings from pyproject.toml
         Compiling libc v0.2.144
         Compiling proc-macro2 v1.0.57
         Compiling autocfg v1.1.0
         Compiling unicode-ident v1.0.8
         Compiling quote v1.0.27
         Compiling cfg-if v1.0.0
         Compiling cc v1.0.79
         Compiling once_cell v1.18.0
         Compiling log v0.4.17
         Compiling bitflags v1.3.2
         Compiling pin-project-lite v0.2.9
         Compiling pkg-config v0.3.27
         Compiling serde v1.0.163
         Compiling futures-core v0.3.28
         Compiling memchr v2.5.0
         Compiling bytes v1.4.0
         Compiling indexmap v1.9.3
         Compiling tokio v1.28.1
         Compiling itoa v1.0.6
         Compiling syn v2.0.16
         Compiling slab v0.4.8
         Compiling futures-task v0.3.28
         Compiling hashbrown v0.12.3
         Compiling openssl-sys v0.9.87
         Compiling io-lifetimes v1.0.10
         Compiling tracing-core v0.1.31
         Compiling mio v0.8.6
         Compiling socket2 v0.4.9
         Compiling num_cpus v1.15.0
         Compiling foreign-types-shared v0.1.1
         Compiling version_check v0.9.4
         Compiling semver v1.0.17
         Compiling openssl v0.10.52
         Compiling rustix v0.37.19
         Compiling futures-util v0.3.28
         Compiling fnv v1.0.7
         Compiling ahash v0.8.3
         Compiling http v0.2.9
         Compiling foreign-types v0.3.2
         Compiling tracing v0.1.37
         Compiling psm v0.1.21
         Compiling native-tls v0.2.11
         Compiling httparse v1.8.0
         Compiling futures-channel v0.3.28
         Compiling pin-utils v0.1.0
         Compiling tinyvec_macros v0.1.1
         Compiling linux-raw-sys v0.3.7
         Compiling futures-io v0.3.28
         Compiling futures-sink v0.3.28
         Compiling tinyvec v1.6.0
         Compiling stacker v0.1.15
         Compiling num-traits v0.2.15
         Compiling utf8parse v0.2.1
         Compiling percent-encoding v2.2.0
         Compiling try-lock v0.2.4
         Compiling openssl-probe v0.1.5
         Compiling want v0.3.0
         Compiling unicode-normalization v0.1.22
         Compiling form_urlencoded v1.1.0
         Compiling anstyle-parse v0.2.0
         Compiling lenient_semver_version_builder v0.4.2
         Compiling is-terminal v0.4.7
         Compiling http-body v0.4.5
         Compiling num-integer v0.1.45
         Compiling httpdate v1.0.2
         Compiling ryu v1.0.13
         Compiling anstyle-query v1.0.0
         Compiling colorchoice v1.0.0
         Compiling serde_derive v1.0.163
         Compiling tokio-macros v2.1.0
         Compiling openssl-macros v0.1.1
         Compiling tower-service v0.3.2
         Compiling anstyle v1.0.0
         Compiling unicode-bidi v0.3.13
         Compiling anstream v0.3.2
         Compiling idna v0.3.0
         Compiling hashbrown v0.13.2
         Compiling lenient_semver_parser v0.4.2
         Compiling heck v0.4.1
         Compiling strsim v0.10.0
         Compiling serde_json v1.0.96
         Compiling winnow v0.4.6
         Compiling clap_lex v0.4.1
         Compiling clap_builder v4.2.7
         Compiling clap_derive v4.2.0
         Compiling chumsky v1.0.0-alpha.4
         Compiling lenient_version v0.4.2
         Compiling url v2.3.1
         Compiling tokio-util v0.7.8
         Compiling tokio-native-tls v0.3.1
         Compiling h2 v0.3.19
         Compiling time v0.1.45
         Compiling aho-corasick v1.0.1
         Compiling encoding_rs v0.8.32
         Compiling mime v0.3.17
         Compiling serde_spanned v0.6.1
         Compiling toml_datetime v0.6.1
         Compiling hyper v0.14.26
         Compiling toml_edit v0.19.8
         Compiling serde_urlencoded v0.7.1
         Compiling regex-syntax v0.7.1
         Compiling hyper-tls v0.5.0
         Compiling unicode-width v0.1.10
         Compiling base64 v0.21.0
         Compiling ipnet v2.7.2
         Compiling lazy_static v1.4.0
         Compiling iana-time-zone v0.1.56
         Compiling chrono v0.4.24
         Compiling console v0.15.5
         Compiling reqwest v0.11.17
         Compiling regex v1.8.1
         Compiling toml v0.7.3
         Compiling pep-508 v0.3.0
         Compiling clap v4.2.7
         Compiling lenient_semver v0.4.2
         Compiling pyscan v0.1.5 (/tmp/pip-install-gagoeh84/pyscan-rs_ae881a838eaf4ff2971e48f40e49b2f3)
      error[E0658]: use of unstable library feature 'once_cell'
       --> src/main.rs:5:5
        |
      5 | use std::sync::OnceLock;
        |     ^^^^^^^^^^^^^^^^^^^
        |
        = note: see issue #74465 <https://github.com/rust-lang/rust/issues/74465> for more information

      error[E0658]: use of unstable library feature 'once_cell'
        --> src/main.rs:89:19
         |
      89 | static ARGS: Lazy<OnceLock<Cli>> =  Lazy::new(|| {OnceLock::from(Cli::parse())});
         |                   ^^^^^^^^^^^^^
         |
         = note: see issue #74465 <https://github.com/rust-lang/rust/issues/74465> for more information

      error[E0658]: use of unstable library feature 'once_cell'
        --> src/main.rs:89:51
         |
      89 | static ARGS: Lazy<OnceLock<Cli>> =  Lazy::new(|| {OnceLock::from(Cli::parse())});
         |                                                   ^^^^^^^^
         |
         = note: see issue #74465 <https://github.com/rust-lang/rust/issues/74465> for more information

      error[E0658]: use of unstable library feature 'once_cell'
         --> src/parser/structs.rs:148:17
          |
      148 |         if ARGS.get().unwrap().pip {
          |                 ^^^
          |
          = note: see issue #74465 <https://github.com/rust-lang/rust/issues/74465> for more information

      error[E0658]: use of unstable library feature 'once_cell'
         --> src/parser/structs.rs:150:24
          |
      150 |         } else if ARGS.get().unwrap().pypi {
          |                        ^^^
          |
          = note: see issue #74465 <https://github.com/rust-lang/rust/issues/74465> for more information

      error[E0658]: use of unstable library feature 'once_cell'
         --> src/main.rs:106:15
          |
      106 |     if !&ARGS.get().unwrap().cache_off {
          |               ^^^
          |
          = note: see issue #74465 <https://github.com/rust-lang/rust/issues/74465> for more information

      error[E0658]: use of unstable library feature 'once_cell'
         --> src/main.rs:111:17
          |
      111 |     match &ARGS.get().unwrap().subcommand {
          |                 ^^^
          |
          = note: see issue #74465 <https://github.com/rust-lang/rust/issues/74465> for more information

      error[E0658]: use of unstable library feature 'once_cell'
         --> src/main.rs:147:30
          |
      147 |     if let Some(dir) = &ARGS.get().unwrap().dir { parser::scan_dir(dir.as_path()).await }
          |                              ^^^
          |
          = note: see issue #74465 <https://github.com/rust-lang/rust/issues/74465> for more information

      For more information about this error, try `rustc --explain E0658`.
      error: could not compile `pyscan` due to 8 previous errors
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `"cargo" "rustc" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/pip-install-gagoeh84/pyscan-rs_ae881a838eaf4ff2971e48f40e49b2f3/Cargo.toml" "--release" "--bin" "pyscan"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/tmp/venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyscan-rs
Failed to build pyscan-rs
ERROR: Could not build wheels for pyscan-rs, which is required to install pyproject.toml-based projects

Expected behavior

Desktop (please complete the following information):

Additional context Using rust version 1.67.1 as advised in the README https://github.com/aswinnnn/pyscan#building

aswinnnn commented 1 year ago

Hello, this issue is due to your rust compiler being a bit out of date. Update your rust tool chain with rustup, or just the compiler rustc Can you also provide me with what architecture you're running on? The wheels cover x86_64, but other archs end up building the wheel themselves, which causes the above-mentioned issue when an outdated rust compiler is present.

aswinnnn commented 1 year ago

Also, the README advices to use a rustc version minimum v1.70

aswinnnn commented 1 year ago

My bad, it should have been clearer in the README.