-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
… sources.lst file) (#150) * Fix config file to no longer depend on a sources.lst file. * Fix readme to show how to build with latest brotli. Also make the build files real-life with optimizations (so everyone doesn't have to search for the best way to compile things). * Fix typo * Cleanup config file to not depend on out-of-date libs * Remove unused variables.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ ngx_brotli is a set of two nginx modules: | |
- ngx_brotli filter module - used to compress responses on-the-fly, | ||
- ngx_brotli static module - used to serve pre-compressed files. | ||
|
||
[](https://travis-ci.org/google/ngx_brotli) | ||
|
||
## Table of Contents | ||
|
||
|
@@ -37,6 +36,29 @@ Both Brotli library and nginx module are under active development. | |
|
||
## Installation | ||
|
||
### Statically compiled | ||
|
||
Checkout the latest `ngx_brotli` and build the dependencies: | ||
|
||
``` | ||
git clone --recurse-submodules -j8 https://github.com/google/ngx_brotli | ||
cd ngx_brotli/deps/brotli | ||
mkdir out && cd out | ||
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed .. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
wyattoday
Author
Contributor
|
||
cmake --build . --config Release --target brotlienc | ||
cd ../../../.. | ||
``` | ||
|
||
|
||
$ cd nginx-1.x.x | ||
$ export CFLAGS="-m64 -march=native -mtune=native -Ofast -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" | ||
$ export LDFLAGS="-m64 -Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections" | ||
$ ./configure --add-module=/path/to/ngx_brotli | ||
$ make && make install | ||
|
||
This will compile the module directly into Nginx. | ||
|
||
|
||
### Dynamically loaded | ||
|
||
$ cd nginx-1.x.x | ||
|
@@ -51,13 +73,7 @@ load_module modules/ngx_http_brotli_filter_module.so; | |
load_module modules/ngx_http_brotli_static_module.so; | ||
``` | ||
|
||
### Statically compiled | ||
|
||
$ cd nginx-1.x.x | ||
$ ./configure --add-module=/path/to/ngx_brotli | ||
$ make && make install | ||
|
||
This will compile the module directly into Nginx. | ||
|
||
## Configuration directives | ||
|
||
|
5 comments
on commit 63ca02a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit broke brotli build in nginx ingress controller
/usr/bin/ld: cannot find -lbrotlienc
/usr/bin/ld: cannot find -lbrotlicommon
collect2: error: ld returned 1 exit status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read the README file. This is a fix to a previous commit, but you need to update any automated scripts to build things correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read the README file. This is a fix to a previous commit, but you need to update any automated scripts to build things correctly.
I'm following what mentioned in https://github.com/kubernetes/ingress-nginx/blob/e2ee3346db6ce667c4b9e79c6944ba405c741db1/images/nginx/rootfs/build.sh#L467C1-L472C21
cd "$BUILD_PATH"
git clone --depth=1 https://github.com/google/ngx_brotli.git
cd ngx_brotli
git submodule init
git submodule update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s a them-bug. Like I said, read the README. Or report it to them (kibernetes) and they can read the README and fix their scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for investigating this @gnsaddy , we will get our scripts updated
Hi, I am wondering why exactly these options are chosen for this README. I had a bad time getting the module to work yesterday. When I switched my builds to
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed ..
all is fine. It seems oddly specific, that's why I am wondering. Thank you for fixing the build.