jguhlin / sfasta

sfasta
MIT License
34 stars 0 forks source link

fail to compile #1

Closed shenwei356 closed 1 year ago

shenwei356 commented 2 years ago

Hi, Joseph, I'm trying to compile it but it fails.

Versions:

$ cargo -V
cargo 1.63.0
$ rustc -V
rustc 1.63.0 (Arch Linux rust 1:1.63.0-1)

Error:

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/shenwei/.cargo/registry/src/github.com-1ecc6299db9ec823/sfasta-0.3.2/libsfasta/src/lib.rs:1:12
  |
1 | #![feature(byte_slice_trim_ascii)]
  |            ^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/shenwei/.cargo/registry/src/github.com-1ecc6299db9ec823/sfasta-0.3.2/libsfasta/src/lib.rs:2:12
  |
2 | #![feature(is_sorted)]
  |            ^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
error: could not compile `sfasta` due to 2 previous errors
error: failed to compile `sfasta v0.3.2`, intermediate artifacts can be found at `/tmp/cargo-installnVyjwo`
Full log $ cargo install sfasta Downloaded sfasta v0.3.2 Downloaded 1 crate (215.6 KB) in 12.88s Installing sfasta v0.3.2 Downloaded xz v0.1.0 Downloaded ahash v0.8.0 Downloaded virtue v0.0.7 Downloaded alloc-stdlib v0.2.1 Downloaded zstd v0.11.2+zstd.1.5.2 Downloaded bincode_derive v2.0.0-rc.1 Downloaded bincode v2.0.0-rc.1 Downloaded alloc-no-stdlib v2.0.3 Downloaded unicode-ident v1.0.3 Downloaded bitpacking v0.8.4 Downloaded clap_lex v0.2.4 Downloaded console v0.15.1 Downloaded brotli-decompressor v2.3.2 Downloaded bytelines v2.4.0 Downloaded bitvec v1.0.1 Downloaded crunchy v0.2.2 Downloaded clap_derive v3.2.18 Downloaded clap v3.2.18 Downloaded tokio v1.20.1 Downloaded brotli v3.3.4 Downloaded either v1.8.0 Downloaded futures-channel v0.3.24 Downloaded futures v0.3.24 Downloaded futures-io v0.3.24 Downloaded git-version-macro v0.3.5 Downloaded futures-task v0.3.24 Downloaded heck v0.4.0 Downloaded indicatif v0.17.0 Downloaded git-version v0.3.5 Downloaded futures-util v0.3.24 Downloaded futures-sink v0.3.24 Downloaded futures-macro v0.3.24 Downloaded futures-executor v0.3.24 Downloaded futures-core v0.3.24 Downloaded funty v2.0.0 Downloaded libc v0.2.132 Downloaded os_str_bytes v6.3.0 Downloaded pin-utils v0.1.0 Downloaded proc-macro2 v1.0.43 Downloaded radium v0.7.0 Downloaded slab v0.4.7 Downloaded serde v1.0.144 Downloaded simdutf8 v0.1.4 Downloaded quote v1.0.21 Downloaded terminal_size v0.1.17 Downloaded tap v1.0.1 Downloaded wyz v0.5.0 Downloaded strsim v0.10.0 Downloaded snap v1.0.5 Downloaded lz4_flex v0.9.4 Downloaded proc-macro-hack v0.5.19 Downloaded pin-project-lite v0.2.9 Downloaded textwrap v0.15.0 Downloaded zstd-safe v5.0.2+zstd.1.5.2 Downloaded static_assertions v1.1.0 Downloaded once_cell v1.13.1 Downloaded number_prefix v0.4.0 Downloaded syn v1.0.99 Downloaded twox-hash v1.6.3 Downloaded xz2 v0.1.7 Downloaded zstd-sys v2.0.1+zstd.1.5.2 Downloaded libz-ng-sys v1.1.8 Downloaded 62 crates (7.3 MB) in 3.24s (largest was `libz-ng-sys` at 1.8 MB) Compiling libc v0.2.132 Compiling autocfg v1.1.0 Compiling cfg-if v1.0.0 Compiling proc-macro2 v1.0.43 Compiling quote v1.0.21 Compiling unicode-ident v1.0.3 Compiling syn v1.0.99 Compiling once_cell v1.13.1 Compiling version_check v0.9.4 Compiling memchr v2.5.0 Compiling crossbeam-utils v0.8.11 Compiling futures-core v0.3.24 Compiling futures-task v0.3.24 Compiling futures-channel v0.3.24 Compiling futures-sink v0.3.24 Compiling futures-util v0.3.24 Compiling scopeguard v1.1.0 Compiling pin-project-lite v0.2.9 Compiling pkg-config v0.3.25 Compiling proc-macro-hack v0.5.19 Compiling rayon-core v1.9.3 Compiling pin-utils v0.1.0 Compiling ppv-lite86 v0.2.16 Compiling futures-io v0.3.24 Compiling crossbeam-queue v0.3.6 Compiling serde v1.0.144 Compiling crunchy v0.2.2 Compiling radium v0.7.0 Compiling zstd-safe v5.0.2+zstd.1.5.2 Compiling crc32fast v1.3.2 Compiling log v0.4.17 Compiling alloc-no-stdlib v2.0.3 Compiling bytes v1.2.1 Compiling unicode-width v0.1.9 Compiling either v1.8.0 Compiling heck v0.4.0 Compiling snap v1.0.5 Compiling static_assertions v1.1.0 Compiling hashbrown v0.12.3 Compiling tap v1.0.1 Compiling termcolor v1.1.3 Compiling os_str_bytes v6.3.0 Compiling virtue v0.0.7 Compiling regex-syntax v0.6.27 Compiling strsim v0.10.0 Compiling bitflags v1.3.2 Compiling number_prefix v0.4.0 Compiling humantime v2.1.0 Compiling funty v2.0.0 Compiling simdutf8 v0.1.4 Compiling proc-macro-error-attr v1.0.4 Compiling proc-macro-error v1.0.4 Compiling ahash v0.8.0 Compiling alloc-stdlib v0.2.1 Compiling memoffset v0.6.5 Compiling crossbeam-epoch v0.9.10 Compiling slab v0.4.7 Compiling tokio v1.20.1 Compiling indexmap v1.9.1 Compiling rayon v1.5.3 Compiling itertools v0.10.3 Compiling wyz v0.5.0 Compiling clap_lex v0.2.4 Compiling brotli-decompressor v2.3.2 Compiling bincode_derive v2.0.0-rc.1 Compiling crossbeam-channel v0.5.6 Compiling bitpacking v0.8.4 Compiling aho-corasick v0.7.18 Compiling bitvec v1.0.1 Compiling getrandom v0.2.7 Compiling terminal_size v0.1.17 Compiling atty v0.2.14 Compiling num_cpus v1.13.1 Compiling jobserver v0.1.24 Compiling brotli v3.3.4 Compiling rand_core v0.6.3 Compiling textwrap v0.15.0 Compiling console v0.15.1 Compiling crossbeam-deque v0.8.2 Compiling cc v1.0.73 Compiling regex v1.6.0 Compiling bincode v2.0.0-rc.1 Compiling rand_chacha v0.3.1 Compiling crossbeam v0.8.2 Compiling indicatif v0.17.0 Compiling cmake v0.1.48 Compiling rand v0.8.5 Compiling env_logger v0.9.0 Compiling zstd-sys v2.0.1+zstd.1.5.2 Compiling lzma-sys v0.1.19 Compiling libmimalloc-sys v0.1.25 Compiling libz-ng-sys v1.1.8 Compiling twox-hash v1.6.3 Compiling toml v0.5.9 Compiling lz4_flex v0.9.4 Compiling xz2 v0.1.7 Compiling xz v0.1.0 Compiling futures-macro v0.3.24 Compiling git-version-macro v0.3.5 Compiling clap_derive v3.2.18 Compiling mimalloc v0.1.29 Compiling git-version v0.3.5 Compiling clap v3.2.18 Compiling futures-executor v0.3.24 Compiling futures v0.3.24 Compiling bytelines v2.4.0 Compiling flate2 v1.0.24 Compiling zstd v0.11.2+zstd.1.5.2 Compiling sfasta v0.3.2 error[E0554]: `#![feature]` may not be used on the stable release channel --> /home/shenwei/.cargo/registry/src/github.com-1ecc6299db9ec823/sfasta-0.3.2/libsfasta/src/lib.rs:1:12 | 1 | #![feature(byte_slice_trim_ascii)] | error[E0554]: `#![feature]` may not be used on the stable release channel --> /home/shenwei/.cargo/registry/src/github.com-1ecc6299db9ec823/sfasta-0.3.2/libsfasta/src/lib.rs:2:12 | 2 | #![feature(is_sorted)] | For more information about this error, try `rustc --explain E0554`. error: could not compile `sfasta` due to 2 previous errors error: failed to compile `sfasta v0.3.2`, intermediate artifacts can be found at `/tmp/cargo-installnVyjwo`
jguhlin commented 2 years ago

Ahh, oops on my part. I'm using some nightly features. Switch your rust install over with this: (If you cloned the repo: rustup overright nightly

Or if you are using cargo install: rustup default nightly

And let me know if that works.

slw287r commented 2 years ago
rustup install nightly
cargo +nightly install sfasta

btw, I've encountered the following issue:

sfa view ref.fa.sfasta | head -n2
>7|GCF_000010525.1
CATCCAGAGCGGCGGGGTCTTCTGCGGGAAGCCGTCCAGCACGTTCAGAAACGGGGAGGGCTTGGCCCTAAGCTCGCTCA
thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:1015:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is it something related to my Rust configuration?

shenwei356 commented 2 years ago

I failed to install rustup due to file conflicts.

cargo +nightly seems not to work for my cargo 1.63.0, though the online doc also recommends this command.

$ cargo +nightly install sfasta
error: no such subcommand: `+nightly`

I think statically-compiled binary files would be more convenient for non-Rust users like me :smiling_face_with_tear:

jguhlin commented 2 years ago

@slw287r No, rust panics when the pipe is closed (which head does). Pushing out a fix now, give it 10 mins and give it another reinstall. Thanks for finding it!

jguhlin commented 2 years ago

@shenwei356 That's a good idea (and probably via conda as well). Rust mostly produces static binaries anyways, so should be good to go. But, there is only 1 nightly feature being used so I removed it for now and am pushing out a new version that works on stable.

cargo install sfasta should install 0.3.3 but if not add --force after install.

Just a note for me, rust has a guide on distributing binaries and building for other platforms automatically: https://rust-cli.github.io/book/tutorial/packaging.html