From e9ec93a471d9a753db01b682e75c52b32adf16f2 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Thu, 18 Feb 2021 21:44:01 +0100 Subject: use LoveIt theme, self hosted --- content/posts/cmake-meson-compcert.md | 39 +++++ content/posts/cpp-standard-version-mix-up.md | 42 ++++++ content/posts/hugo-extended-centos-7.md | 26 ++++ content/posts/kate-cpp-developer-survey.md | 28 ++++ .../images/kate-kde4-20050519.png | Bin 0 -> 76584 bytes .../images/kate-kde4-20050520-more.png | Bin 0 -> 30015 bytes .../images/kate-kde4-20050520.png | Bin 0 -> 28176 bytes .../images/kate-kde4-20050522.png | Bin 0 -> 81506 bytes .../images/kate-kf5-20190412.png | Bin 0 -> 187198 bytes .../images/katetest-kde4-20050515-more.png | Bin 0 -> 66061 bytes .../images/katetest-kde4-20050515-next-one.png | Bin 0 -> 50495 bytes .../images/katetest-kde4-20050515.png | Bin 0 -> 9030 bytes .../images/katetest-kde4-20050516-about-kde.png | Bin 0 -> 63881 bytes .../images/katetest-kde4-20050516-find.png | Bin 0 -> 80394 bytes .../images/katetest-kde4-20050516.png | Bin 0 -> 69019 bytes .../images/katetest-kde4-20050517.png | Bin 0 -> 38837 bytes content/posts/kate-history-kde-4-porting/index.md | 51 +++++++ .../posts/kate-language-server-protocol-client.md | 26 ++++ .../images/kate-diagnostics.png | Bin 0 -> 305770 bytes .../images/kate-document-highlight.png | Bin 0 -> 350934 bytes .../images/kate-find-references.png | Bin 0 -> 315522 bytes .../images/kate-hover.png | Bin 0 -> 356817 bytes content/posts/kate-lsp-client-continued/index.md | 56 +++++++ content/posts/kate-lsp-client-progress.md | 28 ++++ .../images/kate-auto-completion.png | Bin 0 -> 117129 bytes .../images/kate-document-highlight.png | Bin 0 -> 233723 bytes .../images/kate-outline-view.png | Bin 0 -> 258251 bytes content/posts/kate-lsp-client-restart/index.md | 53 +++++++ .../kate-lsp-status-july-21/images/kate-hover.png | Bin 0 -> 362082 bytes content/posts/kate-lsp-status-july-21/index.md | 42 ++++++ .../images/kate-lsp-video.jpg | Bin 0 -> 336680 bytes content/posts/kate-lsp-status-july-22/index.md | 48 ++++++ .../images/kate-on-windows.png | Bin 0 -> 94761 bytes .../images/kstars-on-windows.png | Bin 0 -> 130783 bytes .../images/okular-on-windows.png | Bin 0 -> 191890 bytes content/posts/kde-applications-on-windows/index.md | 91 ++++++++++++ content/posts/kde-ev-wants-you.md | 21 +++ .../images/kate-19.08.1-hidpi-second-screen.png | Bin 0 -> 489760 bytes .../images/kate-19.08.2-hidpi-second-screen.png | Bin 0 -> 796524 bytes .../images/kate-19.08.2-hidpi-selection.png | Bin 0 -> 914994 bytes .../images/kate-master-hidpi.png | Bin 0 -> 958506 bytes content/posts/kde-qt-highdpi-scaling/index.md | 162 +++++++++++++++++++++ .../ktexteditor-kate-bugs-help-appreciated.md | 34 +++++ .../ktexteditor-kate-bugs-scratch-your-own-itch.md | 51 +++++++ content/posts/manjaro-with-kde-on-a-macbook-pro.md | 76 ++++++++++ content/posts/new-website.md | 17 +++ content/posts/privacy-and-hugo-themes.md | 25 ++++ .../qt-creator-4-9-uses-ksyntaxhighlighting.md | 29 ++++ content/posts/removing-files-from-git-history.md | 41 ++++++ content/posts/webserver-transition.md | 59 ++++++++ 50 files changed, 1045 insertions(+) create mode 100644 content/posts/cmake-meson-compcert.md create mode 100644 content/posts/cpp-standard-version-mix-up.md create mode 100644 content/posts/hugo-extended-centos-7.md create mode 100644 content/posts/kate-cpp-developer-survey.md create mode 100644 content/posts/kate-history-kde-4-porting/images/kate-kde4-20050519.png create mode 100644 content/posts/kate-history-kde-4-porting/images/kate-kde4-20050520-more.png create mode 100644 content/posts/kate-history-kde-4-porting/images/kate-kde4-20050520.png create mode 100644 content/posts/kate-history-kde-4-porting/images/kate-kde4-20050522.png create mode 100644 content/posts/kate-history-kde-4-porting/images/kate-kf5-20190412.png create mode 100644 content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515-more.png create mode 100644 content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515-next-one.png create mode 100644 content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515.png create mode 100644 content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516-about-kde.png create mode 100644 content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516-find.png create mode 100644 content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516.png create mode 100644 content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050517.png create mode 100644 content/posts/kate-history-kde-4-porting/index.md create mode 100644 content/posts/kate-language-server-protocol-client.md create mode 100644 content/posts/kate-lsp-client-continued/images/kate-diagnostics.png create mode 100644 content/posts/kate-lsp-client-continued/images/kate-document-highlight.png create mode 100644 content/posts/kate-lsp-client-continued/images/kate-find-references.png create mode 100644 content/posts/kate-lsp-client-continued/images/kate-hover.png create mode 100644 content/posts/kate-lsp-client-continued/index.md create mode 100644 content/posts/kate-lsp-client-progress.md create mode 100644 content/posts/kate-lsp-client-restart/images/kate-auto-completion.png create mode 100644 content/posts/kate-lsp-client-restart/images/kate-document-highlight.png create mode 100644 content/posts/kate-lsp-client-restart/images/kate-outline-view.png create mode 100644 content/posts/kate-lsp-client-restart/index.md create mode 100644 content/posts/kate-lsp-status-july-21/images/kate-hover.png create mode 100644 content/posts/kate-lsp-status-july-21/index.md create mode 100644 content/posts/kate-lsp-status-july-22/images/kate-lsp-video.jpg create mode 100644 content/posts/kate-lsp-status-july-22/index.md create mode 100644 content/posts/kde-applications-on-windows/images/kate-on-windows.png create mode 100644 content/posts/kde-applications-on-windows/images/kstars-on-windows.png create mode 100644 content/posts/kde-applications-on-windows/images/okular-on-windows.png create mode 100644 content/posts/kde-applications-on-windows/index.md create mode 100644 content/posts/kde-ev-wants-you.md create mode 100644 content/posts/kde-qt-highdpi-scaling/images/kate-19.08.1-hidpi-second-screen.png create mode 100644 content/posts/kde-qt-highdpi-scaling/images/kate-19.08.2-hidpi-second-screen.png create mode 100644 content/posts/kde-qt-highdpi-scaling/images/kate-19.08.2-hidpi-selection.png create mode 100644 content/posts/kde-qt-highdpi-scaling/images/kate-master-hidpi.png create mode 100644 content/posts/kde-qt-highdpi-scaling/index.md create mode 100644 content/posts/ktexteditor-kate-bugs-help-appreciated.md create mode 100644 content/posts/ktexteditor-kate-bugs-scratch-your-own-itch.md create mode 100644 content/posts/manjaro-with-kde-on-a-macbook-pro.md create mode 100644 content/posts/new-website.md create mode 100644 content/posts/privacy-and-hugo-themes.md create mode 100644 content/posts/qt-creator-4-9-uses-ksyntaxhighlighting.md create mode 100644 content/posts/removing-files-from-git-history.md create mode 100644 content/posts/webserver-transition.md (limited to 'content/posts') diff --git a/content/posts/cmake-meson-compcert.md b/content/posts/cmake-meson-compcert.md new file mode 100644 index 0000000..371fe27 --- /dev/null +++ b/content/posts/cmake-meson-compcert.md @@ -0,0 +1,39 @@ +--- +title: "CMake & Meson & CompCert" +date: 2020-06-07T16:13:00+02:00 +draft: false +categories: [c, development] +tags: [c] +url: /posts/cmake-meson-compcert/ +author: "Christoph Cullmann" +--- + +I tried to compile the [Picolibc](https://github.com/keith-packard/picolibc) that uses the [Meson build system](https://mesonbuild.com/) with [CompCert](http://compcert.inria.fr/). + +The CompCert install I tried uses the GNU/GCC toolchain for preprocessing and linking. +That makes the compiler relatively compatible to a GCC, beside that not all command line options are supported. + +I was used to [CMake](https://www.cmake.org) projects and there it is normally enough to just set CC=ccomp and you are ready and set (at least if you use the GNU/GCC toolchain). +As long as you don't use special flags in your project, that will just work. + +The Picolibc was the first Meson based project I encountered. + +There setting CC to ccomp just leads to + +{{< highlight bash >}} + meson.build:1:0: ERROR: Unknown compiler(s): [['ccomp']] +{{< / highlight >}} + +I did assume that the project won't compile & link without adjustments, as CompCert doesn't support the full range of command line options like GCC as mentioned above nor the full GNU extensions for C. +But that it directly ends at the compiler initialization in the build system itself was astonishing. + +I searched a bit in the internet and it seems, if I really want to get this working, I actually need to patch Meson itself :/ +(see how to add a new compiler [here](https://github.com/mesonbuild/meson/commit/74602928100394f6129e064f8e0bfe6c9e08c9d2#diff-1eaa302b42bbbba32f1c6d474d08397e)) + +At least I found no other solution, actually, I found no real solution for the above error message at all and the code looks like you need to manually add compilers anyways. + +Given I want to spend work on getting the C library to compile and not fix a build system, it seems easier to go with the [newlib](https://github.com/mirror/newlib-cygwin) that uses the old autotools, +at least for them the compile starts at all with my CC environment variable and you get to places of interest to fix. + +This means for my use case, with a non-standard compiler, I can not see how Meson is an improvement over other existing stuff like CMake or even autotools. +But perhaps this area will improve in the future. diff --git a/content/posts/cpp-standard-version-mix-up.md b/content/posts/cpp-standard-version-mix-up.md new file mode 100644 index 0000000..c6b8802 --- /dev/null +++ b/content/posts/cpp-standard-version-mix-up.md @@ -0,0 +1,42 @@ +--- +title: "C++ Standard Version Mix-up" +date: 2019-12-21T16:09:00+02:00 +draft: false +categories: [cpp, development] +tags: [cpp] +url: /posts/cpp-standard-version-mix-up/ +author: "Christoph Cullmann" +--- + +At [work](https://www.absint.com/) we use the LLVM/clang libraries for pre-processing and parsing C/C++ stuff. + +During some experimenting with the current master version of these libraries, I stumbled on unexpected crashes inside our unit-tests on Windows. + +We work with MSVC 2019 on Windows and all worked fine with LLVM 9.x, but with master, close to all my tests did now segfault in aligned_free. + +I first thought that might be some current regression in LLVM master, but after tracing it back to having DenseSet/Map crashing during destruction, this seemed unlikely. + +On further investigation, the fault is really hilarious: We compiled the LLVM libraries with the default language standard as set there in the CMake tooling: C++14. + +On the other side, we compiled our own tools that use these libraries with C++17. + +Some months ago, the implementation of DenseMap got improved to use the [allocate_buffer/deallocate_buffer](https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/Support/Compiler.h) functions to use (if possible) aligned allocation. + +Unfortunately, this means, during the compilation of the library, the checks there ensure it doesn't use these code paths, on the other side, during compilation of our tools, it does, as the allocation functions are fully inline in the header including the feature checks. + +For operating systems != Windows, this doesn't hurt that much, as you can use the normal free for stuff allocated with the aligned variants (and vice versa). + +Unfortunately (or fortunately, to detect this screw-up), this doesn't hold for the MSVC run-time on Windows. + +If one uses a consistent C++ standard version for the compilation of the whole tool-chain, all is fine. + +Therefore, if somebody stumbles on the same kind of crashes, perhaps this blog post can avoid some longer bug hunting. + +A usual crash backtrace of such an error would look like: + +{{< highlight c >}} +0x00000000778ca12f - RtlFreeHeap +0x000007fef90ba8b0 - free_base +0x000007fef910ffe2 - aligned_free +0x0000000140113fa7 - llvm::TypeFinder::~TypeFinder +{{< / highlight >}} diff --git a/content/posts/hugo-extended-centos-7.md b/content/posts/hugo-extended-centos-7.md new file mode 100644 index 0000000..1c68b2c --- /dev/null +++ b/content/posts/hugo-extended-centos-7.md @@ -0,0 +1,26 @@ +--- +title: "Hugo Extended on CentOS 7" +date: 2019-04-06T22:55:00+02:00 +draft: false +categories: [www] +tags: [hugo, centos] +url: /posts/hugo-extended-centos-7/ +author: "Christoph Cullmann" +--- + +After first using the Hermit theme, I moved to the Hugo Coder theme to have a nicer front page and menu at the top. + +Unfortunately that needs Hugo in the "extended" version. + +The binary one can download on https://github.com/gohugoio/hugo/releases doesn't run on CentOS 7, unlike the normal variant you get there (too new libstdc++ needed). + +One has to recompile it to get that working. + +To make it easier for others, to do so, just: + +* install golang + gcc-c++ on your CentOS 7 +* download https://github.com/gohugoio/hugo/archive/v0.54.0.tar.gz +* execute in the source directory `go install -tags extended` +* grab the result binary in your ~/go directory + +If you need a pre-compiled one, on your own risk, use the one in my git, https://github.com/christoph-cullmann/cullmann.io. diff --git a/content/posts/kate-cpp-developer-survey.md b/content/posts/kate-cpp-developer-survey.md new file mode 100644 index 0000000..1775760 --- /dev/null +++ b/content/posts/kate-cpp-developer-survey.md @@ -0,0 +1,28 @@ +--- +title: "Kate & C++ Developer Survey" +date: 2019-06-10T22:45:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/kate-cpp-developer-survey/ +author: "Christoph Cullmann" +--- + +While browsing the [ISO C++ homepage](https://isocpp.org) I stumbled over the [results PDF](https://isocpp.org/files/papers/CppDevSurvey-2019-04-summary.pdf) of the [Second Annual C++ Foundation Developer Survey “Lite”](https://isocpp.org/blog/2019/05/results-summary-2019-global-developer-survey-lite). + +I was astonished that Kate made it into the "Which development environments (IDEs) or editors do you use for C++ development?" results. + +;=) Seems not only I use it as my normal editor for working on C++ code. + +And heads up, KDevelop is there, too! + +This is actually the second survey, I missed to notice the first one last year. +The [results PDF](https://isocpp.org/files/papers/CppDevSurvey-2018-02-summary.pdf) from [last year](https://isocpp.org/blog/2018/03/results-summary-cpp-foundation-developer-survey-lite-2018-02) shows Kate did show up already there. + +We shouldn't be that proud of only having less than three percent usage, but still, we are there at all. +I hope we can rise here a bit in the future. + +At least we work on supporting modern C++ standards in the highlighting, e.g. see the recent C++20 improvements ([Phabricator](https://phabricator.kde.org/D21585) + [Commit](https://cgit.kde.org/syntax-highlighting.git/commit/?id=9ba02971123d255c10fca97223538c439e252e3d)). Thanks to Jonathan Poelen for the patch! + +[Language Server Protocol (LSP)](/posts/kate-lsp-client-progress/) would help, too, but my initial work is far from usable, help appreciated. +Beside a hacked "goto definition" nothing works at the moment (and it is hardcoded to just start clangd, no other LSP server). diff --git a/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050519.png b/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050519.png new file mode 100644 index 0000000..17c8cc9 Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050519.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050520-more.png b/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050520-more.png new file mode 100644 index 0000000..46323df Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050520-more.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050520.png b/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050520.png new file mode 100644 index 0000000..708abbc Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050520.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050522.png b/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050522.png new file mode 100644 index 0000000..f8d7a52 Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/kate-kde4-20050522.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/kate-kf5-20190412.png b/content/posts/kate-history-kde-4-porting/images/kate-kf5-20190412.png new file mode 100644 index 0000000..6fd8830 Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/kate-kf5-20190412.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515-more.png b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515-more.png new file mode 100644 index 0000000..c4ea6bb Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515-more.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515-next-one.png b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515-next-one.png new file mode 100644 index 0000000..4cb874f Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515-next-one.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515.png b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515.png new file mode 100644 index 0000000..2fa63b6 Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050515.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516-about-kde.png b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516-about-kde.png new file mode 100644 index 0000000..04e3432 Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516-about-kde.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516-find.png b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516-find.png new file mode 100644 index 0000000..634be73 Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516-find.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516.png b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516.png new file mode 100644 index 0000000..2edee77 Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050516.png differ diff --git a/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050517.png b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050517.png new file mode 100644 index 0000000..947df16 Binary files /dev/null and b/content/posts/kate-history-kde-4-porting/images/katetest-kde4-20050517.png differ diff --git a/content/posts/kate-history-kde-4-porting/index.md b/content/posts/kate-history-kde-4-porting/index.md new file mode 100644 index 0000000..e28d3e2 --- /dev/null +++ b/content/posts/kate-history-kde-4-porting/index.md @@ -0,0 +1,51 @@ +--- +title: "Kate History - KDE 4 Porting" +date: 2019-04-12T23:52:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/kate-history-kde-4-porting/ +author: "Christoph Cullmann" +--- + +During my web site upgrade, I reviewed the old stuff I had hosted on my long gone web sites but still archived here locally. An interesting thing I stumbled on are the KDE 3 -> 4 porting screenshots of Kate I saved in 2005. + +They actually show pretty nicely how far we have gone since 2005 with our development stack. + +The KDE 3 -> 4 transition was a large hassle. It did take weeks of work just to get Kate back into an usable state. + +We first started with some trivial KTextEditor container (a mini KWrite) for the porting to get KTextEditor at all doing something. That started out with something that even had no menu or toolbars working: + +

+ +

+ +This evolved after two days into a kind of working KWrite port (icons still randomly missing): + +

+ +

+ +After the KTextEditor part did work "reasonable", we started with Kate: + +

+ +

+ +And ended up with an initial ported prototype three days later: + +

+ +

+ +And after that a long time of actual polishing for KDE 4.0 did start. Kate was actually one of the first ported applications during the KDE 3 -> 4 transition. + +The KDE 4 -> KF5 transition was much nicer, even thought the Frameworks split did cost a lot of time and resources. But the actual changes to the application code bases were not that radical. + +And where did we end up with this ~14 years later? Actually, just here: + +

+ +

+ +It is still recognizable the same application, thought I hope some progress is visible :=) diff --git a/content/posts/kate-language-server-protocol-client.md b/content/posts/kate-language-server-protocol-client.md new file mode 100644 index 0000000..a346a1e --- /dev/null +++ b/content/posts/kate-language-server-protocol-client.md @@ -0,0 +1,26 @@ +--- +title: "Kate Language Server Protocol Client" +date: 2019-04-28T20:36:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/kate-language-server-protocol-client/ +author: "Christoph Cullmann" +--- + +The [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/overview) allows the integration of stuff like code completion, jump to definition, symbol search and more into an application without manual re-implementation for each language one wants to support. +LSP doesn't fully allow an integration like [KDevelop](https://www.kdevelop.org) or Qt Creator do with the [libclang](https://clang.llvm.org/docs/Tooling.html) based tooling aimed for C/C++ but on the other side offers the possibility to interface with [plenty of languages](https://langserver.org/#implementations-server) without a large effort on the client side. + +If one takes a look at some current [LSP clients list](https://langserver.org/#implementations-client), a lot of editors and IDEs have joined the LSP family in the last years. + +In the past I was always scared away to start implementing this in Kate, as no readily available library was around to do the low-level work for the client. +Whereas you get some reference stuff for the JSON based protocol for JavaScript and such, for Qt nothing was around. + +Fortunately Qt Creator started to implement an LSP client beginning with [the 4.8 release](https://blog.qt.io/blog/2018/12/06/qt-creator-4-8-0-released/). + +Based on this code, I started now to get this into the Kate project plugin. +At the moment not much more has happened then some initial import of the Qt Creator LSP infrastructure code into the [Kate lsp branch](https://cgit.kde.org/kate.git/log/?h=lsp). + +If I get this working (help is welcome!), any improvements will be submitted back to the Qt Creator implementation. +If it really starts to work well in Kate, one might think about some better code sharing in the long term. +But before such plans, first at least some basic things must work for some initial language server like [clangd](https://clang.llvm.org/extra/clangd/). diff --git a/content/posts/kate-lsp-client-continued/images/kate-diagnostics.png b/content/posts/kate-lsp-client-continued/images/kate-diagnostics.png new file mode 100644 index 0000000..4a7f45f Binary files /dev/null and b/content/posts/kate-lsp-client-continued/images/kate-diagnostics.png differ diff --git a/content/posts/kate-lsp-client-continued/images/kate-document-highlight.png b/content/posts/kate-lsp-client-continued/images/kate-document-highlight.png new file mode 100644 index 0000000..4e448c7 Binary files /dev/null and b/content/posts/kate-lsp-client-continued/images/kate-document-highlight.png differ diff --git a/content/posts/kate-lsp-client-continued/images/kate-find-references.png b/content/posts/kate-lsp-client-continued/images/kate-find-references.png new file mode 100644 index 0000000..5b9284f Binary files /dev/null and b/content/posts/kate-lsp-client-continued/images/kate-find-references.png differ diff --git a/content/posts/kate-lsp-client-continued/images/kate-hover.png b/content/posts/kate-lsp-client-continued/images/kate-hover.png new file mode 100644 index 0000000..c4740c3 Binary files /dev/null and b/content/posts/kate-lsp-client-continued/images/kate-hover.png differ diff --git a/content/posts/kate-lsp-client-continued/index.md b/content/posts/kate-lsp-client-continued/index.md new file mode 100644 index 0000000..3ec78af --- /dev/null +++ b/content/posts/kate-lsp-client-continued/index.md @@ -0,0 +1,56 @@ +--- +title: "Kate LSP Client Continued" +date: 2019-07-14T15:33:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/kate-lsp-client-continued/ +author: "Christoph Cullmann" +--- + +The new LSP client by Mark Nauwelaerts made nice progress since the [LSP client restart](/posts/kate-lsp-client-restart/) post last week. + +Reminder: The plugin is not compiled per default, you can turn it on via: + +> cmake -DCMAKE_INSTALL_PREFIX="your prefix" -DENABLE_LSPCLIENT=ON "kate src dir" + +The code can still be found kate.git master, see [lspclient](https://cgit.kde.org/kate.git/tree/addons/lspclient) in the addons directory. + +What is new? + +* Diagnostics support: A tab in the LSP client toolview will show the diagnistics, grouped by file with links to jump to the locations. Issues will be highlighted in the editor view, too. +

+ +

+ +* Find references: Find all references for some variable/function in your complete program. They are listed like the diagnostics grouped per file in an extra tab. +

+ +

+ +* Improved document highlight: Highlight all occurrences of a variable/... inside the current document. Beside highlighting the reads/writes/uses, you get a jump list like for the other stuff as tab, too. +

+ +

+ +A feature I missed to show last time: + +* Hover support: Show more meta info about a code location, like the proper type, useful e.g. for [almost-always-auto](https://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/) C++ programming. +

+ +

+ +We even got already two patches for the fresh plugin: + +* [D22348 - Use the label when insertText or sortText is missing](https://phabricator.kde.org/D22348) +* [D22349 - Don't send the Content-Type header](https://phabricator.kde.org/D22349) + +Both are aimed to improve the support of the Rust LSP server. +As you can see, they got already reviewed and merged. + +Feel welcome to show up on [kwrite-devel@kde.org](mailto:kwrite-devel@kde.org) and help out! +All development discussions regarding this plugin happen there. + +If you are already familiar with Phabricator, post some patch directly at [KDE's Phabricator instance](https://phabricator.kde.org/differential/). + +You want more LSP servers supported? You want to have feature X? You have seen some bug and want it to vanish? => Join! diff --git a/content/posts/kate-lsp-client-progress.md b/content/posts/kate-lsp-client-progress.md new file mode 100644 index 0000000..8b9b3b8 --- /dev/null +++ b/content/posts/kate-lsp-client-progress.md @@ -0,0 +1,28 @@ +--- +title: "Kate LSP Client Progress" +date: 2019-05-13T00:02:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/kate-lsp-client-progress/ +author: "Christoph Cullmann" +--- + +The [Kate lsp branch](https://cgit.kde.org/kate.git/log/?h=lsp) contains now the infrastructure as used by Qt Creator. +In addition, [clangd](https://clang.llvm.org/extra/clangd/) is now somehow started in a working state for the first project opened inside Kate. + +For example, if you use the CMake Kate project generator and you compile Kate from the "lsp" branch, clangd should pick up the compile_commands.json for a CMake generated Kate project. + +;=) Unfortunately not much more than starting and informing clangd about the open workspaces (for the first opened project) works ATM. + +If you press ALT-1 over some identifier, you will get some debug output on the console about found links, like below: + +> qtc.languageclient.parse: content: "{\"id\":\"{812e04c6-2bca-42e3-a632-d616fdc2f7d4}\",\"jsonrpc\":\"2.0\",\"result\":[{\"range\":{\"end\":{\"character\":20,\"line\":67},\"start\":{\"character\":6,\"line\":67}},\"uri\":\"file:///local/cullmann/kde/src/kate/kate/katemainwindow.h\"}]}" + +The current ALT-1 handling is a big hack, as then one just adds the current document and triggers the GotoDefinitionRequest. +A proper implementation tracks the opened/closed documented of the editor. + +But at least in principle Kate is now able to start some language server processes and talk a bit with them, all thanks to the nice code borrowed from Qt Creator. + +:=) As my spare time is limited, any help in bringing the branch up-to-speed is highly welcome, just drop us a mail to [kwrite-devel@kde.org](mailto:kwrite-devel@kde.org) or mail me in private ([cullmann@kde.org](mailto:cullmann@kde.org)). +A working LSP integration will help to make Kate more attractive for programmers of many languages. diff --git a/content/posts/kate-lsp-client-restart/images/kate-auto-completion.png b/content/posts/kate-lsp-client-restart/images/kate-auto-completion.png new file mode 100644 index 0000000..4e03502 Binary files /dev/null and b/content/posts/kate-lsp-client-restart/images/kate-auto-completion.png differ diff --git a/content/posts/kate-lsp-client-restart/images/kate-document-highlight.png b/content/posts/kate-lsp-client-restart/images/kate-document-highlight.png new file mode 100644 index 0000000..819e89d Binary files /dev/null and b/content/posts/kate-lsp-client-restart/images/kate-document-highlight.png differ diff --git a/content/posts/kate-lsp-client-restart/images/kate-outline-view.png b/content/posts/kate-lsp-client-restart/images/kate-outline-view.png new file mode 100644 index 0000000..02311a4 Binary files /dev/null and b/content/posts/kate-lsp-client-restart/images/kate-outline-view.png differ diff --git a/content/posts/kate-lsp-client-restart/index.md b/content/posts/kate-lsp-client-restart/index.md new file mode 100644 index 0000000..7d46bc6 --- /dev/null +++ b/content/posts/kate-lsp-client-restart/index.md @@ -0,0 +1,53 @@ +--- +title: "Kate LSP Client Restart" +date: 2019-07-07T15:13:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/kate-lsp-client-restart/ +author: "Christoph Cullmann" +--- + +Since my last post about the [LSP client progress](/posts/kate-lsp-client-progress/) in May I didn't work on that project at all I think. + +But the good news is, somebody else did scratch that itch on his own ;=) + +We have now a prototype plugin in kate.git master, see [lspclient](https://cgit.kde.org/kate.git/tree/addons/lspclient) in the addons directory. + +It is not compiled per default, you can turn it on via: + +> cmake -DCMAKE_INSTALL_PREFIX="your prefix" -DENABLE_LSPCLIENT=ON "kate src dir" + +It shares no code with my initial prototype. +The author started this without knowing of my work. +This might actually be not that bad, as this plugin is composed of a much smaller code base. +This allows to get familiar with the code easier as with the code I copied over from Qt Creator for my initial try. + +But, even nicer, it does actually work a lot better than my variant, already now! + +What does work (tested with clangd and kate.git/work projects) at the moment: + +* Auto completion: you get the proper LSP server provided completion items +

+ +

+* Outline view: Get an extra tool view with the symbols of your current view +

+ +

+* Document highlight: highlight all occurrences of a variable/... inside the current view +

+ +

+* Code navigation: jump to the definition/declaration + +There is still a lot of stuff missing and this is all prototype quality. +For example the document highlight implementation I added has no way to clear the highlighting at the moment beside document reload. + +But given I just needed one hour to add the document highlight support, I would say the code base is easy to adjust. + +=> If you have time and want a good LSP client, now you can join the fun and have direct results. + +As the author was kind enough to move his work on the plugin to the KDE infrastructure, feel welcome to show up on [kwrite-devel@kde.org](mailto:kwrite-devel@kde.org) and help out! +All development discussions regarding this plugin happen there. +We are happy to accept patches, too, if you are a new contributor! diff --git a/content/posts/kate-lsp-status-july-21/images/kate-hover.png b/content/posts/kate-lsp-status-july-21/images/kate-hover.png new file mode 100644 index 0000000..8755311 Binary files /dev/null and b/content/posts/kate-lsp-status-july-21/images/kate-hover.png differ diff --git a/content/posts/kate-lsp-status-july-21/index.md b/content/posts/kate-lsp-status-july-21/index.md new file mode 100644 index 0000000..1d7405f --- /dev/null +++ b/content/posts/kate-lsp-status-july-21/index.md @@ -0,0 +1,42 @@ +--- +title: "Kate LSP Status - July 21" +date: 2019-07-21T15:18:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/kate-lsp-status-july-21/ +author: "Christoph Cullmann" +--- + +The new LSP client by Mark Nauwelaerts keeps making nice progress. + +It will not be shipped with the KDE Applications 19.08 release, but in master it is now compiled & installed per default. +You only need to activate it on the plugin configuration page in Kate's settings dialog to be able to use it. + +For details how to build Kate master with it's plugins, please take a look at [this guide](https://kate-editor.org/build-it/). + +If you want to start to hack on the plugin, you find it in the kate.git, [addons/lspclient](https://cgit.kde.org/kate.git/tree/addons/lspclient). + +Feel welcome to show up on [kwrite-devel@kde.org](mailto:kwrite-devel@kde.org) and help out! +All development discussions regarding this plugin happen there. + +If you are already familiar with Phabricator, post some patch directly at [KDE's Phabricator instance](https://phabricator.kde.org/differential/). + +What is new this week? + +The most thing are internal cleanups and minor improvements. + +Feature wise, the hover implementation works now more like in other editors or IDEs, you get some nice tool tip after some delay: + +

+ +

+ +Never try to guess again what some *auto* means ;=) + +There is still a lot that can be improved, e.g. a filter for the symbols outline is in work: + +* [D22592 - port symbols view to model/view concept](https://phabricator.kde.org/D22592) + +To be able to later out-source some parts of the generic LSP client code to a library, if there is demand, we will aim to make the plugin be licensed under the MIT license. +This should make it easier for other projects to depend of our code, if wanted. diff --git a/content/posts/kate-lsp-status-july-22/images/kate-lsp-video.jpg b/content/posts/kate-lsp-status-july-22/images/kate-lsp-video.jpg new file mode 100644 index 0000000..016d73e Binary files /dev/null and b/content/posts/kate-lsp-status-july-22/images/kate-lsp-video.jpg differ diff --git a/content/posts/kate-lsp-status-july-22/index.md b/content/posts/kate-lsp-status-july-22/index.md new file mode 100644 index 0000000..2629ab5 --- /dev/null +++ b/content/posts/kate-lsp-status-july-22/index.md @@ -0,0 +1,48 @@ +--- +title: "Kate LSP Status - July 22" +date: 2019-07-22T22:43:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/kate-lsp-status-july-22/ +author: "Christoph Cullmann" +--- + +After my series of LSP client posts, I got the question: What does this actually do? And why should I like this or help with it? + +For the basic question: What the heck is the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/overview), I think my [first post](/posts/kate-language-server-protocol-client/) can help. Or, for more details, just head over to the [official what/why/... page](https://langserver.org/). + +But easier than to describe why it is nice, I can just show the stuff in action. +Below is a video that shows the features that at the moment work with our master branch. +It is shown using the build directory of Kate itself. + +To get a usable build directory, I build my stuff locally with [kdesrc-build](https://kdesrc-build.kde.org/), the only extra config I have in the global section of my **.kdesrc-buildrc** is: + +> cmake-options -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Kate - Unix Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + +This will auto generate the needed **.kateproject** files for the Kate project plugin and the **compile_commands.json** for **clangd** (the LSP server for C/C++ the plugin uses). + +If you manually build your stuff with **cmake**, you can just add the + +> -G "Kate - Unix Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + +parts to your **cmake** call. If you use **ninja** and not **make**, just use + +> -G "Kate - Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + +Then, let's see what you can do, once you are in a prepared build directory and have a **master** version of **Kate** in your **PATH**. + +
+ +I hope the quality is acceptable, that is my first try in a long time to do some screen-cast ;) + +As you can see, this is already in an usable state at least for C/C++ in combination with **clangd**. + +For details how to build Kate master with it's plugins, please take a look at [this guide](https://kate-editor.org/build-it/). + +If you want to start to hack on the plugin, you find it in the kate.git, [addons/lspclient](https://cgit.kde.org/kate.git/tree/addons/lspclient). + +Feel welcome to show up on [kwrite-devel@kde.org](mailto:kwrite-devel@kde.org) and help out! +All development discussions regarding this plugin happen there. + +If you are already familiar with Phabricator, post some patch directly at [KDE's Phabricator instance](https://phabricator.kde.org/differential/). diff --git a/content/posts/kde-applications-on-windows/images/kate-on-windows.png b/content/posts/kde-applications-on-windows/images/kate-on-windows.png new file mode 100644 index 0000000..d7c069f Binary files /dev/null and b/content/posts/kde-applications-on-windows/images/kate-on-windows.png differ diff --git a/content/posts/kde-applications-on-windows/images/kstars-on-windows.png b/content/posts/kde-applications-on-windows/images/kstars-on-windows.png new file mode 100644 index 0000000..f9c3651 Binary files /dev/null and b/content/posts/kde-applications-on-windows/images/kstars-on-windows.png differ diff --git a/content/posts/kde-applications-on-windows/images/okular-on-windows.png b/content/posts/kde-applications-on-windows/images/okular-on-windows.png new file mode 100644 index 0000000..10fc97e Binary files /dev/null and b/content/posts/kde-applications-on-windows/images/okular-on-windows.png differ diff --git a/content/posts/kde-applications-on-windows/index.md b/content/posts/kde-applications-on-windows/index.md new file mode 100644 index 0000000..532b538 --- /dev/null +++ b/content/posts/kde-applications-on-windows/index.md @@ -0,0 +1,91 @@ +--- +title: "KDE applications on Windows" +date: 2019-09-21T23:13:00+02:00 +draft: false +categories: [kde, development] +tags: [kde] +url: /posts/kde-applications-on-windows/ +author: "Christoph Cullmann" +--- + +#### KDE applications on Windows? + +One of the new [goals of KDE](https://dot.kde.org/2019/09/07/kde-decides-three-new-challenges-wayland-consistency-and-apps) is to spread the use of the applications created by the KDE community. +This doesn't only include the use of them on Linux & other Unix-like operating systems, but Windows, too. + +#### The Successes :) + +The KDE community has some successfully cross-platform applications out there, like [Krita](https://krita.org/) and [GCompris](https://gcompris.net/). +The teams behind these applications did some great job to both develop & market them for all operating systems, including Windows. + +#### The Remaining Stuff :( + +Wheres many KDE application can already be built on Windows since years, they have not found a wide spread use there. + +For example [Kate](https://kate-editor.org), the text editor I maintain, is there mostly unknown. +Actually most of the applications we ship with the [KDE Applications releases](https://kde.org/announcements/announce-applications-19.08.1.php) are not widely known on Windows (nor used). + +#### The Plan! + +Already last year we came up with [the task](https://phabricator.kde.org/T9575) to bring more of our applications to the official [Microsoft Store](https://store.microsoft.com) to increase their visibility for the average Windows user. + +#### The Building Blocks + +Hannah von Reth & Kevin Funk provided the means to achieve this: + +* [Craft](https://community.kde.org/Craft) - a meta build system / package manager that can be used on Windows for our stuff +* [KDE Binary Factory](https://binary-factory.kde.org/) - a CI that actually even creates fully signed installers and packages for the store! + +Without their work, nothing would have happened for the "we publish stuff in the store" task. + +More details about that can be found in the wiki and older blog posts: + +* [Using Craft on Windows](https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows) +* [Tips for streamlining KDE applications for deployment on Microsoft Windows](http://kfunk.org/2017/12/20/tips-streamlining-kde-application-for-deployment-microsoft-windows/) +* [CI for Windows installer and macOS bundle generation: KDE Binary Factory](http://kfunk.org/2017/11/17/kde-binary-factory/) + +#### Our Progress :=) + +Based on that work, some applications got now published with the [KDE e.V.](https://ev.kde.org/) account to the Microsoft Store. +The first was [KStars](https://kde.org/applications/education/org.kde.kstars) and after a long gap [Kate](https://kate-editor.org) & [Okular](https://okular.kde.org) followed. + +Direct links to the store entries can be found below (the screenshots are in German, made in a Win10 VM, yes, i18n works on Windows just fine): + +* [Okular - more than a reader](https://www.microsoft.com/store/apps/9N41MSQ1WNM8) + +
+ +* [Kate - Advanced Text Editor](https://www.microsoft.com/store/apps/9NWMW7BB59HW) + +
+ +* [KStars - Astronomy Software](https://www.microsoft.com/store/apps/9PPRZ2QHLXTG) + +
+ +#### Help Wanted! + +At the moment, this is the effort of only a few people and it will only be sustainable if we gain more support. + +Therefore, if you are interested in bringing more of our applications to Windows and helping to maintain them, join in at [this Phabricator task](https://phabricator.kde.org/T9575). + +The tooling might still be a bit rough to use in some places and the documentation is not perfect, but this can be improved! + +#### Why all that? + +I think there is a large user base on Windows that might benefit from our applications and we will benefit from potential more contributors, too. + +Some might say: "Why shall we provide our applications on a proprietary operating system? People shall use fully open systems!" + +I say: "Why shall we ignore all the people that are stuck with a proprietary operating system out of whatever reason?" + +#### P.S. + +And no, the idea is not to publish the stuff exclusively in the Microsoft Store. + +The [KDE Binary Factory](https://binary-factory.kde.org/) outputs normal installers and portable archives, too. + +The Microsoft Store is just a good way to advertise our applications to a broader scope of potential users. +The KDE e.V. published applications are there available for free but you can use any other means to install them. + +Feel free to join the discussion at the [KDE reddit](https://www.reddit.com/r/kde/comments/d7g44o/kde_applications_on_windows_whats_the_current/). diff --git a/content/posts/kde-ev-wants-you.md b/content/posts/kde-ev-wants-you.md new file mode 100644 index 0000000..6dafbc2 --- /dev/null +++ b/content/posts/kde-ev-wants-you.md @@ -0,0 +1,21 @@ +--- +title: "KDE e.V. wants you!" +date: 2019-09-08T11:20:00+02:00 +draft: false +categories: [kde] +tags: [kde] +url: /posts/kde-ev-wants-you/ +author: "Christoph Cullmann" +--- + +At the moment, the yearly KDE conference [Akademy](https://akademy.kde.org/2019) is taking place in Milan. +The yearly [KDE e.V.](https://ev.kde.org) meeting will be tomorrow. + +KDE e.V. is a registered non-profit organization that represents the KDE Community in legal and financial matters. + +For example the KDE e.V. is responsible for paying the servers that run our Phabricator/Bugzilla/Gitlab instances and all our web sites. +KDE e.V. takes care of sponsoring developer sprints and contributor travel costs, too. + +If you are a KDE contributor, consider to join the e.V. to get some vote about its direction. + +If you want to join, just take a short look at [this guide](https://ev.kde.org/getinvolved/members.php). diff --git a/content/posts/kde-qt-highdpi-scaling/images/kate-19.08.1-hidpi-second-screen.png b/content/posts/kde-qt-highdpi-scaling/images/kate-19.08.1-hidpi-second-screen.png new file mode 100644 index 0000000..44f96e8 Binary files /dev/null and b/content/posts/kde-qt-highdpi-scaling/images/kate-19.08.1-hidpi-second-screen.png differ diff --git a/content/posts/kde-qt-highdpi-scaling/images/kate-19.08.2-hidpi-second-screen.png b/content/posts/kde-qt-highdpi-scaling/images/kate-19.08.2-hidpi-second-screen.png new file mode 100644 index 0000000..1c0c81a Binary files /dev/null and b/content/posts/kde-qt-highdpi-scaling/images/kate-19.08.2-hidpi-second-screen.png differ diff --git a/content/posts/kde-qt-highdpi-scaling/images/kate-19.08.2-hidpi-selection.png b/content/posts/kde-qt-highdpi-scaling/images/kate-19.08.2-hidpi-selection.png new file mode 100644 index 0000000..b677031 Binary files /dev/null and b/content/posts/kde-qt-highdpi-scaling/images/kate-19.08.2-hidpi-selection.png differ diff --git a/content/posts/kde-qt-highdpi-scaling/images/kate-master-hidpi.png b/content/posts/kde-qt-highdpi-scaling/images/kate-master-hidpi.png new file mode 100644 index 0000000..4490eaf Binary files /dev/null and b/content/posts/kde-qt-highdpi-scaling/images/kate-master-hidpi.png differ diff --git a/content/posts/kde-qt-highdpi-scaling/index.md b/content/posts/kde-qt-highdpi-scaling/index.md new file mode 100644 index 0000000..28e1f6a --- /dev/null +++ b/content/posts/kde-qt-highdpi-scaling/index.md @@ -0,0 +1,162 @@ +--- +title: "KDE & Qt Applications and High DPI Displays with Scaling" +date: 2019-10-03T18:40:00+02:00 +draft: false +categories: [kde, qt, development] +tags: [kde, qt] +url: /posts/kde-qt-highdpi-scaling/ +author: "Christoph Cullmann" +--- + +### What is a High DPI Display? + +In the past, most displays had (or the OS pretended to have) around [96 PPI](https://en.wikipedia.org/wiki/Dots_per_inch#Computer_monitor_DPI_standards), more or less. + +If you differed a bit and had too small/large UI elements, you mostly just resized your default font size a bit and were kind of happy. + +In the last years, more and more displays arise that have a much higher PPI values, which allows for e.g. very crisp rendering of text. + +I arrived late in that era for my Linux machines by now starting to use two 163 PPI displays. + +Just tweaking your fonts doesn't help here, all other things will still be unbearable small, even if you in addition increase e.g. icon sizes. + +A solution for this is the current trend to just "scale" your UI by some factor, for my displays some factor of 1.5 leads to the most pleasant sizes. + +### How does Qt handle that? + +A detailed description on how Qt does try to tackle the challenges of such displays can be found [here](https://doc.qt.io/qt-5/highdpi.html). + +More or less the gist of this is: +In your application you work on logical pixels (in most cases) and Qt will do the hard work for you to then paint that in real pixels with the right scaling applied. + +In practice, this isn't fully transparent to the programmer. +For example, as soon as you work with QPixmap, you will think a bit about where which pixel variant is used. +You need to be careful to not mix-up the size() of a QPixmap 1:1 with let's say layout/widget sizes in such scaled scenarios, see [here](https://doc.qt.io/qt-5/qpixmap.html#devicePixelRatio). + +### Fine, nice, but what does that mean in practice? + +Let's take a look at how this works out in practice using the latest stable release of KDE & Qt stuff: + +* KDE Plasma 5.16.5 +* KDE Applications 19.08.1 +* KDE Frameworks 5.62.0 +* Qt 5.13.1 + +My setup for the below experiments are two 163 PPI displays with scale factor 1.5. + +I use some [Manjaro Linux](https://manjaro.org/) with open-source AMD drivers for some average middle class card. + +The screenshots are taken on my second screen. +I used PNG to avoid that some JPEG artifacts make the real rendering artifacts unclear, bear with the large size. + +### Experiments on Kate & Konsole + +Let's show the current state with [Kate](https://kate-editor.org) & [Konsole](https://konsole.kde.org), here how Kate 19.08.1 looks if you start it on the second screen with default configuration with COPYING.LIB of ktexteditor.git as file: + +
+ +This looks kind of strange. What you see is actually no split screen, even that is a pure rendering artifacts, actually, the whole Kate windows is more or less one artifacts. + +A user reported this in [Bug 411965 - Rendering issue in dual screen hidpi setup](https://bugs.kde.org/show_bug.cgi?id=411965). +With my new setup I was able to reproduce that, on every Kate start :/ + +The user himself investigated this and came to the same conclusion as me, the culprit is some winId() call in KonsolePart. +As Kate constructs the KonsolePart widget without a parent first and then insert it into a layout, the code inside the part will call [winId()](https://doc.qt.io/qt-5/qwidget.html#winId) on a non-native widget. + +This is now fixed and backported to the 19.08 branch. + +This means, with 19.08.2, you will have the following experience: + +
+ +This somehow looks more like an actual working application. + +For people not able to update, a workaround is to disable both project and terminal plugin in your Kate setup, no ideal solution, but makes Kate at least usable again. + +Is now all fine with Kate? +Unfortunately not, lets change my font size a bit and select things: + +
+ +I selected both in the text view (KTextEditor) and in the KonsolePart to show the issue is not just a plain "we are too dumb to render things" in KTextEditor. +You get equal artifacts with most of our software :( + +I spend some time to trace this issues down in the [QTBUG-66036 - QTextLayout draw() rendering issues with "some" font sizes](https://bugreports.qt.io/browse/QTBUG-66036). + +It came up to not being a text related issue at all. + +To give a small outline how KTextEditor and Konsole render stuff: + +* All things are in pure integer coordinates inside the applications. +* More or less we render some uniform high lines of text. +* Most background/selection coloring is done via [fillRect](https://doc.qt.io/qt-5/qpainter.html#fillRect) with integer coordinates/sizes in both KTextEditor/Konsole. +* KTextEditor paints parts of the text background via [QTextLayout::setFormats](https://doc.qt.io/qt-5/qtextlayout.html#setFormats). +* KTextEditor and Konsole rely in some parts on the clipping to avoid over-painting. + +Given none of both rendering "engines" work anywhere with non-integer coordinates and sizes, the artifacts seems to be strange. +They only occur with fractional scaling, e.g. with 1.5, not with e.g 2.0. + +During debugging, three major issues that lead to the artifacts came up, I created separate bugs for them, as they are not text rendering related: + +#### [QTBUG-78964 - fillRect + Anti-Aliasing + hi-dpi Scaling => missing filled pixels](https://bugreports.qt.io/browse/QTBUG-78964) + +If you use fillRect, even for purely integer coordinates and sizes, if the scaling is fractional and you have the render hint "QPainter::Antialiasing" turned on, it will miss to fill one pixel at the border. +For KTextEditor/Konsole mostly at the lower part of the filling. +A workaround for this, now commited for KTextEditor framework and Konsole is to turn the anti-aliasing off for large parts of the rendering. +Only the parts that actually need it, turn if on again, this doesn't affect e.g. the text anti-aliasing. + +#### [QTBUG-78962 - setClipRect misbehavior for hi-dpi scaling with QRect overload vs. QRectF overload](https://bugreports.qt.io/browse/QTBUG-78962) + +KTextEditor uses setClipRect to avoid overpainting between individual lines. Unfortunately, like fillRect, setClipRect leads to one pixel being clipped away too early for fractional scaling. +A workaround for this is to use the QRectF overload of setClipRect. +Even thought the passed QRectF has the same pure-integer coordinates, this will avoid the clipping errors due to different internal handling. +KTextEditor uses now this workaround. + +#### [QTBUG-78963 - Misbehavior of clipping done for ::paintEvent with hi-dpi fractional scaling](https://bugreports.qt.io/browse/QTBUG-78963) + +Even after all this fixed, Konsole still draws some artifacts. +Konsole is more relying on paintEvent to clip correctly than KTextEditor. +Unfortunately the internal clipping done for the paintEvent seems to have the same off-by-one rounding issues like the manual setClipRect for QRect instead of QRectF. +As we can't control this clipping region in Konsole, I see no easy workaround, beside more often trigger full widget updates, which are costly. + +This leads to this current state of the rendering in the master branch. +I did select + deselect a bit text in the terminal to trigger the paintEvent related clipping failure, you can see a few small one pixel high selection leftovers below the selection area. +You need to play a bit with the scaling factor and font size, too, to trigger the effects, as like all rounding errors, you need specific values to trigger them. + +
+ +I hope the Qt bugs linked above can be fixed in the near future, as I doubt we can add workaround to all the applications affected (nor do we want to) and the clipping issue of the paintEvent, if it really is the reason for the last remaining Konsole artifacts, seems not to be really fixable at all in the application code, beside going away from fine grained repaints. + +Here are the matching [KTextEditor](https://bugs.kde.org/show_bug.cgi?id=390451) and [Konsole](https://bugs.kde.org/show_bug.cgi?id=373232) bug report for the above issues. +The relevant Qt bugs are linked there again, too. + +### Are that all current issues? I assume not. + +I think there are for sure more pitfalls hidden, if you use some fractional scaling and Qt & KDE applications. +Some of our applications are even still horrible broken for any kind of scaling :( + +We are open-source software, patches to improve the current situation are very welcome. + +Perhaps you are able to fix one of the above Qt bugs, that would be great! + +### P.S. Floating point math is hard! + +One thing that disturbed me during trying to get rid of the rendering artifacts, is the bit careless choice of scaling factors people use. + +I can understand that you want to have things 20% larger, but unfortunately, a factor of 1.2 leads to rounding errors all over the place, as 1.2 is no the nice number it seems to be in the hardware double precision floats we use. + +If you want to avoid running in bad artifacts more than needed, please better scale with some factor that is a nicely representable float, like some multiple of 1/16 or 1/32. + +For example some scaling with 1.25 will lead to much less issues than 1.2. + +For details, just read up about how stuff like 0.1 or 0.2 is represented ;=) + +* [Floating Point Arithmetic: Issues and Limitations](https://docs.python.org/3/tutorial/floatingpoint.html) +* [Why 0.1 Does Not Exist In Floating-Point](https://www.exploringbinary.com/why-0-point-1-does-not-exist-in-floating-point/) +* [Binary Fractions](https://floating-point-gui.de/formats/binary/) + +You can ignore that advice and scale like you want, but I won't take care of the artifacts that remain for e.g. 1.1 scaling in some corner cases ;=) + +### Discussion + +Feel free to join the discussion at the [KDE reddit](https://www.reddit.com/r/kde/comments/dct6r1/kde_qt_applications_and_high_dpi_displays_with/). diff --git a/content/posts/ktexteditor-kate-bugs-help-appreciated.md b/content/posts/ktexteditor-kate-bugs-help-appreciated.md new file mode 100644 index 0000000..17bc925 --- /dev/null +++ b/content/posts/ktexteditor-kate-bugs-help-appreciated.md @@ -0,0 +1,34 @@ +--- +title: "KTextEditor/Kate Bugs - Help Appreciated" +date: 2019-05-24T16:20:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/ktexteditor-kate-bugs-help-appreciated/ +author: "Christoph Cullmann" +--- + +The bug report count of KTextEditor (implementing the editing part used in Kate/KWrite/KDevelop/Kile/...) and Kate itself reached again +some value over 200. + +If you have time and need an itch to scratch, any help to tackle the currently open bugs would be highly appreciated. + +The full list can be found with this [bugs.kde.org query](https://bugs.kde.org/buglist.cgi?bug_severity=critical&bug_severity=grave&bug_severity=major&bug_severity=crash&bug_severity=normal&bug_severity=minor&bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=bug_severity%2Cpriority%2Cassigned_to%2Cbug_status%2Cresolution%2Ccomponent%2Cshort_desc%2Cchangeddate%2Cop_sys%2Crep_platform%2Creporter&list_id=1624725&order=bug_id%20DESC&product=frameworks-ktexteditor&product=kate&query_based_on=Kate%2FKWrite%20Bugs&query_format=advanced). + +Easy things anybody with a bit time could do would be: + +* check if the bug still is there with current master builds, if not, close it it +* check if it is the duplicate of a similar still open bug, if yes, mark it as duplicate + +Beside that, patches for any of the existing issues are very welcome. + +I think the best guide how to setup some development environment is on our [KDE Community Wiki](https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source). +I myself use a kdesrc-build environment like described there, too. + +Patches can be submitted for an review via our [KDE Phabricator](https://phabricator.kde.org/differential/). + +If it is just a small change and you don't want to spend time on Phabricator, attaching a git diff versus current master to the bug is ok, too. +Best mark the bug with a **[PATCH]** prefix in the subject. + +The team working on the code is small, therefore please be a bit patient if you wait for reactions. +I hope we have improved our reaction time in the last months but we still are lacking in that respect. diff --git a/content/posts/ktexteditor-kate-bugs-scratch-your-own-itch.md b/content/posts/ktexteditor-kate-bugs-scratch-your-own-itch.md new file mode 100644 index 0000000..7d49dd3 --- /dev/null +++ b/content/posts/ktexteditor-kate-bugs-scratch-your-own-itch.md @@ -0,0 +1,51 @@ +--- +title: "KTextEditor/Kate Bugs - Scratch Your Own Itch" +date: 2019-05-26T14:25:00+02:00 +draft: false +categories: [kde, kate, development] +tags: [kde, kate] +url: /posts/ktexteditor-kate-bugs-scratch-your-own-itch/ +author: "Christoph Cullmann" +--- + +Two days ago I mentioned [here](/posts/ktexteditor-kate-bugs-help-appreciated/) that the bug report count of KTextEditor and Kate has risen to some not that manageable amount. + +For developers that report a bugs or wish, the best way to really get it solved is to scratch your own itch and provide some patch. + +I know this is not feasible for all bug reporters, as not all are developers nor will even the developers all have either time nor perhaps the right skill set to tackle the issue on their own. + +But if you have the time and you are at least a bit familiar with C++/Qt, you should give it a try. + +We can help you to get your patch done, that is much easier for e.g. myself than to motivate me to work on a bug or wish that doesn't concern my normal workflow or lie within my skill set. + +For example we have a lot of issues with left-to-right text rendering or related to languages that use complex Unicode surrogates. +Given I have zero knowledge of any language using this my motivation to dig into these issues is small (and I will more likely break more things than fix them). + +The same holds for issues in our Vi mode. +I don't use this mode myself nor do I really know how Vi commands shall behave in real life. +Therefore any fix or enhancement there is beyond me. + +A good example for such a "Scratch Your Own Itch" approach is [bug 407910](https://bugs.kde.org/show_bug.cgi?id=407910). + +It is a small request, to have some action/shortcut to reset the font size to the default one. +We have since years some zoom in/out actions/shortcuts but nothing to go back to the configured one. + +I rarely use the zoom stuff, perhaps once in a month, if I want to show something to a colleague on my screen or projector and it is really not readable with my normal font size. +Therefore my motivation to invest any work into yet an other action I will not use regularly is small. + +But, in this case, the reporter had the time to invest a bit work into this. + +He provided a patch via our [KDE Phabricator - D21412](https://phabricator.kde.org/D21412). + +We needed some iterations to get the patch into a usable shape in the bug report and in Phabricator, but thanks to the persistence of the reporter, it got now [pushed](https://cgit.kde.org/ktexteditor.git/commit/?id=968af10fd4b64cccf6a858f105ac6cfad9fce78e) to our repository. + +If nobody would have stepped up to provide at least some initial patch for this, such a request for sure would have rotted again in our bug database. + +This is not the first time such a nice thing happened, this is just a recent example how such things can work out. + +Therefore, if you report something and are capable of given it a try on your own, please do so! + +Perhaps even some of the existing [bugs](https://bugs.kde.org/buglist.cgi?bug_severity=critical&bug_severity=grave&bug_severity=major&bug_severity=crash&bug_severity=normal&bug_severity=minor&bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=bug_severity%2Cpriority%2Cassigned_to%2Cbug_status%2Cresolution%2Ccomponent%2Cshort_desc%2Cchangeddate%2Cop_sys%2Crep_platform%2Creporter&known_name=Kate%2FKWrite%20Bugs&list_id=1625288&product=frameworks-ktexteditor&product=kate&query_based_on=Kate%2FKWrite%20Bugs&query_format=advanced) or [wishes](https://bugs.kde.org/buglist.cgi?bug_severity=wishlist&bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=product%2Ccomponent%2Cassigned_to%2Cbug_status%2Cresolution%2Cshort_desc%2Cchangeddate%2Creporter%2Creporter_realname&known_name=Kate%2FKWrite%20Wishs&list_id=1625290&product=frameworks-ktexteditor&product=kate&query_based_on=Kate%2FKWrite%20Wishs&query_format=advanced) are stuff you want to take care of yourself because they concern you! + +I think not a lot motivates your more to do something than an issue you have with a tool for your workflow. +At least for me that was the reason to at all start the development of Kate (I missed a MDI variant of KWrite) and join the work on stuff like KTextEditor. diff --git a/content/posts/manjaro-with-kde-on-a-macbook-pro.md b/content/posts/manjaro-with-kde-on-a-macbook-pro.md new file mode 100644 index 0000000..2e9c15e --- /dev/null +++ b/content/posts/manjaro-with-kde-on-a-macbook-pro.md @@ -0,0 +1,76 @@ +--- +title: "Manjaro with KDE on a MacBook Pro" +date: 2020-01-14T21:22:00+02:00 +draft: false +categories: [KDE, Kate, macOS] +tags: [KDE, Kate, macOS] +url: /posts/manjaro-with-kde-on-a-macbook-pro.md/ +author: "Christoph Cullmann" +--- + +I bought a MacBook end of 2014. +My initial reason to buy it was to [improve the Kate port](https://kate-editor.org/2015/01/03/kate5-on-mac/) for macOS. +Beside that, I wanted to try if the Apple ecosystem and macOS are really that great and will solve all my issues in life (short answer: no, they aren't, at least not for me). +The HiDPI screen looked nice, too :=) + +After some initial "not a lot works", if you don't go the [Homebrew](https://brew.sh/) or [MacPorts](https://www.macports.org/) way, the Kate port improved over the following years. + +I learned a lot about standalone non-Linux deployment of applications and macOS specifics in the process. + +As a side-effect of my porting efforts, with the help of others, I was able to improve the deployment of [KDE Frameworks](https://api.kde.org/frameworks/index.html) in some ways, e.g. by allowing to bundle more stuff inside [Qt resources](https://doc.qt.io/qt-5/resources.html). + +For example the [KSyntaxHighlighting](https://api.kde.org/frameworks/syntax-highlighting/html/index.html) or [KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/index.html) frameworks are now just a library you link, you don't need to deploy any extra data files. +This is a huge improvement, if you want to bundle them with your standalone application. + +Unfortunately, my initial hope, that we would get more people contributing to the macOS port (and with this to KTextEditor/Kate/...) didn't really take off. + +Beside some minimal help, not a lot happened. + +I think my last self-provided bundle update for macOS was in [2016](https://kate-editor.org/2016/06/16/new-katekwrite-bundles-for-mac/). + +The binary factory still churns out new builds, you can grab them via the links on our [download page](https://kate-editor.org/get-it/). + +I occasionally tried them, but they never got polished in a way like our Windows variants that we now even ship via the [Windows Store](https://www.microsoft.com/store/apps/9NWMW7BB59HW). + +Apple doesn't make the world a better place with each update of macOS, see for example the now necessary notarized builds and the effort the cause for e.g. [Krita](https://krita.org/en/item/first-notarized-macos-build-of-krita/) +(and with necessary I mean: you shall do it, otherwise your users are nagged with "do you really want to execute this..." stuff that makes a very bad impression). + +In the last years, I used my MacBook more or less just to either grab some stuff from iTunes or do stuff inside my Linux VirtualBox there. + +Given I anyways have a proper Windows 10 VM to take care of the Windows development for Kate (yes, Apple, Microsoft allows that officially, you can just buy a license, you can even get some 'free' developer VM images for a fixed time...), I just migrated my seldom used iTunes account to that machine. + +With that away, I just installed purely [Manjaro Linux](https://manjaro.org/) on my MacBook last evening, who cares, I anyways don't use macOS at all beside as VirtualBox startup environment. + +I searched for some pointers in the internet, in the past I already had some parallel install. +If you search a bit, you will find various hints how to do it. + +If people want to do the same as me, a pure Manjaro install without keeping any macOS around, here a minimal how-to for a MacBook Pro Retina 13" (model number MGX82**/A, model id MacBookPro11,1): + +* Get the USB installer from their [Manjaro Linux](https://manjaro.org/) homepage, I used the KDE variant ;=) + +* Get it on a stick and plug it into your MacBook + +* Boot up your MacBook (pressing the ALT key) + +* Select the EFI boot option. + +* Start the live system, like on any other machine + +* If you want to have internet, which is a good idea to e.g. later easily install the Broadcom driver, use your mobile phone with USB-tethering + +* Install it normally, I used the "erase my full drive and encrypt it" variant. Be careful, your data is gone afterwards, you got warned! + +* Reboot your MacBook, you will boot into your fresh installed Manjaro + +* Install the matching Broadcom driver for your kernel, something like "linux54-broadcom-wl" + +* Install some fan control like "mbpfan-git" and enable it afterwards with "sudo systemctl enable mbpfan" + "sudo systemctl start mbpfan" + +For me this did the job and the stuff is running well enough. +The webcam won't work without additional effort, not that I use it. +No idea if Bluetooth or other stuff like the Thunderbolt ports work, but I never used that even on macOS. + +Fortunately the HiDPI support on Linux & Qt & KDE has gone a long way since my initial try 2015 and now, with some scaling of 1.5 or 2, it is all nicely usable ;=) + +Given I still have some macOS machines available at work, I might still try out some Kate bundles there from time to time, but my personal life is now macOS free. + diff --git a/content/posts/new-website.md b/content/posts/new-website.md new file mode 100644 index 0000000..beafa0c --- /dev/null +++ b/content/posts/new-website.md @@ -0,0 +1,17 @@ +--- +title: "New Website" +date: 2019-04-06T18:18:00+02:00 +draft: false +categories: [www] +tags: [hugo] +url: /posts/new-website/ +author: "Christoph Cullmann" +--- + +After several years of failing to update my personal WordPress page, I restarted my website with the [Hugo framework](https://gohugo.io/). + +The new website uses zero cookies (yes, no stupid cookie question) and no kind of analytic software. + +I hope my [Impressum](/impressum/) is done well enough to avoid any legal issues. + +At the moment the website is still very empty, I hope to fill in more content about my open source projects and academic stuff in the near future. diff --git a/content/posts/privacy-and-hugo-themes.md b/content/posts/privacy-and-hugo-themes.md new file mode 100644 index 0000000..82e35ef --- /dev/null +++ b/content/posts/privacy-and-hugo-themes.md @@ -0,0 +1,25 @@ +--- +title: "Privacy and Hugo Themes" +date: 2019-04-07T17:10:00+02:00 +draft: false +categories: [www] +tags: [hugo, privacy] +url: /posts/privacy-and-hugo-themes/ +author: "Christoph Cullmann" +--- + +I use the "Hugo Coder" theme for this page. + +After creating the [privacy page (Impressum)](/impressum/), I did take a closer look at the generated HTML code to confirm I didn't miss to state things there. + +I thought, given Hugo generates plain static HTML pages, I would be on the safe side. + +But unfortunately, the theme I use includes some external resources, like the Google web fonts... + +I now patched that out in my [fork](https://github.com/christoph-cullmann/hugo-coder) of the theme and provide local copies on my own server. + +The local mirrored files can be found [here](https://github.com/christoph-cullmann/cullmann.io/tree/master/static). + +Actually, this shows, for a "normal" user, it is really hard to ensure no privacy violations are on his/her/... website, given you need to control each and every page. + +This is already ugly with static pages, like the stuff generated here (and I hope I missed nothing), but with dynamic websites this is... diff --git a/content/posts/qt-creator-4-9-uses-ksyntaxhighlighting.md b/content/posts/qt-creator-4-9-uses-ksyntaxhighlighting.md new file mode 100644 index 0000000..84b6989 --- /dev/null +++ b/content/posts/qt-creator-4-9-uses-ksyntaxhighlighting.md @@ -0,0 +1,29 @@ +--- +title: "Qt Creator 4.9 uses KSyntaxHighlighting" +date: 2019-04-16T20:45:00+02:00 +draft: false +categories: [kde, qt, development] +tags: [kde, qt] +url: /posts/qt-creator-4-9-uses-ksyntaxhighlighting/ +author: "Christoph Cullmann" +--- + +As you can read in the [official Creator 4.9.0 release announcement](https://blog.qt.io/blog/2019/04/15/qt-creator-4-9-0-released/), Qt Creator now uses the [KSyntaxHighlighting Framework](https://api.kde.org/frameworks/syntax-highlighting/html/index.html) for providing the [generic highlighting](https://doc.qt.io/qtcreator/creator-highlighting.html#generic-highlighting). + +This is a nice step for the wider adoption of this [MIT](https://opensource.org/licenses/MIT) licensed part of the [KDE Frameworks](https://api.kde.org/frameworks/index.html). + +And this is not just an one-way consumption of our work. + +The framework got actively patches back that make it more usable for other consumers, too, like [Kate](https://kate-editor.org) ;=) + +If you want concrete examples, take a look at: + +* D18982: [prevent assertion in regex load](https://phabricator.kde.org/D18982) +* D18996: [Fix building with namespaced Qt](https://phabricator.kde.org/D18996) +* D18997: [Add functions returning all definitions for a mimetype or file name](https://phabricator.kde.org/D18997) +* D19200: [Return sorted definitions for file names and mime types](https://phabricator.kde.org/D19200) +* D19215: [Install DefinitionDownloader header](https://phabricator.kde.org/D19215) + +I hope this cooperation will continue in the future. +I thank the people working on Qt Creator that made this integration possible. +I hope the initial effort will pay of with less code for them to maintain on their own and more improvements of the framework for all users. diff --git a/content/posts/removing-files-from-git-history.md b/content/posts/removing-files-from-git-history.md new file mode 100644 index 0000000..45296e7 --- /dev/null +++ b/content/posts/removing-files-from-git-history.md @@ -0,0 +1,41 @@ +--- +title: "Removing Files from Git History" +date: 2019-04-15T20:07:00+02:00 +draft: false +categories: [git, development] +tags: [git] +url: /posts/removing-files-from-git-history/ +author: "Christoph Cullmann" +--- + +Today I did run again into an old problem: +You need to archive a lot small and large files inside a single Git repository and you have no support for [Git LFS](https://git-lfs.github.com/) available. +You did this several year and now you ended up in a state where cloning and working with the repository is unbearable slow. + +What now? Last time I did run into that, I archived the overfull repository to some "rest in peace" space and used `git filter-branch` to filter out no longer needed and too large objects from a repository copy that then will replace the old one for daily use. + +There are a lot of guides available how to use `git filter-branch` for that. +All variants I ever used were complex to do and did take very long. +Especially if you need several tries to get a sane set of stuff you want to remove to gain enough space savings. + +This time, I searched once more and stumbled on the [BFG Repo-Cleaner](https://rtyley.github.io/bfg-repo-cleaner/). +And yes, it does what it promises on the web site and it seems to be trusted enough to be advertised by e.g. [GitHub](https://help.github.com/en/articles/removing-sensitive-data-from-a-repository), too. + +Just following the steps described on their [landing page](https://rtyley.github.io/bfg-repo-cleaner/) allows to shrink your stuff nicely and without a lot of round-trip time. + +If you still are just in the "experimenting" phase to see which space decrease one can archive with which file size filter (or which files you want to purge by removing them from master before running the tool), I recommend to swap the step + +{{< highlight bash >}} +git reflog expire --expire=now --all && git gc --prune=now --aggressive +{{< / highlight >}} + +with just + +{{< highlight bash >}} +git reflog expire --expire=now --all && git gc --prune=now +{{< / highlight >}} + +to not wait potential hours for the aggressive GC. +For me that was good enough to get some estimate of the later size for my experiments before I settled to some final settings and did the real run. + +And as always, if you touch your Git history: **Do that only if you really need to, keep backups, check carefully that afterwards the repository is in some sensible state (`git fsck --strict` is your friend) and inform all people using that repository that they will need to do a full new clone.** diff --git a/content/posts/webserver-transition.md b/content/posts/webserver-transition.md new file mode 100644 index 0000000..63d0de3 --- /dev/null +++ b/content/posts/webserver-transition.md @@ -0,0 +1,59 @@ +--- +title: "Web-Server Transition" +date: 2019-04-08T23:59:00+02:00 +draft: false +categories: [www] +tags: [centos, apache, mariadb] +url: /posts/webserver-transition/ +author: "Christoph Cullmann" +--- + +Several years the [kate-editor.org](https://kate-editor.org) & [cullmann.io](https://cullmann.io) pages got hosted on a [Hetzner](https://www.hetzner.de/) root server. +To reduce costs and switch away from old hardware they got now moved to an [OpenVZ](https://openvz.org/) based virtual server at [Host Europe](https://www.hosteurope.de). + +On both servers [CentOS](https://centos.org) 7.x is running, it did always provide a stable foundation for the services these sites use. + +As with any server move in the past, I always need to search how to best move the data/config from one server to the other. +To document this for me and others, here the quick way to move the basic things needed for web services using just plain [Apache](https://httpd.apache.org/) & [MariaDB](https://mariadb.org/). + +The following steps assume you have installed the same packages on both machines and the new machine is allowed to ssh as root to the old one. +If you have non-system users, you should create them with the same ids as on the old server. + +For the following shell commands, the old server address is $SERV and the MariaDB root password is $PASS on both machines. +Best use the raw IP as address if you are in parallel updating your DNS entries to avoid confusion (and wrong syncs). + +**Attention: Wrong syncing of stuff can have disastrous consequences! Check all commands again before executing them, don't trust random people like me without verification!** + +* sync your data, assuming it is in /home and /srv/(ftp/www) + +{{< highlight bash >}} +rsync --delete -av root@$SERV:/home/ /home +rsync --delete -av root@$SERV:/srv/ftp /srv +rsync --delete -av root@$SERV:/srv/www /srv +{{< / highlight >}} + +* transfer your databases + +{{< highlight bash >}} +ssh root@$SERV "mysqldump -u root -p$PASS --all-databases > /root/db.sql" +scp root@$SERV:/root/db.sql /root/ +mysql -u root -p$PASS < /root/db.sql +{{< / highlight >}} + +* sync configs (you might need more, this is just apache & vsftp) + +{{< highlight bash >}} +rsync --delete -av root@$SERV:/etc/httpd /etc +rsync --delete -av root@$SERV:/etc/letsencrypt /etc +rsync --delete -av root@$SERV:/etc/vsftpd /etc +{{< / highlight >}} + +* get crontabs over for later re-use, store them in the root home + +{{< highlight bash >}} +rsync --delete -av root@$SERV:/var/spool/cron /root +{{< / highlight >}} + +Now all things should be there and after some service restarts e.g. [WordPress](https://wordpress.org/) powered pages should be up-and-running again. + +I hope this short how-to helps others and allows me to avoid searching stuff in the future once again from scratch. -- cgit v1.2.3