01mf02 / jaq

A jq clone focussed on correctness, speed, and simplicity
MIT License
2.7k stars 67 forks source link

Compile error on Windows #184

Closed clin1234 closed 3 months ago

clin1234 commented 4 months ago

Running cargo install --locked --all-features --git https://github.com/01mf02/jaq outputted this:

    Updating git repository `https://github.com/01mf02/jaq#`
  Installing jaq v1.4.0 (https://github.com/01mf02/jaq##a02df55f)
    Updating crates.io index
   Compiling version_check v0.9.4
   Compiling proc-macro2 v1.0.69
   Compiling quote v1.0.29
   Compiling unicode-ident v1.0.10
   Compiling serde v1.0.190
   Compiling cfg-if v1.0.0
   Compiling once_cell v1.18.0
   Compiling zerocopy v0.7.32
   Compiling allocator-api2 v0.2.16
   Compiling winapi v0.3.9
   Compiling itoa v1.0.9
   Compiling equivalent v1.0.0
   Compiling serde_json v1.0.108
   Compiling syn v1.0.109
   Compiling cc v1.0.79
   Compiling libc v0.2.147
   Compiling getrandom v0.2.10
   Compiling ryu v1.0.14
   Compiling memchr v2.6.4
   Compiling regex-syntax v0.7.5
   Compiling libm v0.2.8
   Compiling ahash v0.8.7
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling dyn-clone v1.0.11
   Compiling heck v0.4.1
   Compiling libmimalloc-sys v0.1.35
   Compiling time-core v0.1.0
   Compiling yansi v0.5.1
   Compiling hifijson v0.2.0
   Compiling os_str_bytes v6.4.1
   Compiling log v0.4.20
   Compiling bitflags v1.3.2
   Compiling time v0.3.20
   Compiling aho-corasick v1.1.2
   Compiling urlencoding v2.1.3
   Compiling fastrand v1.9.0
   Compiling strsim v0.10.0
   Compiling unicode-width v0.1.11
   Compiling base64 v0.22.0
   Compiling clap_lex v0.3.2
   Compiling env_logger v0.10.0
   Compiling memmap2 v0.9.0
   Compiling ariadne v0.4.0
   Compiling syn v2.0.38
   Compiling hashbrown v0.14.2
   Compiling chumsky v0.9.3
error[E0282]: type annotations needed for `Box<_>`
  --> C:\Users\ךינשגכהד\.cargo\registry\src\index.crates.io-6f17d22bba15001f\time-0.3.20\src\format_description\parse\mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
help: consider giving `items` an explicit type, where the placeholders `_` are specified
   |
83 |     let items: Box<_> = format_items
   |              ++++++++

For more information about this error, try `rustc --explain E0282`.
error: could not compile `time` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `jaq v1.4.0 (https://github.com/01mf02/jaq##a02df55f)`, intermediate artifacts can be found at `C:\Users\0BAC~1\AppData\Local\Temp\cargo-installAXKs39`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
01mf02 commented 4 months ago

Can you tell me which version of rustc you used and whether the problem occurs without --all-features? As far as I can tell, this problem is not related to jaq directly, but to one dependency, namely time.

clin1234 commented 4 months ago

rustc --version: rustc 1.80.0-nightly (debd22da6 2024-05-29) Also, I still get the same error omitting --all-features

01mf02 commented 4 months ago

This might be a bug in the nightly compiler. To reproduce this, you might try:

cargo new foobar
cd foobar/
cargo add time@0.3.20
cargo check

Does this trigger the same error? Furthermore, is the error triggered with rustc 1.80 (not nightly) or when using time@0.3.36 instead of time@0.3.20?

clin1234 commented 4 months ago

No errors when adding either time@0.3.36 or time@0.3.20 on nightly

01mf02 commented 3 months ago

Did you also run cargo check after cargo add? I'm asking because if you did, I'm sorry to admit that I have no clue what is going on here.

clin1234 commented 3 months ago

Nvm, issue disappeared after compiling from latest Git somehow...