dylanowen / mdbook-graphviz

Mozilla Public License 2.0
44 stars 9 forks source link

[Bug]: Cargo install fail on armv7l #20

Closed j0hnd3v closed 2 years ago

j0hnd3v commented 2 years ago

cargo output

error[E0308]: mismatched types
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1285ae84e5963aae/mdbook-graphviz-0.1.3/src/preprocessor.rs:87:25
   |
86 |                     match e {
   |                           - this expression has type `pulldown_cmark::Event<'_>`
87 |                         Event::Text(ref text) => {
   |                         ^^^^^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::Event`, found enum `Event`

error[E0308]: mismatched types
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1285ae84e5963aae/mdbook-graphviz-0.1.3/src/preprocessor.rs:93:25
   |
86 |                     match e {
   |                           - this expression has type `pulldown_cmark::Event<'_>`
...
93 |                         Event::End(Tag::CodeBlock(CodeBlockKind::Fenced(ref info_string))) => {
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::Event`, found enum `Event`

error[E0308]: mismatched types
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1285ae84e5963aae/mdbook-graphviz-0.1.3/src/preprocessor.rs:114:25
    |
113 |                     match e {
    |                           - this expression has type `pulldown_cmark::Event<'_>`
114 |                         Event::Start(Tag::CodeBlock(CodeBlockKind::Fenced(ref info_string)))
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::Event`, found enum `Event`

error[E0308]: `if` and `else` have incompatible types
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1285ae84e5963aae/mdbook-graphviz-0.1.3/src/preprocessor.rs:113:21
    |
85  |   /                 if let Some(mut builder) = graphviz_block_builder.take() {
86  |   |                     match e {
    |  _|_____________________-
87  | | |                         Event::Text(ref text) => {
88  | | |                             builder.append_code(&**text);
89  | | |                             graphviz_block_builder = Some(builder);
...   | |
110 | | |                         }
111 | | |                     }
    | |_|_____________________- expected because of this
112 |   |                 } else {
113 | / |                     match e {
114 | | |                         Event::Start(Tag::CodeBlock(CodeBlockKind::Fenced(ref info_string)))
115 | | |                             if (&**info_string).find(INFO_STRING_PREFIX) == Some(0) =>
116 | | |                         {
...   | |
125 | | |                         _ => Ok(vec![e]),
126 | | |                     }
    | |_|_____________________^ expected enum `Event`, found enum `pulldown_cmark::Event`
127 |   |                 }
    |   |_________________- `if` and `else` have incompatible types
    |
    = note: expected type `Result<Vec<Event<'_>>, mdbook::errors::Error>`
               found enum `Result<Vec<pulldown_cmark::Event<'_>>, _>`

For more information about this error, try `rustc --explain E0308`.
error: failed to compile `mdbook-graphviz v0.1.3`, intermediate artifacts can be found at `/data/data/com.termux/files/usr/tmp/cargo-installSovVAc`

Caused by:
  could not compile `mdbook-graphviz` due to 4 previous errors

cargo 1.57.0 system information


termux-info
Application version:
0.118.0
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://packages.termux.org/apt/termux-main stable main
# science-repo (sources.list.d/science.list)
deb https://packages.termux.org/apt/termux-science science stable
# game-repo (sources.list.d/game.list)
deb https://packages.termux.org/apt/termux-games games stable
# sources.list.d/pointless.list
deb https://its-pointless.github.io/files/24 termux extras
# root-repo (sources.list.d/root.list)
deb https://packages.termux.org/apt/termux-root root stable
# x11-repo (sources.list.d/x11.list)
deb https://packages.termux.org/apt/termux-x11 x11 main
Updatable packages:
python/stable 3.10.2 arm [upgradable from: 3.10.1]
Android version:
7.1.1
Kernel build information:
Linux localhost 3.10.49-g87b323e #1 SMP PREEMPT Wed May 30 01:32:11 CDT 2018 armv7l Android
Device manufacturer:
motorola
Device model:
Moto G Play ```
apiraino commented 2 years ago

Confirm this issue when compiling for target musl with stable 1.58. Here's my cargo-config.toml (if it helps)

[build]
target = "x86_64-unknown-linux-musl"

[target.armv7-unknown-linux-musleabihf]
linker = "arm-linux-gnueabihf-gcc"

It's a bit weird because (in my case) around a month ago mdbook-graphviz compiled fine and I don't see changes in this repository that I immediately identify as possible culprits. I don't have time right now to investigate but I suspect an external cause.

netzdoktor commented 2 years ago

I can confirm it for other platforms as well and it seems #19 suggests a fix.

robbienohra commented 2 years ago

I'm seeing this issue as well when trying to install

expected enum `Event`, found enum `pulldown_cmark::Event`
dylanowen commented 2 years ago

Just published https://github.com/dylanowen/mdbook-graphviz/releases/tag/v0.1.4 which should fix this issue, let me know if you're still having any problems

apiraino commented 2 years ago

@dylanowen on my end the issue seems solved, thank you!

robbienohra commented 2 years ago

@dylanowen I can also confirm this is working for me now, thanks a bunch!