Packaging/Binaries: Difference between revisions
imported>H7x4 m Fix SRI hash |
imported>Declension m Tidying and minor corrections |
||
Line 287: | Line 287: | ||
== Wrong file paths == | == Wrong file paths == | ||
Some programs will try to access hard-coded FHS file paths like <code>/usr/lib</code> or <code>/opt</code> | Some programs will try to access hard-coded FHS file paths like <code>/usr/lib</code> or <code>/opt</code>. Mostly though, this will produce silent <code>No such file</code> errors, which can break the program. | ||
To make these errors visible, we can use <code>strace</code> | To make these errors visible, we can use <code>strace</code> | ||
Line 300: | Line 300: | ||
</pre> | </pre> | ||
=== Example === | |||
<pre> | <pre> | ||
Line 307: | Line 307: | ||
</pre> | </pre> | ||
This means: process <code>357679</code> is trying to open file <code>0600-k_cache17.bin</code> either from the hard-coded path in <code>/opt/brother/Printers/hll3210cw/inf/lut</code> or from the current workdir. | |||
So, as a quick fix, we could change the working directory of the wrapped binary with [https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh makeWrapper]: | |||
<pre> | <pre> | ||
Line 313: | Line 314: | ||
</pre> | </pre> | ||
=== Finding the failing process === | |||
How can we find which process is throwing the <code>No such file</code> error? Let's search for the process ID and the <code>exec</code> syscall: | |||
<pre> | <pre> |