digitalmars.D.learn - what am I missing here with that working dir?
- DFTW (22/22) Mar 15 2019 I'd like to call a executable which works fine on terminal if
- FreeSlave (3/4) Mar 16 2019 Maybe the terminal and your utility you run wkhtmltopdf from have
- DFTW (11/15) Mar 18 2019 I guessed so, I've tried set the env as well:
- Andre Pany (8/25) Mar 18 2019 My assumption is, the issue is not related to D or the working
- Andre Pany (6/29) Mar 18 2019 Also did you try, just this command?
- DFTW (5/32) Mar 18 2019 You're right, it's a linux issue. I did get rid of the binaries
I'd like to call a executable which works fine on terminal if called within the bin directory otherwise it give missing issues. To archive the same on my D program, I did set the working dir but I get an error saying a .so file couldn't be found. What am I missing here? enum app = "/path/to/wkhtmltox-0.12.4_linux-generic-i386/wkhtmltox/bin/wkhtmltopdf"; enum html = "/path/to/my/htmlFile.htm"; enum pdf = "/path/to/output/foo.pdf"; // is this the correct working dir? enum workingDir = "/path/to/wkhtmltox-0.12.4_linux-generic-i386/wkhtmltox/bin"; import std.process : execute, Config; auto conv = execute([app, html,pdf], null, Config.none, size_t.max, workingDir); writeln(conv); Gives the error: Tuple!(int, "status", string, "output")(127, "/path/to/wkhtmltox-0.12.4_linux-generic-i386/wkhtmltox/bin/wkhtmltopdf" error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory\n")
Mar 15 2019
On Friday, 15 March 2019 at 21:48:50 UTC, DFTW wrote:What am I missing here?Maybe the terminal and your utility you run wkhtmltopdf from have different environment?
Mar 16 2019
On Saturday, 16 March 2019 at 07:27:43 UTC, FreeSlave wrote:On Friday, 15 March 2019 at 21:48:50 UTC, DFTW wrote:I guessed so, I've tried set the env as well: enum env = ["LD_LIBRARY_PATH" : "/path/to/wkhtmltox-0.12.4_linux-generic-i386/wkhtmltox/lib"]; import std.process : execute, Config; auto conv = execute([app, html,pdf], env, Config.newEnv, size_t.max, workingDir); but that doesn't work either.What am I missing here?Maybe the terminal and your utility you run wkhtmltopdf from have different environment?
Mar 18 2019
On Monday, 18 March 2019 at 15:23:46 UTC, DFTW wrote:On Saturday, 16 March 2019 at 07:27:43 UTC, FreeSlave wrote:My assumption is, the issue is not related to D or the working dir. It is more a linux thing. Maybe you also try function executeShell. Also did you have a look e.g here https://www.google.com/amp/s/www.cyberciti.biz/faq/debian-ubuntu-linux-wkhtmltopdf-error-while-loading-shared-libraries-libxrender-so-1/amp/ Kind regards AndreOn Friday, 15 March 2019 at 21:48:50 UTC, DFTW wrote:I guessed so, I've tried set the env as well: enum env = ["LD_LIBRARY_PATH" : "/path/to/wkhtmltox-0.12.4_linux-generic-i386/wkhtmltox/lib"]; import std.process : execute, Config; auto conv = execute([app, html,pdf], env, Config.newEnv, size_t.max, workingDir); but that doesn't work either.What am I missing here?Maybe the terminal and your utility you run wkhtmltopdf from have different environment?
Mar 18 2019
On Monday, 18 March 2019 at 15:39:39 UTC, Andre Pany wrote:On Monday, 18 March 2019 at 15:23:46 UTC, DFTW wrote:Also did you try, just this command? auto conv = execute([app, html,pdf]); As you use absolute paths, the working directory is not relevant. Kind regards AndreOn Saturday, 16 March 2019 at 07:27:43 UTC, FreeSlave wrote:My assumption is, the issue is not related to D or the working dir. It is more a linux thing. Maybe you also try function executeShell. Also did you have a look e.g here https://www.google.com/amp/s/www.cyberciti.biz/faq/debian-ubuntu-linux-wkhtmltopdf-error-while-loading-shared-libraries-libxrender-so-1/amp/ Kind regards Andre[...]I guessed so, I've tried set the env as well: enum env = ["LD_LIBRARY_PATH" : "/path/to/wkhtmltox-0.12.4_linux-generic-i386/wkhtmltox/lib"]; import std.process : execute, Config; auto conv = execute([app, html,pdf], env, Config.newEnv, size_t.max, workingDir); but that doesn't work either.
Mar 18 2019
On Monday, 18 March 2019 at 15:39:39 UTC, Andre Pany wrote:On Monday, 18 March 2019 at 15:23:46 UTC, DFTW wrote:You're right, it's a linux issue. I did get rid of the binaries I've had and compile from the source code on my own, just passing the aditional LD_LIBRARY_PATH set to where the .so files were located, it worked fine!On Saturday, 16 March 2019 at 07:27:43 UTC, FreeSlave wrote:My assumption is, the issue is not related to D or the working dir. It is more a linux thing. Maybe you also try function executeShell. Also did you have a look e.g here https://www.google.com/amp/s/www.cyberciti.biz/faq/debian-ubuntu-linux-wkhtmltopdf-error-while-loading-shared-libraries-libxrender-so-1/amp/ Kind regards AndreOn Friday, 15 March 2019 at 21:48:50 UTC, DFTW wrote:I guessed so, I've tried set the env as well: enum env = ["LD_LIBRARY_PATH" : "/path/to/wkhtmltox-0.12.4_linux-generic-i386/wkhtmltox/lib"]; import std.process : execute, Config; auto conv = execute([app, html,pdf], env, Config.newEnv, size_t.max, workingDir); but that doesn't work either.What am I missing here?Maybe the terminal and your utility you run wkhtmltopdf from have different environment?
Mar 18 2019