summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2023-03-01 18:52:56 -0800
committerGitHub <noreply@github.com>2023-03-01 18:52:56 -0800
commit954cfec6cea7890cf22d708aad872f34601114bf (patch)
treeaa8d587dc2fe3c6d414a08bd798da62eeed5c994
parentcc77c4bfe5130ddeed0bf176b0b733abb25eadea (diff)
parent5e9e2eb6fced85e8cc59d1fcaa9ecb10b2d8f5aa (diff)
downloadscons-git-954cfec6cea7890cf22d708aad872f34601114bf.tar.gz
Merge pull request #10 from mwichmann/rename_qt_qt3-update
Update PR 4305: failing stub qt tool
-rw-r--r--SCons/Tool/qt.py9
-rw-r--r--SCons/Tool/qt3.xml82
-rw-r--r--test/import.py31
3 files changed, 104 insertions, 18 deletions
diff --git a/SCons/Tool/qt.py b/SCons/Tool/qt.py
index 8e34eb7cd..607b58d83 100644
--- a/SCons/Tool/qt.py
+++ b/SCons/Tool/qt.py
@@ -25,11 +25,14 @@
This is a fake tool to instruct any builds still referencing 'qt' instead
of the new 'qt3' or a newer QT builder how to fix their now broken build.
"""
-import SCons.Warnings
+import SCons.Errors
def generate(env):
- pass
+ raise SCons.Errors.UserError(
+ "Deprecated tool 'qt' renamed to 'qt3'. "
+ "Please update your build accordingly. "
+ "'qt3' will be removed entirely in a future release."
+ )
def exists(env):
return False
-
diff --git a/SCons/Tool/qt3.xml b/SCons/Tool/qt3.xml
index 306b53c07..445751b5e 100644
--- a/SCons/Tool/qt3.xml
+++ b/SCons/Tool/qt3.xml
@@ -32,7 +32,9 @@ Sets &consvars; for building Qt3 applications.
<note><para>
This tool is only suitable for building targeted to Qt3,
which is obsolete
-(<emphasis>the tool is deprecated since 4.3</emphasis>).
+(<emphasis>the tool is deprecated since 4.3,
+and was renamed to qt3 in 4.5.0.
+</emphasis>).
There are contributed tools for Qt4 and Qt5, see
<ulink url="https://github.com/SCons/scons-contrib">
https://github.com/SCons/scons-contrib</ulink>.
@@ -195,6 +197,9 @@ If not already set,
<varname>os.environ</varname>;
if not found there, it tries to make a guess.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QTDIR.
+</para>
</summary>
</cvar>
@@ -204,6 +209,9 @@ if not found there, it tries to make a guess.
Turn off scanning for mocable files. Use the &b-link-Moc; Builder to explicitly
specify files to run <command>moc</command> on.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_AUTOSCAN.
+</para>
</summary>
</cvar>
@@ -213,6 +221,9 @@ specify files to run <command>moc</command> on.
The path where the Qt binaries are installed.
The default value is '&cv-link-QT3DIR;<filename>/bin</filename>'.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_BINPATH.
+</para>
</summary>
</cvar>
@@ -225,6 +236,9 @@ Note: If you set this variable to <constant>None</constant>,
the tool won't change the &cv-link-CPPPATH;
construction variable.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_CPPPATH.
+</para>
</summary>
</cvar>
@@ -233,6 +247,9 @@ construction variable.
<para>
Prints lots of debugging information while scanning for moc files.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_DEBUG.
+</para>
</summary>
</cvar>
@@ -244,6 +261,9 @@ You may want to set this to <literal>'qt-mt'</literal>.
Note: If you set this variable to <constant>None</constant>,
the tool won't change the &cv-link-LIBS; variable.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_LIB.
+</para>
</summary>
</cvar>
@@ -256,6 +276,9 @@ Note: If you set this variable to <constant>None</constant>,
the tool won't change the &cv-link-LIBPATH;
construction variable.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_LIBPATH.
+</para>
</summary>
</cvar>
@@ -282,6 +305,9 @@ Prefix for <command>moc</command> output files when source is a C++ file.
Default value is <literal>'.moc'</literal>.
Suffix for <command>moc</command> output files when source is a C++ file.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCCXXSUFFIX.
+</para>
</summary>
</cvar>
@@ -291,6 +317,9 @@ Suffix for <command>moc</command> output files when source is a C++ file.
Default value is <literal>'-i'</literal>.
These flags are passed to <command>moc</command> when moccing a C++ file.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMCXXFLAGS.
+</para>
</summary>
</cvar>
@@ -299,6 +328,9 @@ These flags are passed to <command>moc</command> when moccing a C++ file.
<para>
Command to generate a moc file from a C++ file.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMCXXCOM.
+</para>
</summary>
</cvar>
@@ -308,6 +340,9 @@ Command to generate a moc file from a C++ file.
The string displayed when generating a moc file from a C++ file.
If this is not set, then &cv-link-QT3_MOCFROMCXXCOM; (the command line) is displayed.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMCXXCOMSTR.
+</para>
</summary>
</cvar>
@@ -316,6 +351,9 @@ If this is not set, then &cv-link-QT3_MOCFROMCXXCOM; (the command line) is displ
<para>
Command to generate a moc file from a header.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMSHCOM.
+</para>
</summary>
</cvar>
@@ -325,6 +363,9 @@ Command to generate a moc file from a header.
The string displayed when generating a moc file from a C++ file.
If this is not set, then &cv-link-QT3_MOCFROMHCOM; (the command line) is displayed.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMSHCOMSTR.
+</para>
</summary>
</cvar>
@@ -334,6 +375,9 @@ If this is not set, then &cv-link-QT3_MOCFROMHCOM; (the command line) is display
Default value is <literal>''</literal>. These flags are passed to <command>moc</command>
when moccing a header file.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMSHFLAGS.
+</para>
</summary>
</cvar>
@@ -343,6 +387,9 @@ when moccing a header file.
Default value is <literal>'moc_'</literal>.
Prefix for <command>moc</command> output files when source is a header.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCHPREFIX.
+</para>
</summary>
</cvar>
@@ -352,6 +399,9 @@ Prefix for <command>moc</command> output files when source is a header.
Default value is '&cv-link-CXXFILESUFFIX;'.
Suffix for moc output files when source is a header.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCHSUFFIX.
+</para>
</summary>
</cvar>
@@ -360,6 +410,9 @@ Suffix for moc output files when source is a header.
<para>
Default value is '&cv-link-QT3_BINPATH;<filename>/uic</filename>'.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UIC.
+</para>
</summary>
</cvar>
@@ -368,6 +421,9 @@ Default value is '&cv-link-QT3_BINPATH;<filename>/uic</filename>'.
<para>
Command to generate header files from <filename>.ui</filename> files.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICCOM.
+</para>
</summary>
</cvar>
@@ -377,6 +433,9 @@ Command to generate header files from <filename>.ui</filename> files.
The string displayed when generating header files from <filename>.ui</filename> files.
If this is not set, then &cv-link-QT3_UICCOM; (the command line) is displayed.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICCOMSTR.
+</para>
</summary>
</cvar>
@@ -386,6 +445,9 @@ If this is not set, then &cv-link-QT3_UICCOM; (the command line) is displayed.
Default value is ''. These flags are passed to <command>uic</command>
when creating a header file from a <filename>.ui</filename> file.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICDECLFLAGS.
+</para>
</summary>
</cvar>
@@ -395,6 +457,9 @@ when creating a header file from a <filename>.ui</filename> file.
Default value is <literal>''</literal>.
Prefix for <command>uic</command> generated header files.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICDECLPREFIX.
+</para>
</summary>
</cvar>
@@ -404,6 +469,9 @@ Prefix for <command>uic</command> generated header files.
Default value is <literal>'.h'</literal>.
Suffix for <command>uic</command> generated header files.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICDECLSUFFIX.
+</para>
</summary>
</cvar>
@@ -414,6 +482,9 @@ Default value is <literal>''</literal>.
These flags are passed to <command>uic</command> when creating a C++
file from a <filename>.ui</filename> file.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICIMPFLAGS.
+</para>
</summary>
</cvar>
@@ -423,6 +494,9 @@ file from a <filename>.ui</filename> file.
Default value is <literal>'uic_'</literal>.
Prefix for uic generated implementation files.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICIMPLPREFIX.
+</para>
</summary>
</cvar>
@@ -432,6 +506,9 @@ Prefix for uic generated implementation files.
Default value is '&cv-link-CXXFILESUFFIX;'. Suffix for uic generated implementation
files.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICIMPLSUFFIX.
+</para>
</summary>
</cvar>
@@ -441,6 +518,9 @@ files.
Default value is <literal>'.ui'</literal>.
Suffix of designer input files.
</para>
+<para>
+<emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UISUFFIX.
+</para>
</summary>
</cvar>
diff --git a/test/import.py b/test/import.py
index 997e6c4e6..50d7b2178 100644
--- a/test/import.py
+++ b/test/import.py
@@ -128,23 +128,26 @@ if moc:
import os.path
qtdir = os.path.dirname(os.path.dirname(moc))
-
- qt_err = r"""
-scons: warning: Could not detect qt3, using moc executable as a hint \(QT3DIR=%(qtdir)s\)
-""" % locals()
-
+ qt3_err = fr"""
+scons: warning: Could not detect qt3, using moc executable as a hint \(QT3DIR={qtdir}\)
+"""
else:
-
- qt_err = """
+ qt3_err = r"""
scons: warning: Could not detect qt3, using empty QT3DIR
"""
-qt_warnings = [ re.compile(qt_err + TestSCons.file_expr) ]
+qt_moved = r"""
+scons: \*\*\* Deprecated tool 'qt' renamed to 'qt3'. Please update your build accordingly. 'qt3' will be removed entirely in a future release.
+"""
+
+qt3_warnings = [re.compile(qt3_err + TestSCons.file_expr)]
+qt_error = [re.compile(qt_moved + TestSCons.file_expr)]
error_output = {
- 'icl' : intel_warnings,
- 'intelc' : intel_warnings,
- 'qt3' : qt_warnings,
+ 'icl': intel_warnings,
+ 'intelc': intel_warnings,
+ 'qt3': qt3_warnings,
+ 'qt': qt_error,
}
# An SConstruct for importing Tool names that have illegal characters
@@ -178,16 +181,16 @@ for tool in tools:
test.write('SConstruct', indirect_import % locals())
else:
test.write('SConstruct', direct_import % locals())
- test.run(stderr=None)
+ test.run(stderr=None, status=None)
stderr = test.stderr()
- if stderr:
+ if stderr or test.status:
matched = None
for expression in error_output.get(tool, []):
if expression.match(stderr):
matched = 1
break
if not matched:
- print("Failed importing '%s', stderr:" % tool)
+ print(f"Failed importing '{tool}', stderr:")
print(stderr)
failures.append(tool)