setup.py findFile() logic fragile to symlink loops
Michał Górny <[email protected]> Mon, 28 Mar 2022 10:40:32 +0200
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Organization | Gentoo |
| Message-ID | <[email protected]> |
Hi, I've just gotten a report from a Gentoo user that reportlab's setup.py hangs on build command. After short debugging, we've discovered that the findFile() function used to look for freetype2 headers is fragile to symlink loops. For example, nodejs installs the following symlink: /usr/include/nodejs/src -> . Since the function uses os.walk() with follow_symlinks=True, it nests infinitely while trying to follow the symlink. After adding a print- debug, we get the following output: findFile: /usr/include/node findFile: /usr/include/node/libplatform findFile: /usr/include/node/src findFile: /usr/include/node/src/libplatform findFile: /usr/include/node/src/src findFile: /usr/include/node/src/src/libplatform findFile: /usr/include/node/src/src/src findFile: /usr/include/node/src/src/src/libplatform findFile: /usr/include/node/src/src/src/src findFile: /usr/include/node/src/src/src/src/libplatform and so on. Note that reproducing the issue depends on whether os.walk() happens to hit the symlink loop before finding freetype2 headers, i.e. on the filesystem path order. -- Best regards, Michał Górny _______________________________________________ reportlab-users mailing list [email protected] https://pairlist2.pair.net/mailman/listinfo/reportlab-users