-
Notifications
You must be signed in to change notification settings - Fork 361
Compile issues as dynamic module with MUSL #1166
Comments
Sounds like something like -fPIC may be needed for CXXFLAGS. On Tue, Mar 29, 2016 at 11:53 AM, Caleb Champlin [email protected]
|
Sorry I should have mentioned I've already tried building both PSOL and NGINX with -fPIC with no change |
Weird. Did you include it in CFLAGS as well? On Tue, Mar 29, 2016 at 12:50 PM, Caleb Champlin [email protected]
|
Yup. The only thing I didn't do is compile PSOL with LDFLAGS -shared. |
Sorry, looks like I missed CFLAGS on your line above... I am stumped, One other thing that's worth pointing out: Stuff That's actually sort of relevant since the object file you get the link On Tue, Mar 29, 2016 at 4:22 PM, Caleb Champlin [email protected]
|
Okay we can probably close this, it appears that your comment about removing the static libraries from the psol Makefile and adding them to the nginx compilation. Thanks for your help! For anyone who comes across this in the future looking for information on how to get pagespeed to work on Alpine/MUSL here's a quick guide: Grab and build a local version of libpng1.2 Download the PSOL source Patch chromium to compile on MUSL (this is only needed until upstream chromium is used in PSOL, as these changes have already been applied in latest Chromium source) psol-chromium.stacktrace.patch.txt After it's been patched compile mod_pagespeed: Move to pagespeed/automatic Compile PSOL Once that's done you should have a pagespeed_automatic.a available for use, and you can now build nginx. I built ngx_pagespeed as a dynamic module using the following: |
Did you also pass in the -D flags to gyp? It's potentially risky if you On Wed, Mar 30, 2016 at 1:10 PM, Jeffrey Crowell [email protected]
|
I am trying to build from an alpine container, I tried following the guide I am stuck at:
tried compiling with
|
@cchamplin What version of Nginx and ngx_pagespeed you have been using? I don't quite understand what patches should be applied? Those you have linked don't seem to match with the contents of mod_pagespeed repo. |
@natostanco I'm not 100% on that one, APR was not directly built as part of my process, and I don't recall doing anything to prevent it from being built. @iler I built against the prepackaged source available here apache/incubator-pagespeed-mod#968 specifically version 1.10.33.7 |
As an aside FYI I've been asked to try and put together and APK build of this whole thing, which hopefully I'll be able to get to some evening this week. |
@cchamplin Thanks. Will try with that. And +1 for APK build. |
@cchamplin Any chance you faced this problem https://gist.github.com./iler/f1e519168bace48545d494edb7b2baa6? I'm building Docker container and it's failing. You can see the build commands from my Dockerfile https://gist.github.com./iler/90a87a46b50ffe218417871288247afc |
for that thing I just renamed |
|
Okay last night I put some time towards getting an APKBUILD put together for this. It should be available here https://github.com./cchamplin/alpine-ngx-pagespeed This will need some testing as it's first draft, my guess is I might be missing a few makedepends. This should also work a general instructions to get it ngx pagespeed built on Alpine. FYI: This only works against nginx-1.9.11+ as it is linked as a dynamic module. |
@cchamplin Thanks a lot for your efforts! I will go through your repo and work from there. And, yes, I'm aware of bloating the Docker container. I just wanted to slice the build to separate RUN commands to be able to use cache for the working parts of the build. If I encounter some problems I won't have to start downloading everything from scratch. Eventually when everything is working I will change this to one RUN command and do the proper cleanups. But thanks anyway :) |
fyi the difference between compiling statically (without system libs) and with shared libraries (with system libs and deleted files) installing the required packages on alpine ( |
Just to update here that I got this working. Here is my implementation for Docker https://github.com./iler/alpine-nginx-pagespeed if someone needs some advices on this. Thanks @cchamplin for the help! |
I'm trying to get pagespeed to build as a dynamic module for nginx. I'm on Alpine which is a MUSL system.
I've built PSOL from source (with some adjustment to get it to compile).
When attempting to build the nginx module I'm getting a compilation error:
The PSOL was compiled with:
make all BUILDTYPE=Release CXXFLAGS=" -I/usr/include/apr-1 -I/home/test/nginx/libpng-1.2.56 -D_GLIBCXX_USE_CXX11_ABI=0 -Duse_system_libs=1 -Duse_system_icu=1" CFLAGS=" -I/usr/include/apr-1 -I/home/test/nginx/libpng-1.2.56 -D_GLIBCXX_USE_CXX11_ABI=0 -Duse_system_libs=1 -Duse_system_icu=1"
GCC -v
Any help getting this to build would be appreciated.
The text was updated successfully, but these errors were encountered: