Tuesday January 11, 2022 by Ivan Komissarov | Comments
The Qbs build tool version 1.21.0 is available.
Qbs is a community-driven language-agnostic build automation system. It is fast and offers an easy-to-learn language based upon QML.
What's newOver 100 contributions went into this release since version 1.20.0. We have selected a few items below. Have a look into the complete changelog if you are interested in more details.
Named Module Providers
We redesigned the module providers feature. Previously, when Qbs encountered a missing module (say, Qt.core), it searched for a provider that can generate that module based on the module name - Qbs consecutively searched for providers named "Qt.core", "Qt" until it found one. This limited the ways to use providers - ultimately, it was not possible to have more than one provider for a given framework such as
Qt or Boost. Thus, we introduced the new qbsModuleProviders property to the Product and
Project items, which allows to specify which providers are run.
For example, to invoke the Qt provider explicitly in your product, you can do the following:
CppApplication {
Depends { name: "Qt.core" }
files: "main.cpp"
qbsModuleProviders: ["Qt"]
}
It is also possible to prioritize modules generated by different module providers - providers contribute to the search path in the order specified by qbsModuleProviders.
In the following example, the Qt.core module can come both from the "Qt" provider and the
"qbspkgconfig" provider (see below), but modules generated by the "Qt" provider have higher priority, as it
comes first in the list. This can be useful if you want to use a custom Qt installation (the Qt
provider will try to locate qmake in PATH) but also have a fallback for a system Qt provided by pkg-config.
CppApplication {
Depends { name: "Qt.core" }
files: "main.cpp"
qbsModuleProviders: ["Qt", "qbspkgconfig"]
}
We plan to add more providers, such as VCPKG or Conan, in the future.
The qbspkgconfig providerOriginally, Qbs used to use the "fallback" provider based on the pkg-config tool if the searched module was not generated by any other provider. There are several problems with the fallback provider:
- It always tries to generate a module using pkg-config, even for non-C++ projects.
- It does not properly support packages that have special characters in their names, such as the dot in "python-3.9".
- The fallback provider invoked pkg-config several times per module due to limitations of that tool's CLI, which could lead to bad performance when using multiple packages in a project.
Therefore, we added the new qbspkgconfig provider, which uses an internal C++ library for reading .pc files. This gives Qbs access to the information about dependencies between pkg-config packages (which is not available via the CLI) and thus allows it to generate modules with respective dependencies. Also, it works much faster, as we now avoid expensive forking for the pkg-config process.
The new provider and the underlying library mimic the pkg-config tool behavior as much as we consider necessary. If you notice problematic incompatibilities, feel free to submit a bug report.
- The capnproto and protobuf modules can now use runtimes provided by the new qbspkgconfig provider.
- Qbs no longer migrates the profiles/ directory from the settings of a previous versions (QTCREATORBUG-26475), as this was only necessary in the pre-module provider days.
- We fixed a problem on FreeBSD where Qbs did not track changes in source files correctly due to the fact that it used low-precision file times (with milliseconds excluded). Now Qbs always uses high-precision file times on all systems. If you use a non-mainstream UNIX host and experience problems with this, please file a bug report.
- A new ConanfileProbe.verbose property was added which can be useful to debug problems with Conan.
- Added support for C++23.
- Added the Elbrus E2K architecture for the GCC toolchain (QBS-1675).
- A new Android.ndk.buildId property was added, which allows to overwrite the default value (sha1) for the --build-id linker flag.
Qbs is available for download on the download page.
Please report issues in our bug tracker.
Join our Discord server for live discussions.
You can use our mailing list for questions and discussions.
The documentation and wiki are also good places to get started.
Qbs is also available from a number of package repositories (Chocolatey, MacPorts, and Homebrew), and is updated on each release by the Qbs development team. It can also be installed through the native package management system on a number of Linux distributions. Please find a complete overview on repology.org.
Qbs 1.21.0 is also included in Qt Creator 6.0.0.
Contribute
If you are a happy user of Qbs, please tell others about it. But maybe you would like to contribute something. Everything that makes Qbs better is highly appreciated. Contributions may consist of reporting bugs or fixing them right away. But also new features are very welcome. Your patches will be automatically sanity-checked, built and verified on Linux, macOS and Windows by our CI bot.
Get started with instructions in the Qbs Wiki.
Thanks to everybody who made the 1.20 release happen:
- Christian Kandeler
- Christian Stenger
- Davide Pesavento
- Denis Shienkov
- Ivan Komissarov
- Kai Dohmen
- Orgad Shaneh
- Raphaël Cotty
- Richard Weickelt
- Thorbjørn Lindeijer
Share with your friends
- qbs
Attachments
- Original Link
- Original Document
- Permalink
Disclaimer
Qt Group Oyj published this content on 11 January 2022 and is solely responsible for the information contained therein. Distributed by Public, unedited and unaltered, on 11 January 2022 15:37:04 UTC.