commit 2a8a2d228d
Author: Matthias Koefferlein <matthias@koefferlein.de>
Date: Fri Feb 26 23:54:08 2021 +0100
One more fix.
commit 8c4d76505c
Author: Matthias Koefferlein <matthias@koefferlein.de>
Date: Fri Feb 26 23:03:07 2021 +0100
More patches for uitools-less build for CentOS 8
commit 2ac28292b8
Author: Matthias Koefferlein <matthias@koefferlein.de>
Date: Fri Feb 26 22:52:27 2021 +0100
First steps for fixing build on CentOS 8 without uitools
* #730: providing a new Qt module named QtUiTools for QUiLoader class support.
* Fixed a compile error on Mac
* Added QtUiTools to some more places
* Fixed a linker issue in the QtUiTools Python lib
* On occasion fixed a infinite recursion problem in the debugger
The recursion happened because by mistake I instantiated a
QApplication inside an in-application Python script. This
crashed the debugger due to infinite recursion. This is not
a real use case but to prevent similar issues, a recursion
sentinel was added.
* Removed QCoreApplication#notify from script bindings
Reasoning: "notify" made standalone scripts using QApplication and
QUiLoader virtually impossible.
Problem description:
- When a QApplication object is instantiated, e.g. in Python, the Qt binding
will install reimplementation hooks as the object may be dynamically
extended.
- A notify is virtual this means the *every* "notify" call in the application
is routed through the interpreter.
- For one thing this will slow down the application
- But as "notify" is called a zillion times this has more than this side effect.
- Specifically "notify" is called from within the QWidget constructor to
indicate a new widget. Then, if a QDialog for example is instatiated, it's
base class constructor will call "notify" when the object isn't ready yet.
- This has another severe side effect: as the object isn't ready yet, it gets
registered in the Python space with the wrong class and QDialog is not visible
as such.
To mitigate these problems, the most efficient solution is to disable "notify"
in general. There is hardly any use case in a script environment (in C++,
apart from hacking the only reasonable use case is exception handling, but
this does not apply to scripts). For providing the call functionality of
"notify" you should better use "postEvent" or "sendEvent" anyway.
So farewell QCoreApplication.notify ...
* Fixed python test for QtUiTools module
* Fixed UiTools test on Qt4 - QUiLoader needs an application object
Co-authored-by: Kazunari Sekigawa <kazunari.sekigawa@gmail.com>
This works:
import klayout.db
import klayout.lib
print(klayout.db.Library.library_names()) # says ["Basic"]
Also works:
from klayout import *
Does not work:
# import klayout.lib needs to be done before the libraries
# are used initially
import klayout.db
print(klayout.db.Library.library_names()) # says []
import klayout.lib
print(klayout.db.Library.library_names()) # says []
This will include the normal Python tests also
in pymod, hence aligning the test base for pymod
and pya.
This feature requires the pya compatibility module.
Python 2 is a bit more picky with respect to
the correct name of the module. If passing "db"
to a module called dbcore, it will exit with
a SystemError.
- Unify structure of Python module sources so the pymod.pri can be used for all modules
- switch to tlcore, dbcore and rdbcore + distutils_src wrapper modules
With these fixes, unit tests pass with MacOS
(set DYLD_LIBRARY_PATH!)
1.) MacOS takes popen vs. pclose seriously
By using fopen we basically spoil the system and other popen
won't work.
2.) For system integrity, MacOS does not propagate DYLD_LIBRARY_PATH
to child processes such as sh. This has to be done explictly.
3.) Search the klayout binary in the right path (klayout.app/...)
4.) Reset KLAYOUT_HOME for less intervention by installed macros
The text writer was made "normalizing": it will introduce
a certain element order (string sorting). This way, OASIS
files can be compared against golden data without
changes in the order due to different implementation of
hash containers.
Minimum build configuration is without Qt, Ruby, curl and expat.
Only Python is required.
This commit also provides a functional (through polling) Qt-less HTTP
implementation through libcurl if enabled.
* Added unit test for this
* Provided an option for easier debugging such issues:
Setting env var KLAYOUT_VERBOSITY will enable debug levels on Python
modules (and all other binaries). Plugin loading issues can
be debugged by setting KLAYOUT_VERBOSITY=21.