cloudflare / quiche

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

Build instructions failing on M1 Mac #1383

Open b5 opened 1 year ago

b5 commented 1 year ago

I'm having trouble running examples at 338c9dbfe423a4e7f6e7181fc357e7b6b8e712b1 on a mac, getting a "missing native static library error":

$ git clone --recursive https://github.com/cloudflare/quiche
...
$ cargo build --examples
   Compiling quiche v0.16.0 (/Users/b5/code/quiche/quiche)
error: could not find native static library `ssl`, perhaps an -L flag is missing?

error: could not compile `quiche` due to previous error

Rust installation details:

$ rustc --version
rustc 1.65.0 (897e37553 2022-11-02)

$ rustup show 
active toolchain
----------------

stable-aarch64-apple-darwin (default)
rustc 1.65.0 (897e37553 2022-11-02)

Thanks!

b5 commented 1 year ago

seems related to #1350

junhochoi commented 1 year ago

Looks ok on my M1 mac (Ventura 13.1):

% cargo build --examples
   Compiling proc-macro2 v1.0.46
   Compiling unicode-ident v1.0.5
   Compiling quote v1.0.21
...
   Compiling sfv v0.9.2
   Compiling qlog v0.8.0 (/Users/junhochoi/src/quiche-master/qlog)
    Finished dev [unoptimized + debuginfo] target(s) in 17.95s
% rustc --version
rustc 1.66.1 (90743e729 2023-01-10)
% uname -a
Darwin m1pro.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64

Maybe you can try with newer rustc?

seems related to https://github.com/cloudflare/quiche/issues/1350 AFAICT #1350 is about cross build, not related with native build.

McRaeAlex commented 1 year ago

Workout around If you made the same mistake I did

cd quiche/deps/boringssl
mkdir build && cd build
cmake -GNinja ..
ninja

Then you should be able to run cargo b --examples

This seems to happen when you run git clone git@github.com:cloudflare/quiche.git then cargo b (which will fail) then git submodule update --init --recursive --remote then cargo b (still fails)

In comparison running git clone git@github.com:cloudflare/quiche.git --recursive and then cargo b works.

It seems the directory structure is different due to the submodule update.