epi052 / feroxbuster

A fast, simple, recursive content discovery tool written in Rust.
https://epi052.github.io/feroxbuster/
MIT License
5.93k stars 499 forks source link

[BUG] Cant build feroxbuster on ARM #235

Closed tienna-0051 closed 3 years ago

tienna-0051 commented 3 years ago

Describe the bug I'm trying to build feroxbuster on the raspberry pi but run into an error with serde

To Reproduce

Raspberry Pi 3 Model B+
➜  feroxbuster git:(main) rustup show
Default host: armv7-unknown-linux-gnueabihf
rustup home:  /home/pi/.rustup
stable-armv7-unknown-linux-gnueabihf (default)
rustc 1.49.0 (e1884a8e3 2020-12-29)
➜  feroxbuster git:(main) cargo build --release
   Compiling feroxbuster v2.2.2 (/home/pi/sectools/feroxbuster)
error[E0277]: the trait bound `AtomicUsize: Deserialize<'_>` is not satisfied
  --> src/statistics/container.rs:28:5
   |
28 |     /// tracker for number of timeouts seen by the client
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `AtomicUsize`
   |
   = note: required by `next_element`

error[E0277]: the trait bound `AtomicUsize: Deserialize<'_>` is not satisfied
  --> src/statistics/container.rs:31:5
   |
31 |     /// tracker for total number of requests sent by the client
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `AtomicUsize`
   |
   = note: required by `next_element`

error[E0277]: the trait bound `AtomicUsize: Deserialize<'_>` is not satisfied
  --> src/statistics/container.rs:34:5
   |
34 |     /// tracker for total number of requests expected to send if the scan runs to completion
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `AtomicUsize`
   |
   = note: required by `next_element`

At https://serde.rs/derive.html#troubleshooting, the docs suggest to "upgrade or downgrade libraries as appropriate until the Serde versions match" but cargo tree -d return nothing. Can you check this?

Best regards,

epi052 commented 3 years ago

Thanks for the report! I'll take a look tomorrow

epi052 commented 3 years ago

Good morning,

I've added a dynamically linked armv7 build to my CI pipeline (link to the built binary below). Can you give it a try and see if it works on your end?

For whatever reason serde won't derive Serialize/Deserialize on atomics for arm, so I wrote a custom [de]serializer for the Stats struct. My tests still pass using an x86 binary, but I don't know if they truly pass on an arm host.

Could you try the following and make sure nothing goes haywire?

If everything looks ok for you, ill merge to main.

armv7 feroxbuster: https://github.com/epi052/feroxbuster/suites/2188250532/artifacts/45096600

tienna-0051 commented 3 years ago

Hi,

I ran a test with the new artifact on my raspberry pi, and it seems working correctly 👍 Log: https://pastebin.ubuntu.com/p/b8cCSYsX72/