10XGenomics / vartrix

Single-Cell Genotyping Tool
MIT License
198 stars 26 forks source link

Error on compiling on source #48

Closed Antioxidantcoco closed 4 years ago

Antioxidantcoco commented 4 years ago

Hi, I'm on a Mac OS machine and after download all dependencies and compile vartrix, I get the following error, I hope to have some guidance error[E0308]: mismatched types --> src/main.rs:587:34

   |
587 |         let end = rh.rec.pos() + alleles[0].len() as u32;
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^ expected `i64`, found `u32`

error[E0277]: cannot add `u32` to `i64`
   --> src/main.rs:587:32
    |
587 |         let end = rh.rec.pos() + alleles[0].len() as u32;
    |                                ^ no implementation for `i64 + u32`
    |
    = help: the trait `std::ops::Add<u32>` is not implemented for `i64`

error[E0308]: mismatched types
   --> src/main.rs:622:16
    |
622 |         start: rh.rec.pos(),
    |                ^^^^^^^^^^^^ expected `u32`, found `i64`

error[E0308]: mismatched types
   --> src/main.rs:623:29
    |
623 |         end: rh.rec.pos() + alleles[0].len() as u32,
    |                             ^^^^^^^^^^^^^^^^^^^^^^^ expected `i64`, found `u32`

error[E0308]: mismatched types
   --> src/main.rs:623:14
    |
623 |         end: rh.rec.pos() + alleles[0].len() as u32,
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i64`

error[E0277]: cannot add `u32` to `i64`
   --> src/main.rs:623:27
    |
623 |         end: rh.rec.pos() + alleles[0].len() as u32,
    |                           ^ no implementation for `i64 + u32`
    |
    = help: the trait `std::ops::Add<u32>` is not implemented for `i64`

error[E0308]: mismatched types
   --> src/main.rs:822:20
    |
822 |     bam.fetch(tid, haps.locus.start, haps.locus.end)?;
    |                    ^^^^^^^^^^^^^^^^
    |                    |
    |                    expected `u64`, found `u32`
    |                    help: you can convert an `u32` to `u64`: `haps.locus.start.into()`

error[E0308]: mismatched types
   --> src/main.rs:822:38
    |
822 |     bam.fetch(tid, haps.locus.start, haps.locus.end)?;
    |                                      ^^^^^^^^^^^^^^
    |                                      |
    |                                      expected `u64`, found `u32`
    |                                      help: you can convert an `u32` to `u64`: `haps.locus.end.into()`

error: aborting due to 8 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `vartrix`.
pmarks commented 4 years ago

Hi @Antioxidantcoco - this is probably happening because you're getting a different version of the rust-htslib crate. This can happen if you delete / edit the Cargo.lock file (possibly by running cargo update). If you revert the Cargo.lock file, it should build.

Antioxidantcoco commented 4 years ago

Thank you @pmarks, I just tried to delete the entire source file and download from release page again, after I run cargo test --release, I could not compile the new source file. The error goes as following:

error: failed to get `rust-htslib` as a dependency of package `vartrix v1.1.14 (/Users/xxxx/vartrix-1.1.16)`

Caused by:
  failed to load source for dependency `rust-htslib`

Caused by:
  Unable to update https://github.com/rust-bio/rust-htslib.git?rev=37533bded4692a78cfe080378a09209b95dc3cca#37533bde

Caused by:
  failed to update submodule `htslib`

Caused by:
  failed to fetch submodule `htslib` from https://github.com/rust-bio/htslib.git

Caused by:
  failed to authenticate when downloading repository
attempted to find username/password via git's `credential.helper` support, but failed

Caused by:
  failed to acquire username/password from local configuration

In my gitconfig, it also have username and password inside

[filter "lfs"]
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    process = git-lfs filter-process
    required = true
[user]
    name = xxx
    email = xxx
[credential]
    helper = manager
[credentail]
    useHttpPath = true