torrust / torrust-tracker

A modern and feature-rich (private) BitTorrent tracker.
https://torrust.com
GNU Affero General Public License v3.0
367 stars 42 forks source link

torrust-tracker fails to compile #242

Closed Ryahn closed 1 year ago

Ryahn commented 1 year ago

Distributor ID: Ubuntu Description: Ubuntu 20.04.5 LTS Release: 20.04 Codename: focal

rustc 1.68.0 (2c8cc3432 2023-03-06) binary: rustc commit-hash: 2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74 commit-date: 2023-03-06 host: x86_64-unknown-linux-gnu release: 1.68.0 LLVM version: 15.0.6

cargo 1.68.0 (115f34552 2023-02-26)

process didn't exit successfully:...(signal: 9, SIGKILL: kill)


  ...
   Compiling torrust-tracker v2.3.0 (/opt/torrust/torrust-tracker)
error: could not compile `torrust-tracker`

Caused by:
  process didn't exit successfully: `rustc --crate-name torrust_tracker --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=152 --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto=fat -C debuginfo=1 -C metadata=eaa544ff1f84f4e9 -C extra-filename=-eaa544ff1f84f4e9 --out-dir /opt/torrust/torrust-tracker/target/release/deps -L dependency=/opt/torrust/torrust-tracker/target/release/deps --extern aquatic_udp_protocol=/opt/torrust/torrust-tracker/target/release/deps/libaquatic_udp_protocol-cbdd9d87a4bcbc53.rlib --extern async_trait=/opt/torrust/torrust-tracker/target/release/deps/libasync_trait-292f68b9c12e4628.so --extern axum=/opt/torrust/torrust-tracker/target/release/deps/libaxum-b183c31723dfe6d0.rlib --extern axum_client_ip=/opt/torrust/torrust-tracker/target/release/deps/libaxum_client_ip-8dd781d4691ff0f2.rlib --extern axum_server=/opt/torrust/torrust-tracker/target/release/deps/libaxum_server-de11c1af127a844b.rlib --extern binascii=/opt/torrust/torrust-tracker/target/release/deps/libbinascii-5e661522ecc8a8b6.rlib --extern bip_bencode=/opt/torrust/torrust-tracker/target/release/deps/libbip_bencode-510844de6298fbf3.rlib --extern chrono=/opt/torrust/torrust-tracker/target/release/deps/libchrono-a2a40b89c6cf02f2.rlib --extern config=/opt/torrust/torrust-tracker/target/release/deps/libconfig-169a42bfb43c4209.rlib --extern derive_more=/opt/torrust/torrust-tracker/target/release/deps/libderive_more-a8d4e6fd7d8d122f.so --extern fern=/opt/torrust/torrust-tracker/target/release/deps/libfern-5ce1953b0801cf8f.rlib --extern futures=/opt/torrust/torrust-tracker/target/release/deps/libfutures-985d5fb822ad608c.rlib --extern hex=/opt/torrust/torrust-tracker/target/release/deps/libhex-47e24e97ddd10b79.rlib --extern hyper=/opt/torrust/torrust-tracker/target/release/deps/libhyper-16375ca9fcad29e5.rlib --extern lazy_static=/opt/torrust/torrust-tracker/target/release/deps/liblazy_static-3be395dd3e825d26.rlib --extern log=/opt/torrust/torrust-tracker/target/release/deps/liblog-1e523ffde3ac3d37.rlib --extern multimap=/opt/torrust/torrust-tracker/target/release/deps/libmultimap-0c6864a8090eba49.rlib --extern openssl=/opt/torrust/torrust-tracker/target/release/deps/libopenssl-5093c2d193c0f20c.rlib --extern percent_encoding=/opt/torrust/torrust-tracker/target/release/deps/libpercent_encoding-a2b05185c17289c9.rlib --extern r2d2=/opt/torrust/torrust-tracker/target/release/deps/libr2d2-6f31f577174bb259.rlib --extern r2d2_mysql=/opt/torrust/torrust-tracker/target/release/deps/libr2d2_mysql-11f8d55a82267fd5.rlib --extern r2d2_sqlite=/opt/torrust/torrust-tracker/target/release/deps/libr2d2_sqlite-61de213cd9bac5e6.rlib --extern rand=/opt/torrust/torrust-tracker/target/release/deps/librand-47f5f1b03233a1d7.rlib --extern serde=/opt/torrust/torrust-tracker/target/release/deps/libserde-ead03684c1380d68.rlib --extern serde_bencode=/opt/torrust/torrust-tracker/target/release/deps/libserde_bencode-a9cd792d198f1e32.rlib --extern serde_json=/opt/torrust/torrust-tracker/target/release/deps/libserde_json-959a9f6eb9495f5a.rlib --extern serde_with=/opt/torrust/torrust-tracker/target/release/deps/libserde_with-8b912b89d09c5906.rlib --extern thiserror=/opt/torrust/torrust-tracker/target/release/deps/libthiserror-05e129aecf5a7ea1.rlib --extern tokio=/opt/torrust/torrust-tracker/target/release/deps/libtokio-70270b2f2c3b575e.rlib --extern toml=/opt/torrust/torrust-tracker/target/release/deps/libtoml-624fa5abf5b7625b.rlib --extern torrust_tracker=/opt/torrust/torrust-tracker/target/release/deps/libtorrust_tracker-66bef3891480010e.rlib --extern torrust_tracker_configuration=/opt/torrust/torrust-tracker/target/release/deps/libtorrust_tracker_configuration-36a8786e82de8f03.rlib --extern torrust_tracker_located_error=/opt/torrust/torrust-tracker/target/release/deps/libtorrust_tracker_located_error-ab9aa416c3d28bf6.rlib --extern torrust_tracker_primitives=/opt/torrust/torrust-tracker/target/release/deps/libtorrust_tracker_primitives-86ee3a0a512200a1.rlib --extern uuid=/opt/torrust/torrust-tracker/target/release/deps/libuuid-ba1ab90e394033b4.rlib -L native=/opt/torrust/torrust-tracker/target/release/build/ring-920210d9255f7609/out -L native=/opt/torrust/torrust-tracker/target/release/build/openssl-sys-08ae28552afdfa71/out/openssl-build/install/lib -L native=/opt/torrust/torrust-tracker/target/release/build/libz-sys-44fc3de2744b0b64/out/lib -L native=/opt/torrust/torrust-tracker/target/release/build/libz-sys-44fc3de2744b0b64/out/lib -L native=/opt/torrust/torrust-tracker/target/release/build/libsqlite3-sys-f185311704780707/out` (signal: 9, SIGKILL: kill)```
josecelano commented 1 year ago

Hi @Ryahn, I will try to reproduce it with docker. I think it would be nice if we add a matric to the workflows to test compilation with different OS versions and rustic. In fact @WarmBeer opened this an issue https://github.com/torrust/torrust-tracker/issues/70 to compile binaries for different targets for the releases.

I'm using:

josecelano commented 1 year ago

Hi @Ryahn, I'm trying to reproduce your error but in the meantime, I think the most likely problem is that you do not have: libsqlite3-dev. See prerequisites here.

josecelano commented 1 year ago

@Ryahn could you run cargo build --verbose to see if we get a more detailed error?

starblazr commented 1 year ago
     Running `rustc --crate-name axum_client_ip --edition=2021 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-client-ip-0.4.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=1 -C linker-plugin-lto -C debuginfo=1 -C debug-assertions=on -C metadata=adf3b8cc086e3966 -C extra-filename=-adf3b8cc086e3966 --out-dir /root/torrust-tracker/target/debug/deps -L dependency=/root/torrust-tracker/target/debug/deps --extern axum=/root/torrust-tracker/target/debug/deps/libaxum-d522ab48147e76b9.rmeta --extern forwarded_header_value=/root/torrust-tracker/target/debug/deps/libforwarded_header_value-33dc02f483df1291.rmeta --extern serde=/root/torrust-tracker/target/debug/deps/libserde-5c209eb49ec1a5b4.rmeta --cap-lints allow`
error[E0658]: `let...else` statements are unstable
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-client-ip-0.4.0/src/rudimental.rs:178:9
    |
178 |         let Ok(fv) = ForwardedHeaderValue::from_forwarded(header_value) else {return Vec::new()};
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #87335 <https://github.com/rust-lang/rust/issues/87335> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `axum-client-ip` due to previous error

