-
Notifications
You must be signed in to change notification settings - Fork 389
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
When $TMPDIR is /tmp/foo, leptonica's magic turns /tmp/bar into /tmp/foo/foo/bar. #224
Comments
Steps to reproduce:
|
I believe this problem is now fixed. Download from the head of this tree and see if the tests now work properly with your TMPDIR. -- Dan |
Unfortunately it seems I can still reproduce the issue on the head of the master branch. |
Investigating ... |
There are multiple issues. I expect to have the fixes in by tomorrow. |
Should work OK now. Please give it another try from head. |
Thank you! This solves the issue. :-) Unfortunately (but not surprisingly) the patch can't be applied on top of 1.73. I'm trying to figure out workarounds to make Guix's Leptonica 1.73 package work. Please tell if you have any good ideas. Otherwise, feel free to close the issue. |
Far too much has changed for that patch to work on 1.73. -- Dan |
Is the fix applied to 1.74.1? I'm seeing a spurious "file not found" in fopenReadStream when TMPDIR is set after updating from 1.69. |
Yes. The fixes were made on 12/21/16 and 1.74.1 was released on 1/4/17. Here is the checkin message:
|
Leptonica's test suite passes fine normally, but all tests fail with dozens of "stream not opened" and similar file-related errors when I build Leptonica 1.73 via GNU Guix (which has a peculiar build environment).
Within the Guix build environment,
TMPDIR
is set to/tmp/builddir
. By using strace I noticed that the regression test programs try to open or create files like/tmp/builddir/builddir/foo
which fails because the directory/tmp/builddir/builddir
doesn't exist.Sniffing around Leptonica's source code I found out about the
genPathname
function which contains magic that turns any filename like/tmp/...
into$TMPDIR/...
. I suspect that some functions effectively pass a given filename throughgenPathname
twice, so that whenTMPDIR
is/tmp/foo
, a filename like/tmp/blahblah
becomes/tmp/foo/blahblah
on the first pass, and/tmp/foo/foo/blahblah
on the second pass. (Because the/tmp
part of/tmp/foo/blah
is also turned into/tmp/foo
during the second pass.)I'm sorry that I don't have more precise information right now, like how filenames end up being passed through that transformation two times. I'll take a better look when I find time, if nobody does it on the meanwhile.
The text was updated successfully, but these errors were encountered: