CFFI compiled libpango with dependencies? (thai/fribidi/datrie) - python-3.x

I'm trying to setup a precompiled package for aws lambda, which must contain all the required libraries inside it.
My dependencies are : pango and cairo
So, what I did was go to https://fedora.pkgs.org and download the 64 versions of those, but then when I first executed my code (WeasyPrint/cffi) it gave me the following :
OSError: cannot load library 'pango-1.0': libthai.so.1: cannot open
shared object file: No such file or directory. Additionally,
ctypes.util.find_library() did not manage to locate a library called
'pango-1.0'
So I just went the the same website mentioned above, downloaded libthai, and then it gave the same error for libfridi, and then for libdatrie.
I'm just afraid this will never stop, is there any compiled pango with all these dependencies?
Worth nothing that I have absolute no clue what I'm doing, just sorta trying to get this to work.

Related

Pyinstaller saying I am missing libraries

OSError: Python library not found: libpython3.8m.dll, libpython3.8.dll, python38.dll, libpython38m.dll, libpython38.dll
This would mean your Python installation doesn't come with proper library files.
This usually happens by missing development package, or unsuitable build parameters of Python installation.
How do I solve this issue? I am trying to compile my stock market simulator into an exe but I keep on getting this issue. I have tried various solutions, but all of them have no worked.

How can I link a Rust Wasm application with libpq via wasm-pack?

I'm trying to create a NodeJS application with a Wasm database layer. I use Rust, Diesel as a database driver and wasm-pack as a WebAssembly compiler.
When I try to build my service with wasm-pack, it fails trying to link the libpq library. The PQ_LIB_DIR environment variable is set, and the diesel-cli works without any issue, but when I try to compile my service it fails with the following error:
error: linking with `rust-lld` failed: exit code: 1
= note: rust-lld: error: unable to find library -llibpq
How can I fix it?
My system:
OS: Windows 10
Rust: 1.38.0
wasm-pack: 0.8.1
diesel: 1.4.0
PostgreSQL: 12
It's not possible to link to a system library from WebAssembly. You have to use an implementation written in pure Rust code to make it work. You also could use a JavaScript library. But it always has to be inside of the JavaScript runtime environment.
libpq is available inside the postgreSQL installation binary
For example, PosgreSQL Binary Download Site if open the zip distribution postgresql-12.0-1-windows-x64-binaries.zip you can see these 2 files:
pgsql\lib\libpq.dll
pgsql\lib\libpq.lib
You need to specify the LD_LIBRARY_PATH or you can specify the -L in the compiler arguments to tell the folder path which will auto pick those files
If you have used the installer the same file should be there inside the installation folder
You can also refer this stackoverflow link How to I tell Rust where to look for a static library?
--EDIT--
To combine a C library inside a web assemble distribution, we can use this guide - Compiling an Existing C Module to WebAssembly

Unable to import native nodejs module in electron project

I'm working on an open source electron project which I am building using webpack. One requirement for my project is to use the nodegit library which has to be built as a native module.
I've followed what appears to be conventional advice when working with native modules and electron. That is, I run electron-rebuild, have configured the source package to use and finally have configured node-loader to catch the import of any .node files.
Unfortunately, when I go to include the module, I end up with this error:
ERROR in ./node_modules/nodegit/dist/nodegit.js
Module not found: Error: Can't resolve '../build/Debug/nodegit.node' in
'C:\Users\atrauzzi\Development\atrauzzi\gerty\node_modules\nodegit\dist'
# ./node_modules/nodegit/dist/nodegit.js 18:11-49
# ./src/Layer/Domain/Thunktor/Git/CloneGitRepository.ts
# ./src/Layer/Gerty/Component/Repository/AddGitHubRepository.tsx
# ./src/Layer/Gerty/Component/Repository/AddRepository.tsx
# ./src/Layer/Gerty/Component/Workspace.tsx
# ./src/Layer/Gerty/Component/App.tsx
# ./src/Layer/Gerty/GertyServiceProvider.ts
# ./src/Bundle/GertyElectron.ts
The only thing I can see that's suspicious at this point is that when I rebuild the module to work with electron, I only get a Release directory, when the import seems to be looking for Debug:
This could be a red herring however as nodegit is written to try Debug as a fallback after Release has failed.
The general ask here is "How do I get this native module working in my project?".
I also have a corresponding question over at the repo, although on the off chance that my issue is unrelated to the library itself, or that there are some battle-worn veterans of native modules in electron, I figured SO would be a good place to check as well.
Try configuring your webpack by specifying the native module as an external dependancy rather than load it using the node-loader.
https://webpack.js.org/configuration/externals/

Npm package install failure

Trying to learn nodejs following a few articles. I'm able to download and make sure its working using a video from youtube. But now I'm trying to incorporate that in Visual Studio .net 4.5.2. I've tried to added it via new get package manager and the PM console each come back to same error.
"Install-Package: The specified path, file or both are to long. Less than 260 and directory name less than 248" Self explanatory, found this article
So I tried:
npm-flatten
npm-dedupe
also Enable Win32 long paths
It starts adding package npm 3.5.2 files and folders then bombs out and spits the same error. What else am I missing in order to get this package installed?
Thanks for any help

Heroku Library Dependencies via Buildpack, Phantomjs + Webfonts (but generalizable to buildpacks)

After forking this Heroku buildpack (for phantomjs, but I imagine this issue applies for other custom buildpacks) :
https://github.com/stomita/heroku-buildpack-phantomjs
and updating the compile script to pull from a custom phantomjs tar.bz2 file whose bin/phantomjs binary is replaced with this one:
http://arunoda.me/blog/phantomjs-webfonts-build.html
The Heroku build process works correctly, extracts the correct modified binary, but upon getting it to rasterize a web page, comes up with error message (via heroku logs, sans timestamps for succinctness):
app[web.1]: phantomjs: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by phantomjs)
app[web.1]: phantomjs: /lib/libc.so.6: version `GLIBC_2.15' not found (required by phantomjs)
app[web.1]: phantomjs: /lib/libc.so.6: version `GLIBC_2.14' not found (required by phantomjs)
I've tried simply including these files within the tar.bz2 file in various configurations (in different /lib or /usr/lib locations) but this hasn't worked. I realize there's a possibility of having to add some additional path information to the compile script in the buildpack, but perhaps because I'm not quite an Ops person I don't quite get it. Add in the research on buildpacks and people referring to the base /app directory and the compile script having a vendor one, I'm even more confused.
I think this is possible to solve: in fact, it appears that Deepsy has solved the problem here by stating "then I copied libstdc++.so.6 from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 and added it to my custom buildpack and now its working flawlessly :)"
The problem for me, like the bulk of this post is pointing to, is that I don't know what that one line entails, and would greatly appreciate any help. I've spent way too many hours on this, and am genuinely stuck.
Thanks in advance.
Update 1:
I found Deepsy's code in his github repo here and tried to do the same curl approach, also updating the LD_LIBRARY_PATH variable and chmod 777ing the folder's contents (which includes both the binaries and library files). This didn't work (the same error messages come up). Also, my binary requires libc.so.6, which his didn't, but I got that file from my OS.
Interesting too: when trying to add and mv the libc.so.6 library file into the LD_LIBRARY_PATH, my Heroku app crashes. I suspect this might be that adding that library to the LD_LIBRARY_PATH might confuse other binaries within Heroku and use my version, which for whatever reason isn't working for the Heroku instance.
Update 2:
I also tried building the phantomjs binary from scratch and was successful. Turns out I get the exact same sized binary from the second link from the top, and the same calls for the necesarry libraries (thus same errors).
Current thesis:
It might be that the phantomjs binary is seeing the correct lib files given Update 1, but the provided Heroku ones aren't up to date enough for the binary to run correctly. Or it could still be missing the library files.
Either way, I guess I'd need to somehow get phantomjs to use the library files I've provided, and I'm not sure how I'd get to do that.

Resources