the-lean-crate / criner

A tool to mine crates.io and produce static websites
MIT License
122 stars 2 forks source link

It won't compile #10

Closed wimvelzeboer closed 1 year ago

wimvelzeboer commented 1 year ago

I am running

When I execute the following commands

git clone https://github.com/the-lean-crate/criner/
cd criner
cargo run --release -- mine

I get the following:

user@virtualmachine: ~/Projects/criner$ cargo run --release -- mine
   Compiling adler32 v1.2.0
   Compiling os_str_bytes v6.4.0
   Compiling fallible-streaming-iterator v0.1.9
   Compiling ipnet v2.5.1
   Compiling atomic-waker v1.0.0
   Compiling dia-semver v11.0.0
   Compiling heck v0.4.0
   Compiling termcolor v1.1.3
   Compiling glob v0.3.0
   Compiling strsim v0.10.0
   Compiling libc v0.2.137
   Compiling memchr v2.5.0
   Compiling proc-macro2 v1.0.47
   Compiling quote v1.0.21
   Compiling syn v1.0.103
error[E0432]: unresolved import `core::ffi::CStr`
  --> /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/dia-semver-11.0.0/src/semver.rs:32:9
   |
32 |         ffi::CStr,
   |         ^^^^^^^^^ no `CStr` in `ffi`

   Compiling log v0.4.17
   Compiling futures-core v0.3.25
   Compiling ahash v0.7.6
   Compiling slab v0.4.7
   Compiling lock_api v0.4.9
error[E0282]: type annotations needed
   --> /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/dia-semver-11.0.0/src/semver.rs:218:17
    |
218 |         match s.as_ref().to_str() {
    |                 ^^^^^^ cannot infer type
    |
    = note: type must be known at this point

error[E0599]: no method named `as_ref` found for type parameter `S` in the current scope
   --> /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/dia-semver-11.0.0/src/semver.rs:218:17
    |
218 |         match s.as_ref().to_str() {
    |                 ^^^^^^ method not found in `S`
    |
    = help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `as_ref`, perhaps you need to restrict type parameter `S` with it:
    |
217 |     fn parse_c_str_with_options<S: AsRef>(s: S, strict: bool) -> Result<Self> where S: AsRef<CStr> {
    |                                 ~~~~~~~~

Some errors have detailed explanations: E0282, E0432, E0599.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `dia-semver` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...

Did I do something wrong or could this repo be out of date with the latest Rust compiler?

Byron commented 1 year ago

I don't know, it definitely looks like something with the toolchain isn't quite right as ffi::CStr is part of the standard library.

Maybe it needs sudo apt install build-essential to work? A bare Rust actually won't compile most of the crates out there due to the dependency to libc.

I am closing this as debugging build problems isn't in scope for this project - thanks for your understanding.

wimvelzeboer commented 1 year ago

Hi @Byron,

You are right, I should have thought about installing the build-essentials. But even with those installed it still shows the same errors. Any thoughts on what it could be?

Byron commented 1 year ago

I just know on a fresh ubuntu 22 VM with just libc-devel installed it fails because of cmake missing, not because of what's reported here.