aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2024-01-19 15:45:55 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2024-01-31 17:07:41 +0000
commit3ac33cd6c3f4519336d5266418948b69a4be5657 (patch)
tree92eb1e61fd4f5982bc3d2e2abf2613bf368371fd
parentd00991695ca1933116b51bdb44ab362224930ae0 (diff)
Loader: Deprecate the fallback provider
The fallback provider creates modules for all named dependencies that were not found and only later checks during validation whether such a pkg-config module exists. This breaks assumptions all over the place. Since we have a superior replacement in qbspkgconfig, we now deprecate the fallback provider. Change-Id: I3694515865d63e7308cfab7778068aa2e480fe23 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--doc/howtos.qdoc10
-rw-r--r--doc/qbs.qdoc6
-rw-r--r--doc/reference/items/language/depends.qdoc9
-rw-r--r--src/lib/corelib/language/builtindeclarations.cpp10
4 files changed, 14 insertions, 21 deletions
diff --git a/doc/howtos.qdoc b/doc/howtos.qdoc
index 268bee7c0..b3b385feb 100644
--- a/doc/howtos.qdoc
+++ b/doc/howtos.qdoc
@@ -467,15 +467,17 @@
\section1 How do I build against libraries that provide pkg-config files?
- Just add a \l Depends item that matches the name of the pkg-config module, and \QBS
- will automatically employ \l{https://www.freedesktop.org/wiki/Software/pkg-config}{pkg-config}
+ Just add a \l Depends item that matches the name of the pkg-config module,
+ set the \l Product::qbsModuleProviders property to \c "qbspkgconfig",
+ and \QBS will employ
+ \l{https://www.freedesktop.org/wiki/Software/pkg-config}{pkg-config}
to find the headers and libraries if no matching \QBS module can be found. For instance,
to build against the OpenSSL library, you would write this:
\code
+ qbsModuleProviders: "qbspkgconfig"
Depends { name: "openssl" }
\endcode
- That's it. The pkg-config behavior can be fine-tuned via the \l pkgconfig module,
- but normally you will not need to pull it in explicitly.
+ That's it. The pkg-config behavior can be fine-tuned via the \l qbspkgconfig provider.
Internally, this functionality is implemented via \l {Module Providers}
diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc
index 76bbf2a61..b37095854 100644
--- a/doc/qbs.qdoc
+++ b/doc/qbs.qdoc
@@ -1922,12 +1922,6 @@
a second attempt will be made to locate the dependency using the new paths.
The search for a matching module provider ends as soon as one was found, regardless
of whether it created any modules or not.
- \li If no matching module provider was found in any of the search paths, \QBS will fall back
- to a generic module provider, which creates a module that attempts to locate the
- dependency via \c pkg-config.
- This fallback mechanism can be disabled in the respective
- \l{Depends::enableFallback}{Depends} item or globally via the
- \l{no-fallback-module-provider}{--no-fallback-module-provider} option.
\endlist
\section1 Selecting Module Providers
diff --git a/doc/reference/items/language/depends.qdoc b/doc/reference/items/language/depends.qdoc
index 7cc270483..937828b8c 100644
--- a/doc/reference/items/language/depends.qdoc
+++ b/doc/reference/items/language/depends.qdoc
@@ -197,12 +197,3 @@
\nodefaultvalue
*/
-
-/*!
- \qmlproperty bool Depends::enableFallback
-
- Whether to fall back to a pkg-config based \l{Module Providers}{module provider}
- if the dependency is not found.
-
- \defaultvalue \c true
-*/
diff --git a/src/lib/corelib/language/builtindeclarations.cpp b/src/lib/corelib/language/builtindeclarations.cpp
index 2ad0e3ef4..4a83279a8 100644
--- a/src/lib/corelib/language/builtindeclarations.cpp
+++ b/src/lib/corelib/language/builtindeclarations.cpp
@@ -247,8 +247,14 @@ void BuiltinDeclarations::addDependsItem()
item << PropertyDeclaration(StringConstants::multiplexConfigurationIdsProperty(),
PropertyDeclaration::StringList, QString(),
PropertyDeclaration::ReadOnlyFlag);
- item << PropertyDeclaration(StringConstants::enableFallbackProperty(),
- PropertyDeclaration::Boolean, StringConstants::trueValue());
+ PropertyDeclaration fallbackProp(
+ StringConstants::enableFallbackProperty(),
+ PropertyDeclaration::Boolean,
+ StringConstants::falseValue());
+ fallbackProp.setDeprecationInfo(DeprecationInfo(
+ Version(2, 4),
+ Tr::tr("The fallback provider has been deprecated. Use qbspkgconfig instead.")));
+ item << fallbackProp;
insert(item);
}