Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile zola from source #1548

Closed
hbina opened this issue Jul 9, 2021 · 4 comments
Closed

Cannot compile zola from source #1548

hbina opened this issue Jul 9, 2021 · 4 comments
Labels
done in pr Already done in a PR

Comments

@hbina
Copy link

hbina commented Jul 9, 2021

Bug Report

Cannot compile zola from source anymore :(
I used to install zola from source, but since switching to a new work user account, i cannot recompile it.
Prolly because of newer rust version?
I don't recall something like this being introduced.

Log from cargo build --release.

build log
    Updating crates.io index
 Downloading crates ...
  Downloaded relative-path v1.4.0
  Downloaded hyper v0.14.10
  Downloaded tokio v1.8.1
  Downloaded notify v4.0.17
   Compiling libc v0.2.98
   Compiling cfg-if v1.0.0
   Compiling lazy_static v1.4.0
   Compiling cfg-if v0.1.10
   Compiling syn v1.0.58
   Compiling serde_json v1.0.64
   Compiling itoa v0.4.7
   Compiling fnv v1.0.7
   Compiling once_cell v1.5.2
   Compiling either v1.6.1
   Compiling pin-project-lite v0.2.7
   Compiling bytes v1.0.0
   Compiling slab v0.4.2
   Compiling futures-core v0.3.9
   Compiling httparse v1.4.1
   Compiling futures-sink v0.3.9
   Compiling pin-utils v0.1.0
   Compiling futures-io v0.3.9
   Compiling try-lock v0.2.3
   Compiling tower-service v0.3.0
   Compiling httpdate v1.0.1
   Compiling relative-path v1.4.0
   Compiling indexmap v1.5.2
   Compiling tokio v1.8.1
   Compiling thread_local v1.1.0
   Compiling tracing-core v0.1.17
   Compiling futures-channel v0.3.9
   Compiling memchr v2.3.4
   Compiling log v0.4.11
   Compiling futures-task v0.3.9
   Compiling crc32fast v1.2.1
   Compiling proc-macro-nested v0.1.6
   Compiling encoding_rs v0.8.26
   Compiling string_cache v0.8.1
   Compiling hashbrown v0.8.2
   Compiling serde_urlencoded v0.7.0
   Compiling lexical-core v0.7.4
   Compiling crossbeam-utils v0.8.1
   Compiling want v0.3.0
   Compiling http v0.2.3
   Compiling aho-corasick v0.7.15
   Compiling bstr v0.2.14
   Compiling csv-core v0.1.10
   Compiling onig v6.1.1
   Compiling pulldown-cmark v0.8.0
   Compiling png v0.16.8
   Compiling tracing v0.1.22
   Compiling url v2.2.2
   Compiling digest v0.9.0
   Compiling block-buffer v0.9.0
   Compiling block-buffer v0.7.3
   Compiling digest v0.8.1
   Compiling parse-zoneinfo v0.3.0
error[E0308]: mismatched types
  --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bhcomp.rs:62:24
   |
62 |     let bytes = bits / Limb::BITS;
   |                        ^^^^^^^^^^ expected `usize`, found `u32`

   Compiling crossbeam-epoch v0.9.1
   Compiling crossbeam-channel v0.5.0
error[E0277]: cannot divide `usize` by `u32`
  --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bhcomp.rs:62:22
   |
62 |     let bytes = bits / Limb::BITS;
   |                      ^ no implementation for `usize / u32`
   |
   = help: the trait `Div<u32>` is not implemented for `usize`

error[E0308]: mismatched types
   --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bigcomp.rs:157:55
    |
157 |     let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1);
    |                                                       ^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0277]: no implementation for `usize & u32`
   --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bigcomp.rs:157:53
    |
157 |     let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1);
    |                                                     ^ no implementation for `usize & u32`
    |
    = help: the trait `BitAnd<u32>` is not implemented for `usize`

error[E0308]: mismatched types
   --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bigcomp.rs:175:40
    |
175 |         let (q, r) = shift.ceil_divmod(Limb::BITS);
    |                                        ^^^^^^^^^^ expected `usize`, found `u32`
    |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
    |