Caused by:
  process didn't exit successfully: `rustc --crate-name axum_client_ip --edition=2021 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-client-ip-0.4.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=1 -C linker-plugin-lto -C debuginfo=1 -C debug-assertions=on -C metadata=adf3b8cc086e3966 -C extra-filename=-adf3b8cc086e3966 --out-dir /root/torrust-tracker/target/debug/deps -L dependency=/root/torrust-tracker/target/debug/deps --extern axum=/root/torrust-tracker/target/debug/deps/libaxum-d522ab48147e76b9.rmeta --extern forwarded_header_value=/root/torrust-tracker/target/debug/deps/libforwarded_header_value-33dc02f483df1291.rmeta --extern serde=/root/torrust-tracker/target/debug/deps/libserde-5c209eb49ec1a5b4.rmeta --cap-lints allow` (exit status: 1)
warning: build failed, waiting for other jobs to finish...

My enviroment: Debian bookworm (testing) rustc 1.63.0 cargo 1.65.0

josecelano commented 1 year ago
     Running `rustc --crate-name axum_client_ip --edition=2021 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-client-ip-0.4.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=1 -C linker-plugin-lto -C debuginfo=1 -C debug-assertions=on -C metadata=adf3b8cc086e3966 -C extra-filename=-adf3b8cc086e3966 --out-dir /root/torrust-tracker/target/debug/deps -L dependency=/root/torrust-tracker/target/debug/deps --extern axum=/root/torrust-tracker/target/debug/deps/libaxum-d522ab48147e76b9.rmeta --extern forwarded_header_value=/root/torrust-tracker/target/debug/deps/libforwarded_header_value-33dc02f483df1291.rmeta --extern serde=/root/torrust-tracker/target/debug/deps/libserde-5c209eb49ec1a5b4.rmeta --cap-lints allow`
error[E0658]: `let...else` statements are unstable
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-client-ip-0.4.0/src/rudimental.rs:178:9
    |
178 |         let Ok(fv) = ForwardedHeaderValue::from_forwarded(header_value) else {return Vec::new()};
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #87335 <https://github.com/rust-lang/rust/issues/87335> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `axum-client-ip` due to previous error

Caused by:
  process didn't exit successfully: `rustc --crate-name axum_client_ip --edition=2021 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-client-ip-0.4.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=1 -C linker-plugin-lto -C debuginfo=1 -C debug-assertions=on -C metadata=adf3b8cc086e3966 -C extra-filename=-adf3b8cc086e3966 --out-dir /root/torrust-tracker/target/debug/deps -L dependency=/root/torrust-tracker/target/debug/deps --extern axum=/root/torrust-tracker/target/debug/deps/libaxum-d522ab48147e76b9.rmeta --extern forwarded_header_value=/root/torrust-tracker/target/debug/deps/libforwarded_header_value-33dc02f483df1291.rmeta --extern serde=/root/torrust-tracker/target/debug/deps/libserde-5c209eb49ec1a5b4.rmeta --cap-lints allow` (exit status: 1)
warning: build failed, waiting for other jobs to finish...

My enviroment: Debian bookworm (testing) rustc 1.63.0 cargo 1.65.0

Hi @starblazr rust 1.68 is the stable channel since 2023-03-09. let...else statements are already stable. And that is a dependency. If we want to support rust 1.63 we might need to change other dependencies. I would steak to the stable version. If you cannot update rust maybe you can use docker. Anyway, we need to define an official policy for supporting older rust versions.

cc @torrust/torrust-developers

josecelano commented 1 year ago

Hi @Ryahn,

I've created this repo:

https://github.com/josecelano/torrust-tracker-on-ubuntu-focal

I've tried with docker, but I can't reproduce your problem. It's working fine.

Make sure you have at least these dependencies:

apt-get -y install build-essential libsqlite3-dev

If you can run cargo build --verbose and put the output here that may help find your problem.

Ryahn commented 1 year ago

@josecelano lokks like it's working now. I found that once I created a 4G swapfile, it didn't produce any errors. I wasn't getting any out of memory errors. Might have been something with the OS template with the host I am using.

josecelano commented 1 year ago

@josecelano lokks like it's working now. I found that once I created a 4G swapfile, it didn't produce any errors. I wasn't getting any out of memory errors. Might have been something with the OS template with the host I am using.

Same for me, with the docker container, I had to increase the resources. Maybe we should include a "minimum resources needed" list on the app requirements.

We could also add a "troubleshooting" section on the documentation.

cc @torrust/torrust-developers