-
Notifications
You must be signed in to change notification settings - Fork 155
PSOL with bazel #2069
Comments
As far as I know nobody has tried to build ngx_pagespeed yet. So we're in uncharted territory. To obtain
If that yields the undefined reference you mention, then I think we're missing a dependency in a |
As far as I understand - it just generates libautomatic.a (that I already listed as a part of my merged pagespeed_automatic.a). And implies to use broken bazel_merge.sh after To be sure, I've tried to use just libautomatic.a as pagespeed_automatic.a and ngx show errors like
I've checked a bit how pagespeed_automatic is made. In "before-bazel" way it uses merge_libraries.sh to combine these libraries:
But now there are almost totally different names, so I've just get all "*.a" libs except few copies and ones that related to envoy and tests.
At the moment I didn't succeed with search for correct dependency name However
So, maybe it needs to include some extra ".a" library? |
@acachy how did you manage to build? I get a lot of errors like this: |
@eilandert, looks like you've already moved far enough in #2084 My previous attempts were forgotten because of fail at the end...
And my last error on attempt to use auto/configure:
Probably we should use other include-paths (for most files there are different copies in different dirs) or better ways to fix include-errors |
Thanks! There are a few things I can use / didn't know When I have some time I'll give it another try. Same as you, trying to fix what I encounter. Never used bazel before ;-) |
Thanks for your pointers, I used them in a slightly different approach but I am a lot further ahead than I was, but I am stuck on the same error now.
After some digging I discovered that glog is build in objects but there is no .a library, so glog is not merged into the pagespeed library. @oschaaf , perhaps we need a bazel/glog.bzl ? Please note, I don't know what i am doing either ;-) Bazel is not my thing yet |
Or we need a @glog//:glog dependency bazel build -c fastbuild @glog//:glog seems to do something ;-) |
Looks like your way is the good one I've build a bunch of extra .a-libs with
Now I have different error (but that build was not completed) |
This is what I do now, I have some troubles with Google URL and ABSL. Can't seem to find the correct dependencies for now, but it's a step further ;-)
|
ok, I do this: https://github.com/eilandert/psol-bazel/blob/master/docker/build.sh
But whatever I do, I get the following error:
Getting close though, I suppose this is the last fence to jump. |
Hi @eilandert |
Hi @Lofesa I am not a dev either ;-) But I like to puzzle. I have it working now with latest master, well at least it passes ./configure from nginx. So PSOL itself should be good to go. I need headers from chromium (I think) to compile the ngx_pagespeed module, but there is no chromium anymore in /third_party. It will take some time but we'll get there sooner or later when I find the time ;-) |
Hi |
Having the pagespeed_automatic.a is not enough, we need the headerfiles to be copied, otherwise the NGINX module is not aware of the functions and how to use them. I think I took care of that in https://github.com/eilandert/psol-bazel/blob/master/docker/build.sh (see the rsync section) Now we have to mess around in the nginx module itself. For example: That is a hard include to (I believe) chromium. So I am not sure to include chromium or to delete or change that line. I am not a dev, but I am willing to take a dive into it, but I am limited in time at the moment. So please bear with me ;-) |
I only intend to help as much as I can reading the code. |
There should be bazel-way to include... And maybe this alternative way would bring problems. Just add system's package libs to merge_libraries.sh call in bazel-merge.sh
|
Same as last errors, but more clear example
Function "SetLogMessageHandler" not exists in mod_pagespeed at all, it can be seen only in /incubator-pagespeed-ngx/testing-dependencies/mod_pagespeed/third_party/chromium/src/base/logging.h As far as I understand - it's not just build problem further...
I think some hybrid of №2+№3 is the best way |
But now there is base/loggin.h I found SetLogMessageHandler in pagespeed/envoy/log_message_handler.cc, but in a comment in an epmty function
I think envoy is the sustitute for chromium and must be included |
@Lofesa I think we need to include the logging.h from the glog package. My approach is not to include /root/.bazel/* but to create a psol.tar.gz package with the libautomatic.a and the needed headers so people can untar it in nginx-1.21.4/modules/ngx_pagespeed/psol without the need to build it with bazel. See the rsync commands in https://github.com/eilandert/psol-bazel/blob/master/docker/build.sh My approach is:
When 3 works we have a proof of concept. Then we continue to:
I think it is not that difficult, but since I am no dev I have to find everything out for myself with common sense, and currently I haven't got the time. I'm not home for a couple of weeks, i've been sent to a hospital far away due to covid to help out (i am actually an healthcare provider) So, it will take time ;-) |
Hey @eilandert & @acachy & @Lofesa awesome job; I think that with some persistence this will be resolved, as it should be viable. Earlier I had hoped that there would be a variant of nginx out there which would support the bazel build system. |
@oschaaf That would be cool, I hope to have time in a couple of weeks too. In the meantime I've created https://github.com/eilandert/psol-bazel , you can clone this, run ./build.sh and docker does all the magic until the first unfixed error in https://github.com/eilandert/pagespeed-ngx-bazel ;-) |
Trying to build nginx-module with current master for very long time...
Since no manuals or PSOL-related internal scripts know about bazel:
Finally I get pagespeed_automatic.a with:
Module build fails with errors about google::LogMessage like
Any suggestions? Probably it was completely wrong way to try
The text was updated successfully, but these errors were encountered: