854
|
|
|
Laurent Montel |
|
5 years ago
|
|
|
853
|
|
|
Stefan Brüns |
|
5 years ago
|
|
|
852
|
|
Bindings: Correct handling of sources containing utf-8
Summary: Depending on the locale, python3 may try to decode the source as ASCII when the file is opened in text mode. This will fail as soon as the code contains utf-8, e.g. (c) symbols.
While it is possible to specify the encoding when reading the file, this is bad for several reasons: - only a very small part of the source is processed via _read_source, no need to decode the complete source and store it as string objects - the clang Cursor.extent.{start,end}.column refers to bytes, not multibyte characters.
While python2 processes utf-8 containing sources without error messages, wrong extent borders are also an issue.
The practical impact is low, as the issue only manifests if there is a multibyte character in front of *and* on the same line as the read token.
Test Plan: Python3: Build any bindings which contains sources with non-ASCII codepoints, e.g. kcoreaddons. Unpatched version fails when using e.g. LANG=C. Python2: Both versions generate sources successfully.
Bytes vs characters test: ``` #define Q_SLOTS class foo { /* a */ public Q_SLOTS: /* ä */ public Q_SLOTS: }; ``` `sip_generator.py --flags "" /usr/lib64/libclang.so Qt5Ruleset.py test.h out.sip` Obviously, both lines should result in the same code, the unfixed version generates `public Q_SLOTS:` vs `public:`.
Reviewers: #frameworks, lbeltrame
Reviewed By: lbeltrame
Subscribers: lbeltrame, bcooksley, jtamate, kde-frameworks-devel, kde-buildsystem
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D15068
|
Stefan Brüns |
|
5 years ago
|
|
|
851
|
|
|
David Faure |
|
5 years ago
|
|
|
850
|
|
|
David Faure |
|
5 years ago
|
|
|
849
|
|
|
l10n daemon script |
|
5 years ago
|
|
|
848
|
|
|
Yuri Chornoivan |
|
5 years ago
|
|
|
847
|
|
|
David Faure |
|
5 years ago
|
|
|
846
|
|
|
Stefan Brüns |
|
5 years ago
|
|
|
845
|
|
Bindings: Use python version matching the found clang python module
Summary: In case both python 2.7 and 3 are installed, but clang python bindings are only installed for python 3, there will be no error message but the self check will fail.
Check for clang bindings for both python2 and python3 (if installed), and use the first one found to generate the sip bindings files.
Note, it is possible to e.g. use python2 to generate the sip binding files (requires clang bindings), but generate bindings for python 2, 3, or both (requires matching python-devel and python-sip-devel packages).
Test Plan: install python3-clang bindings install python2-clang bindings or one of the above
the matching python version is used to run sip_generator.py
Reviewers: #frameworks, arojas
Reviewed By: arojas
Subscribers: kde-frameworks-devel, kde-buildsystem
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D14914
|
Stefan Brüns |
|
5 years ago
|
|
|
844
|
|
|
Stefan Brüns |
|
5 years ago
|
|
|
843
|
|
|
Ben Cooksley |
|
5 years ago
|
|
|
842
|
|
|
A. Wilcox |
|
5 years ago
|
|
|
841
|
|
|
Benjamin Port |
|
5 years ago
|
|
|
840
|
|
|
Stefan Brüns |
|
5 years ago
|
|
|
839
|
|
|
Stefan Brüns |
|
5 years ago
|
|
|
838
|
|
|
l10n daemon script |
|
5 years ago
|
|
|
837
|
|
|
Aleix Pol |
|
5 years ago
|
|
|
836
|
|
|
l10n daemon script |
v5.49.0-rc1 |
5 years ago
|
|
|
835
|
|
|
Aleix Pol |
|
5 years ago
|
|
|