The release of the Qbs 2.0 build toolset has been announced. Qbs requires Qt among its dependencies for building, although it is designed to organize the build process for any projects. Qbs uses a simplified version of the QML language to define build scripts, allowing for quite flexible build rules that can incorporate external modules, utilize JavaScript functions, and create custom build rules.
The scripting language used in Qbs is adapted for automating the generation and parsing of build scripts in integrated development environments. Furthermore, Qbs does not generate makefiles but controls the launch of compilers and linkers directly, optimizing the build process based on a detailed graph of all dependencies. Having original data about the project's structure and dependencies allows for efficiently parallelizing operations across multiple threads. For large projects consisting of a significant number of files and subdirectories, the performance of rebuilding using Qbs can surpass make by several times—rebuilds occur almost instantly and do not cause developers to waste time waiting.
It is worth reminding that in 2018, the Qt Company decided to stop the development of Qbs. Qbs was developed as a replacement for qmake, but ultimately it was decided to use CMake as the primary build system for Qt in the long term. The development of Qbs is now continued in the form of an independent project, supported by the community and interested developers. The development still utilizes the infrastructure of the Qt Company.
The significant change in version number is due to the implementation of a new JavaScript backend, which replaces QtScript, now deprecated in Qt 6. Continuing to maintain QtScript independently due to the complex bindings to JavaScriptCore has been deemed unrealistic. Therefore, the self-contained and compact JavaScript engine QuickJS, created by Fabrice Bellard, who previously founded projects like QEMU and FFmpeg, has been chosen as the basis for the new backend. The engine supports the ES2019 specification and significantly outperforms existing counterparts (XS by 35%, DukTape more than twice, JerryScript three times, and MuJS seven times).
From the perspective of build script development, the transition to the new engine should not lead to noticeable changes. Performance will also remain roughly at the same level. The new engine has stricter requirements regarding the use of undefined values, which may reveal issues in existing projects that went unnoticed while using QtScript.
Source: opennet.ru
