Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

配合 quiche 编译 Nginx 1.19.10 时出错 #18

Closed
rieval opened this issue Apr 23, 2021 · 8 comments
Closed

配合 quiche 编译 Nginx 1.19.10 时出错 #18

rieval opened this issue Apr 23, 2021 · 8 comments

Comments

@rieval
Copy link

rieval commented Apr 23, 2021

OS: Alpine 3.12

内核: Linux 4.4.0-1060-aws x86_64

GCC: gcc version: 9.3.0 (Alpine 9.3.0)

Nginx 版本: 1.19.10

quiche 版本: 直接 clone 了这个 repo 到 /tmp/quiche/ 目录,然后回滚到 d8bb8e36d5c549c2bc8b87525737899abd061daf 这个commit (大佬 README 所写的测试时的 commit)

Nginx 的部分编译配置:

--with-openssl=/tmp/quiche/deps/boringssl
--with-quiche=/tmp/quiche
--with-cc-opt="-g -Ofast -fPIE -pie -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2 -m64 -O3 -fno-strict-aliasing -DTCP_FASTOPEN=23 -D_GLIBCXX_USE_CXX11_ABI=0 -ffast-math -flto -fuse-linker-plugin --param=ssp-buffer-size=4 -Wformat -Wno-deprecated-declarations -DNGX_LUA_ABORT_AT_PANIC"
--with-ld-opt="-lapr-1 -laprutil-1 -licudata -licuuc -lrt -lpng -lturbojpeg -ljpeg -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,-rpath,/usr/local/lib"

编译时的部分 log(出错前后):

`rustc --crate-name build_script_build --edition=2018 src/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 --cfg 'feature="ffi"' -C metadata=f9071125c3d69bbb -C extra-filename=-f9071125c3d69bbb --out-dir /tmp/quiche/target/debug/build/quiche-f9071125c3d69bbb -C incremental=/tmp/quiche/target/debug/incremental -L dependency=/tmp/quiche/target/debug/deps --extern cmake=/tmp/quiche/target/debug/deps/libcmake-68aa8b03865be436.rlib`

 Running `/tmp/quiche/target/debug/build/ring-e390dddfe04ab00b/build-script-build`

 Running `/tmp/quiche/target/debug/build/quiche-f9071125c3d69bbb/build-script-build`

 Running `rustc --crate-name ring --edition=2018 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="dev_urandom_fallback"' --cfg 'feature="once_cell"' -C metadata=28f9ff3d173ba057 -C extra-filename=-28f9ff3d173ba057 --out-dir /tmp/quiche/target/debug/deps -L dependency=/tmp/quiche/target/debug/deps --extern libc=/tmp/quiche/target/debug/deps/liblibc-cfa004638bb84817.rmeta --extern once_cell=/tmp/quiche/target/debug/deps/libonce_cell-bf7e2012cdbe5b0f.rmeta --extern spin=/tmp/quiche/target/debug/deps/libspin-69e46ebdf28e1a75.rmeta --extern untrusted=/tmp/quiche/target/debug/deps/libuntrusted-9605fa52722215b8.rmeta --cap-lints allow -L native=/tmp/quiche/target/debug/build/ring-741b744bfaca4f3a/out -l static=ring-core -l static=ring-test`

 Running `rustc --crate-name quiche --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --crate-type staticlib --crate-type cdylib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="ffi"' -C metadata=46e4b4bd1a86cc9d --out-dir /tmp/quiche/target/debug/deps -C incremental=/tmp/quiche/target/debug/incremental -L dependency=/tmp/quiche/target/debug/deps --extern lazy_static=/tmp/quiche/target/debug/deps/liblazy_static-685a72be080b70c1.rlib --extern libc=/tmp/quiche/target/debug/deps/liblibc-cfa004638bb84817.rlib --extern libm=/tmp/quiche/target/debug/deps/liblibm-c6ab75713beb40d2.rlib --extern log=/tmp/quiche/target/debug/deps/liblog-668c510e02672168.rlib --extern ring=/tmp/quiche/target/debug/deps/libring-28f9ff3d173ba057.rlib -L native=/tmp/quiche/target/debug/build/ring-741b744bfaca4f3a/out`

