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

[Question] Build lipq with SSL support #38

Open
iperdomo opened this issue Oct 8, 2019 · 4 comments
Open

[Question] Build lipq with SSL support #38

iperdomo opened this issue Oct 8, 2019 · 4 comments

Comments

@iperdomo
Copy link

iperdomo commented Oct 8, 2019

Hi,

At Akvo we're using Windshaft as one of the components for rendering maps.

When trying to upgrade to a newer version of Windshaft we found the same problem that made us need to compile node-mapnik in the past. The library libpq was compiled without SSL support. You can find other people reporting the same problem, e.g. mapnik/mapnik-support#110 and mapnik/mapnik#3656 when trying to reach a SSL enabled PostGIS server.

Taking .travis.yml as inspiration and just few changes, we managed to compile node-mapnik with SSL support.

Environment:

  • Ubuntu Xenial
  • node.js LTS (10.16.3)

The script: build-node-mapnik.sh

And the full build log of running the script in Ubuntu Xenial (docker image ubuntu:xenial-20190904) (NOTE: some ANSI scape codes are included and not removed)

We would like to propose this change upstream (instead of managing a separate build ourselves)

Is the support for SSL in libpq something you would consider? Can we propose this change to this library?

Thanks for your support.

@Algunenano
Copy link

Is the support for SSL in libpq something you would consider? Can we propose this change to this library?

It's something to consider in the future, but the main issue is that adding an extra dependency (openssl in this case) requires both building the new library, its dependencies and dependants, so at least openssl, libpq, gdal, mapnik and node-mapnik. Otherwise we end up either including multiple versions of a library or adding a dynamic dependency which we don't want in the prebuilts.

It's not a priority right now, but we'll keep it in mind the next time we upgrade dependencies.

@iperdomo
Copy link
Author

iperdomo commented Oct 8, 2019

OK, clear. Many thanks for your support.

@iperdomo
Copy link
Author

iperdomo commented Oct 9, 2019

Your reply got me thinking and realized that my first script only rebuild libpq but not rebuilds mapnik. So I was declaring victory without testing 😞.

I've been trying to build mapnik with mason and the current state of master package (revision 77ab6485) without success 😓

Initially I thought it was my changes but finally I made a minimal test that makes it fail too. No change required, just attempt to build using mason.

The symptom is 2 missing header files cairo.h and ft2build.h. Both are installed as part of the dependencies. In the case of cairo.h the link lives inside a cairo subfolder. The same applies for ft2build.h (inside freetype2).

ccache clang++-5.0 -Qunused-arguments -o src/feature_style_processor.os -c -std=c++11 -DU_USING_ICU_NAMESPACE=0 -fPIC -g3 -gdwarf-4 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -pthread -ftemplate-depth-300 -Wsign-compare -Wshadow -Wno-unsequenced -Wtautological-compare -Wheader-hygiene -O3 -fPIC -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DMAPNIK_NO_ATEXIT -DMAPNIK_ENABLE_GLIBC_WORKAROUND -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DMAPNIK_METRICS -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DSVG_RENDERER -Ideps -Ideps/mapbox/variant/include -Ideps/agg/include -Iinclude -I/usr/local/src/mason_packages/.link/include src/feature_style_processor.cpp
ccache clang++-5.0 -Qunused-arguments -o src/font_engine_freetype.os -c -std=c++11 -DU_USING_ICU_NAMESPACE=0 -fPIC -g3 -gdwarf-4 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -pthread -ftemplate-depth-300 -Wsign-compare -Wshadow -Wno-unsequenced -Wtautological-compare -Wheader-hygiene -O3 -fPIC -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DMAPNIK_NO_ATEXIT -DMAPNIK_ENABLE_GLIBC_WORKAROUND -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DMAPNIK_METRICS -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DSVG_RENDERER -Ideps -Ideps/mapbox/variant/include -Ideps/agg/include -Iinclude -I/usr/local/src/mason_packages/.link/include src/font_engine_freetype.cpp
ccache clang++-5.0 -Qunused-arguments -o src/gradient.os -c -std=c++11 -DU_USING_ICU_NAMESPACE=0 -fPIC -g3 -gdwarf-4 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -pthread -ftemplate-depth-300 -Wsign-compare -Wshadow -Wno-unsequenced -Wtautological-compare -Wheader-hygiene -O3 -fPIC -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DMAPNIK_NO_ATEXIT -DMAPNIK_ENABLE_GLIBC_WORKAROUND -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DMAPNIK_METRICS -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DSVG_RENDERER -Ideps -Ideps/mapbox/variant/include -Ideps/agg/include -Iinclude -I/usr/local/src/mason_packages/.link/include src/gradient.cpp
ccache clang++-5.0 -Qunused-arguments -o src/parse_path.os -c -std=c++11 -DU_USING_ICU_NAMESPACE=0 -fPIC -g3 -gdwarf-4 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -pthread -ftemplate-depth-300 -Wsign-compare -Wshadow -Wno-unsequenced -Wtautological-compare -Wheader-hygiene -O3 -fPIC -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DMAPNIK_NO_ATEXIT -DMAPNIK_ENABLE_GLIBC_WORKAROUND -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DMAPNIK_METRICS -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DSVG_RENDERER -Ideps -Ideps/mapbox/variant/include -Ideps/agg/include -Iinclude -I/usr/local/src/mason_packages/.link/include src/parse_path.cpp
In file included from src/font_engine_freetype.cpp:27:
include/mapnik/text/face.hpp:35:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
         ^~~~~~~~~~~~
ccache clang++-5.0 -Qunused-arguments -o src/image_reader.os -c -std=c++11 -DU_USING_ICU_NAMESPACE=0 -fPIC -g3 -gdwarf-4 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -pthread -ftemplate-depth-300 -Wsign-compare -Wshadow -Wno-unsequenced -Wtautological-compare -Wheader-hygiene -O3 -fPIC -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DMAPNIK_NO_ATEXIT -DMAPNIK_ENABLE_GLIBC_WORKAROUND -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DMAPNIK_METRICS -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DSVG_RENDERER -Ideps -Ideps/mapbox/variant/include -Ideps/agg/include -Iinclude -I/usr/local/src/mason_packages/.link/include src/image_reader.cpp
1 error generated.
scons: *** [src/font_engine_freetype.os] Error 1
src/feature_style_processor.cpp:35:10: fatal error: 'cairo.h' file not found
#include <cairo.h>
         ^~~~~~~~~
1 error generated.
scons: *** [src/feature_style_processor.os] Error 1
scons: building terminated because of errors.
Makefile:55: recipe for target 'mapnik' failed
make: *** [mapnik] Error 2

The full build log is mason-build-mapnink-3.0.15-carto.log

The minimal failing case can be found at debug-build.sh

I've been running this script as part of a docker container

cd /tmp && \
curl -L -o debug-build.sh https://gist.githubusercontent.com/iperdomo/a1e85d87a8d04617020f74e0502affa6/raw/d9fd06ccf28e2059bd4c2eb191ef871c08902b3e/debug-build.sh && \
chmod a+x debug-build.sh && \
docker run --rm -v "$(pwd):/usr/local/src" --workdir "/usr/local/src" ubuntu:xenial-20190904 ./debug-build.sh 2>&1 | tee "build-$(date +%s).log"

Would you mind sharing some thoughts and/or directions on how to fix this issue?

@Algunenano
Copy link

You can see a successful build here: https://travis-ci.org/CartoDB/mason/jobs/556339351

You seem to be missing the include directives for the dependencies downloaded by mason, but I don't know why.

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

2 participants