175 |         let (q, r) = shift.ceil_divmod(Limb::BITS.try_into().unwrap());
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1043:42
     |
1043 |     let mut count = index.saturating_mul(Limb::BITS);
     |                                          ^^^^^^^^^^ expected `usize`, found `u32`
     |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
     |
1043 |     let mut count = index.saturating_mul(Limb::BITS.try_into().unwrap());
     |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1058:28
     |
1058 |     Limb::BITS.checked_mul(x.len())
     |                            ^^^^^^^ expected `u32`, found `usize`
     |
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
     |
1058 |     Limb::BITS.checked_mul(x.len().try_into().unwrap())
     |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1059:22
     |
1059 |         .map(|v| v - nlz)
     |                      ^^^ expected `u32`, found `usize`

error[E0277]: cannot subtract `usize` from `u32`
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1059:20
     |
1059 |         .map(|v| v - nlz)
     |                    ^ no implementation for `u32 - usize`
     |
     = help: the trait `Sub<usize>` is not implemented for `u32`

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1060:20
     |
1060 |         .unwrap_or(usize::max_value())
     |                    ^^^^^^^^^^^^^^^^^^ expected `u32`, found `usize`
     |
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
     |
1060 |         .unwrap_or(usize::max_value().try_into().unwrap())
     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1058:5
     |
1054 |   pub fn bit_length(x: &[Limb]) -> usize {
     |                                    ----- expected `usize` because of return type
...
1058 | /     Limb::BITS.checked_mul(x.len())
1059 | |         .map(|v| v - nlz)
1060 | |         .unwrap_or(usize::max_value())
     | |______________________________________^ expected `usize`, found `u32`
     |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
     |
1058 |     Limb::BITS.checked_mul(x.len())
1059 |         .map(|v| v - nlz)
1060 |         .unwrap_or(usize::max_value()).try_into().unwrap()
     |

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1085:23
     |
1085 |     debug_assert!(n < bits && n != 0);
     |                       ^^^^ expected `usize`, found `u32`
     |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
     |
1085 |     debug_assert!(n < bits.try_into().unwrap() && n != 0);
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1092:25
     |
1092 |     let lshift = bits - n;
     |                         ^ expected `u32`, found `usize`

error[E0277]: cannot subtract `usize` from `u32`
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1092:23
     |
1092 |     let lshift = bits - n;
     |                       ^ no implementation for `u32 - usize`
     |
     = help: the trait `Sub<usize>` is not implemented for `u32`

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1134:19
     |
1134 |     let rem = n % bits;
     |                   ^^^^ expected `usize`, found `u32`

error[E0277]: cannot mod `usize` by `u32`
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1134:17
     |
1134 |     let rem = n % bits;
     |                 ^ no implementation for `usize % u32`
     |
     = help: the trait `Rem<u32>` is not implemented for `usize`

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1135:19
     |
1135 |     let div = n / bits;
     |                   ^^^^ expected `usize`, found `u32`

error[E0277]: cannot divide `usize` by `u32`
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1135:17
     |
1135 |     let div = n / bits;
     |                 ^ no implementation for `usize / u32`
     |
     = help: the trait `Div<u32>` is not implemented for `usize`

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1191:23
     |
1191 |     debug_assert!(n < bits);
     |                       ^^^^ expected `usize`, found `u32`
     |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
     |
1191 |     debug_assert!(n < bits.try_into().unwrap());
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1201:25
     |
1201 |     let rshift = bits - n;
     |                         ^ expected `u32`, found `usize`

error[E0277]: cannot subtract `usize` from `u32`
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1201:23
     |
1201 |     let rshift = bits - n;
     |                       ^ no implementation for `u32 - usize`
     |
     = help: the trait `Sub<usize>` is not implemented for `u32`

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1253:19
     |
1253 |     let rem = n % bits;
     |                   ^^^^ expected `usize`, found `u32`

error[E0277]: cannot mod `usize` by `u32`
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1253:17
     |
1253 |     let rem = n % bits;
     |                 ^ no implementation for `usize % u32`
     |
     = help: the trait `Rem<u32>` is not implemented for `usize`

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1254:19
     |
1254 |     let div = n / bits;
     |                   ^^^^ expected `usize`, found `u32`

error[E0277]: cannot divide `usize` by `u32`
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1254:17
     |
1254 |     let div = n / bits;
     |                 ^ no implementation for `usize / u32`
     |
     = help: the trait `Div<u32>` is not implemented for `usize`

error[E0308]: mismatched types
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:2065:27
     |
2065 |     let rs = Limb::BITS - s;
     |                           ^ expected `u32`, found `usize`

error[E0277]: cannot subtract `usize` from `u32`
    --> /home/hanifsetel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:2065:25
     |
2065 |     let rs = Limb::BITS - s;
     |                         ^ no implementation for `u32 - usize`
     |
     = help: the trait `Sub<usize>` is not implemented for `u32`

error: aborting due to 27 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `lexical-core`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

Environment

zola on  master [!?] is 📦 v0.13.0 via 🦀 v1.53.0 on ☁️  setel (ap-southeast-1) took 14s 
❯ screenfetch -n
 hanifsetel@komputa
 OS: Ubuntu 20.04 focal
 Kernel: x86_64 Linux 5.8.0-59-generic
 Uptime: 2h 10m
 Packages: 2308
 Shell: bash 5.0.17
 Resolution: 1920x1080
 DE: GNOME 3.36.5
 WM: Mutter
 WM Theme: Adwaita
 GTK Theme: Yaru [GTK2/3]
 Icon Theme: Yaru
 Font: Ubuntu 11
 Disk: 280G / 475G (62%)
 CPU: AMD Ryzen 7 4800U with Radeon Graphics @ 16x 1.8GHz
 GPU: AMD/ATI
 RAM: 7499MiB / 31593MiB

zola on  master [!?] is 📦 v0.13.0 via 🦀 v1.53.0 on ☁️  setel (ap-southeast-1) 
❯ cargo --version
cargo 1.53.0 (4369396ce 2021-04-27)

Zola version:

not relevant, master i guess

Expected Behavior

Tell us what should have happened.

Current Behavior

Tell us what happens instead of the expected behavior. If you are seeing an
error, please include the full error message and stack trace. You can get the
stacktrace of a panic by adding RUST_BACKTRACE=1 when running a zola command.

Should compile according to this https://www.getzola.org/documentation/getting-started/installation/#from-source

Step to reproduce

Please provide the steps to reproduce the issue.
If the issue is hard to reproduce, please provide a sample repository or sample
that triggers the bug.

  1. Follow the steps
  2. Fail
@hbina
Copy link
Author

hbina commented Jul 9, 2021

Apparently this is a known issue rust-lang/rust#81654
Lemme see if bumping nom fixes it, because its the only thing that uses it in here,

zola on  master is 📦 v0.13.0 via 🦀 v1.53.0 on ☁️  setel (ap-southeast-1) took 42s 
❯ cargo tree | rg 'lexical-core' --context 3
│   │   ├── library v0.1.0 (/home/hanifsetel/git/zola/components/library) (*)
│   │   ├── nom-bibtex v0.3.0
│   │   │   ├── nom v5.1.2
│   │   │   │   ├── lexical-core v0.7.4
│   │   │   │   │   ├── arrayvec v0.5.2
│   │   │   │   │   ├── bitflags v1.2.1
│   │   │   │   │   ├── cfg-if v0.1.10

Edit: the thing that uses it is actually nom-bibtex. This https://github.com/getzola/zola/blob/master/components/templates/Cargo.toml#L17

@Keats Keats added the done in pr Already done in a PR label Jul 9, 2021
@Keats
Copy link
Collaborator

Keats commented Jul 9, 2021

It's already fixed in next which is going to be released soonish after some testing. Feel free to compile and try that branch too!

@hbina
Copy link
Author

hbina commented Jul 9, 2021

awesome

@hbina hbina closed this as completed Jul 9, 2021
@JoelMon
Copy link
Contributor

JoelMon commented Jul 19, 2021

@hbina Just tested it and 0.14.0 compiles fine for me. Give it a shot and see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

3 participants