cloudflare / quiche

🥧 Savoury implementation of the QUIC transport protocol and HTTP/3
https://docs.quic.tech/quiche/
BSD 2-Clause "Simplified" License
9.3k stars 700 forks source link

Can't compile quiche patched nginx. #648

Closed RiverKy closed 3 years ago

RiverKy commented 3 years ago

OS: Raspbian GNU/Linux 10 (buster)

Failed to compile nginx when patched with quiche. Excerpts from make output:

error[E0658]: use of unstable library feature 'alloc': this library is unlikely to be stabilized in its current form or name (see issue #27783)
  --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/src/lib.rs:79:1
   |
79 | extern crate alloc;
   | ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
  --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/src/aead/aes.rs:66:22
   |
66 |     let mut result = core::mem::MaybeUninit::uninit();
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no function or associated item named `uninit` found for type `core::mem::MaybeUninit<_>` in the current scope
  --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/src/aead/aes.rs:66:46
   |
66 |     let mut result = core::mem::MaybeUninit::uninit();
   |                      ------------------------^^^^^^
   |                      |
   |                      function or associated item not found in `core::mem::MaybeUninit<_>`

error: aborting due to 3 previous errors

Some errors occurred: E0599, E0658.
For more information about an error, try `rustc --explain E0599`.
error: Could not compile `ring`.

To learn more, run the command again with --verbose.
make[1]: *** [objs/Makefile:1361: ../quiche/target/release/libquiche.a] Error 101
make[1]: Leaving directory '/home/pi/nginx-1.16.1'
make: *** [Makefile:8: build] Error 2
LPardue commented 3 years ago

I suspect you're on a version of Rust that is too old. What do you have?

RiverKy commented 3 years ago

@LPardue I have rustc 1.34.2... So thanks for your reply, I'm gonna upgrade Rust and try again.

LPardue commented 3 years ago

From the readme,

quiche requires Rust 1.39 or later to build

RiverKy commented 3 years ago

Sorry about that. 😂

RiverKy commented 3 years ago

Seems like I still can’t compile that... Is it my fault...?

$ make                             
make -f objs/Makefile
make[1]: Entering directory '/home/pi/nginx/nginx-1.16.1'
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I ../quiche/deps/boringssl/.openssl/include -I ../quiche/include -I objs \
    -o objs/src/event/ngx_event_quic.o \
    src/event/ngx_event_quic.c
src/event/ngx_event_quic.c: In function 'ngx_quic_write_handler':
src/event/ngx_event_quic.c:367:16: error: comparison is always true due to limited range of data type [-Werror=type-limits]
     if (expiry != UINT64_MAX) {
                ^~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:895: objs/src/event/ngx_event_quic.o] Error 1
make[1]: Leaving directory '/home/pi/nginx/nginx-1.16.1'
make: *** [Makefile:8: build] Error 2
junhochoi commented 3 years ago

Are you building it on 32bit OS?

RiverKy commented 3 years ago

@junhochoi Yes. I modified objs/Makefile manually to remove -Werror parameter. I hope it works. 🌚

junhochoi commented 3 years ago

@SkyYkb please try #649 if not works.

RiverKy commented 3 years ago

It works!