error[E0658]: use of unstable library feature 'slice_fill'
--> src/lib.rs:2132:39
|
2132 | out[done..done + pad_len].fill(0);
| ^^^^
|
= note: see issue #70758 <https://github.com/rust-lang/rust/issues/70758> for more information

error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

error: could not compile `quiche`.
Caused by:
process didn't exit successfully: `rustc --crate-name quiche --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --crate-type staticlib --crate-type cdylib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="ffi"' -C metadata=46e4b4bd1a86cc9d --out-dir /tmp/quiche/target/debug/deps -C incremental=/tmp/quiche/target/debug/incremental -L dependency=/tmp/quiche/target/debug/deps --extern lazy_static=/tmp/quiche/target/debug/deps/liblazy_static-685a72be080b70c1.rlib --extern libc=/tmp/quiche/target/debug/deps/liblibc-cfa004638bb84817.rlib --extern libm=/tmp/quiche/target/debug/deps/liblibm-c6ab75713beb40d2.rlib --extern log=/tmp/quiche/target/debug/deps/liblog-668c510e02672168.rlib --extern ring=/tmp/quiche/target/debug/deps/libring-28f9ff3d173ba057.rlib -L native=/tmp/quiche/target/debug/build/ring-741b744bfaca4f3a/out` (exit code: 1)

make[1]: *** [objs/Makefile:2441: /tmp/quiche/target/debug/libquiche.a] Error 101

make[1]: Leaving directory '/tmp/nginx-1.19.10'
make: *** [Makefile:10: build] Error 2

看着像是 quiche 自己的错误?但是看大佬好像编译通过了,所以想请教一下大佬编译时的一些配置什么的

Edited:

好像是 Rust 的错误?

里面提到了 Rust 1.50 版本: rust-lang/rust#70758 (comment)

看了下 Alpine 3.12 的 Rust 版本好像是 1.44.0-r0,先试一下用 Alpine Edge 编译看看

@kn007
Copy link
Owner

kn007 commented Apr 23, 2021

用cargo,说起来。。。这个不应该在上游开个issue么

你有没有尝试使用quiche原版的patch测试?如果也有问题,那就是你环境问题了。

@kn007
Copy link
Owner

kn007 commented Apr 23, 2021

哦,看到你末尾了,要rust1.5以上

@kn007
Copy link
Owner

kn007 commented Apr 23, 2021

@kn007 kn007 closed this as completed Apr 23, 2021
@gaby64
Copy link

gaby64 commented Apr 29, 2021

what is the solution?

im stuck here aswell

@rieval
Copy link
Author

rieval commented Apr 29, 2021

what is the solution?

im stuck here aswell

You could simply solve this issue by using the Alpine Edge image instead of the Alpine 3.1x image.

But you may encounter an error like this: Operation not permitted when install run from make in docker build

At this time, try to use Alpine 3.1x image and add the follow to /etc/apk/repositories:

http://dl-cdn.alpinelinux.org/alpine/edge/main

Install the Rust 1.50 finally:

apk add llvm11-libs cargo>1.50 rust>1.50

@gaby64
Copy link

gaby64 commented Apr 29, 2021

Im running Ubuntu 20.04.2 LTS Server.

@gaby64
Copy link

gaby64 commented May 7, 2021

the specific issue im also encountering is

error[E0599]: no method named `fill` found for slice `[u8]` in the current scope
    --> src/lib.rs:2318:39
     |
2318 |             out[done..done + pad_len].fill(0);
     |                                       ^^^^ method not found in `[u8]`

error: aborting due to previous error

I tried, stable, beta and nightly rust

@kn007
Copy link
Owner

kn007 commented May 8, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants