Skip to content

Commit

Permalink
Merge branch 'master' into AddOption-shortopts
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbaddog authored Sep 22, 2024
2 parents 23ccbab + 5404eb7 commit f0715f3
Show file tree
Hide file tree
Showing 21 changed files with 639 additions and 502 deletions.
10 changes: 10 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
will now not be deleted from the base environment. Override Environments
now also pretend to have a _dict attribute so that regular environment
methods don't have a problem if passed an OE instance.
- Fix a problem with compilation_db component initialization - the
entries for assembler files were not being set up correctly.
- Add clang and clang++ to the default tool search orders for POSIX
and Windows platforms. These will be searched for after gcc and g++,
respectively. Does not affect expliclity requested tool lists.
Note: on Windows, SCons currently only has builtin support for
clang, not for clang-cl, the version of the frontend that uses
cl.exe-compatible command line switches.
- Some manpage cleanup for the gettext and pdf/ps builders.
- Some clarifications in the User Guide "Environments" chapter.


RELEASE 4.8.1 - Tue, 03 Sep 2024 17:22:20 -0700
Expand Down
14 changes: 13 additions & 1 deletion RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY
- List modifications to existing features, where the previous behavior
wouldn't actually be considered a bug

- Override envirionments, created when giving construction environment
- Override environments, created when giving construction environment
keyword arguments to Builder calls (or manually, through the
undocumented Override method), were modified not to "leak" on item deletion.
The item will now not be deleted from the base environment.
Expand All @@ -48,6 +48,8 @@ FIXES
while long option names for the same option worked. Short options
that take a value require the user to specify the value immediately
following the option, with no spaces (e.g. -j5 and not -j 5).
- Fix a problem with compilation_db component initialization - the
entries for assembler files were not being set up correctly.

IMPROVEMENTS
------------
Expand All @@ -61,6 +63,13 @@ IMPROVEMENTS
Calling AddOption with the full set of arguments (option names and
attributes) to set up the option is still the recommended approach.

- Add clang and clang++ to the default tool search orders for POSIX
and Windows platforms. These will be searched for after gcc and g++,
respectively. Does not affect expliclity requested tool lists. Note:
on Windows, SCons currently only has builtin support for clang, not
for clang-cl, the version of the frontend that uses cl.exe-compatible
command line switches.

PACKAGING
---------

Expand All @@ -73,6 +82,9 @@ DOCUMENTATION
typo fixes, even if they're mentioned in src/CHANGES.txt to give
the contributor credit)

- Some manpage cleanup for the gettext and pdf/ps builders.
- Some clarifications in the User Guide "Environments" chapter.

DEVELOPMENT
-----------

Expand Down
15 changes: 10 additions & 5 deletions SCons/EnvironmentTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,8 @@ def test_BuilderWrapper_attributes(self) -> None:
# underlying method it tests (Environment.BuilderWrapper.execute())
# is necessary, but we're leaving the code here for now in case
# that's mistaken.
def _DO_NOT_test_Builder_execs(self) -> None:
@unittest.skip("BuilderWrapper.execute method not needed")
def test_Builder_execs(self) -> None:
"""Test Builder execution through different environments
One environment is initialized with a single
Expand Down Expand Up @@ -1291,10 +1292,14 @@ def RDirs(pathlist, fs=env.fs):
]
assert flags == expect, flags

env.Replace(F77PATH = [ 'foo', '$FOO/bar', blat ],
INCPREFIX = 'foo ',
INCSUFFIX = 'bar',
FOO = 'baz')
# do a Replace using the dict form
newvalues = {
"F77PATH": ['foo', '$FOO/bar', blat],
"INCPREFIX": 'foo ',
"INCSUFFIX": 'bar',
"FOO": 'baz',
}
env.Replace(**newvalues)
flags = env.subst_list('$_F77INCFLAGS', 1)[0]
expect = [ '$(',
normalize_path('foo'),
Expand Down
15 changes: 8 additions & 7 deletions SCons/Subst.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ This file is processed by the bin/SConsDoc.py module.
</arguments>
<summary>
<para>
Specifies the exceptions that will be allowed
when expanding construction variables.
Specifies the exceptions that will be ignored
when expanding &consvars;.
By default,
any construction variable expansions that generate a
<literal>NameError</literal>
any &consvar; expansions that generate a
&NameError;
or
<literal>IndexError</literal>
&IndexError;
exception will expand to a
<literal>''</literal>
(an empty string) and not cause scons to fail.
(an empty string) and not cause &scons; to fail.
All exceptions not in the specified list
will generate an error message
and terminate processing.
Expand All @@ -51,7 +51,8 @@ If
&f-AllowSubstExceptions;
is called multiple times,
each call completely overwrites the previous list
of allowed exceptions.
of ignored exceptions.
Calling it with no arguments means no exceptions will be ignored.
</para>

<para>
Expand Down
8 changes: 4 additions & 4 deletions SCons/Tool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,8 @@ def tool_list(platform, env):
if str(platform) == 'win32':
"prefer Microsoft tools on Windows"
linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32']
c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32']
cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'cxx', 'bcc32']
c_compilers = ['msvc', 'mingw', 'gcc', 'clang', 'intelc', 'icl', 'icc', 'cc', 'bcc32']
cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'clang++', 'cxx', 'bcc32']
assemblers = ['masm', 'nasm', 'gas', '386asm']
fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran']
ars = ['mslib', 'ar', 'tlib']
Expand Down Expand Up @@ -757,8 +757,8 @@ def tool_list(platform, env):
else:
"prefer GNU tools on all other platforms"
linkers = ['gnulink', 'ilink']
c_compilers = ['gcc', 'intelc', 'icc', 'cc']
cxx_compilers = ['g++', 'intelc', 'icc', 'cxx']
c_compilers = ['gcc', 'clang', 'intelc', 'icc', 'cc']
cxx_compilers = ['g++', 'clang++', 'intelc', 'icc', 'cxx']
assemblers = ['gas', 'nasm', 'masm']
fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']
ars = ['ar', ]
Expand Down
17 changes: 11 additions & 6 deletions SCons/Tool/compilation_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
from .cc import CSuffixes
from .asm import ASSuffixes, ASPPSuffixes

DEFAULT_DB_NAME = 'compile_commands.json'

# TODO: Is there a better way to do this than this global? Right now this exists so that the
# emitter we add can record all of the things it emits, so that the scanner for the top level
# compilation database can access the complete list, and also so that the writer has easy
Expand Down Expand Up @@ -189,9 +191,8 @@ def compilation_db_emitter(target, source, env):
if not target and len(source) == 1:
target = source

# Default target name is compilation_db.json
if not target:
target = ['compile_commands.json', ]
target = [DEFAULT_DB_NAME]

# No source should have been passed. Drop it.
if source:
Expand Down Expand Up @@ -224,13 +225,17 @@ def generate(env, **kwargs) -> None:
),
itertools.product(
ASSuffixes,
[(static_obj, SCons.Defaults.StaticObjectEmitter, "$ASCOM")],
[(shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASCOM")],
[
(static_obj, SCons.Defaults.StaticObjectEmitter, "$ASCOM"),
(shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASCOM")
],
),
itertools.product(
ASPPSuffixes,
[(static_obj, SCons.Defaults.StaticObjectEmitter, "$ASPPCOM")],
[(shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASPPCOM")],
[
(static_obj, SCons.Defaults.StaticObjectEmitter, "$ASPPCOM"),
(shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASPPCOM")
],
),
)

Expand Down
8 changes: 5 additions & 3 deletions SCons/Tool/dvips.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@ or
The suffix specified by the &cv-link-PSSUFFIX; construction variable
(<filename>.ps</filename> by default)
is added automatically to the target
if it is not already present. Example:
if it is not already present.
&b-PostScript; is a single-source builder.
Example:
</para>

<example_commands>
<programlisting language="python">
# builds from aaa.tex
env.PostScript(target = 'aaa.ps', source = 'aaa.tex')
# builds bbb.ps from bbb.dvi
env.PostScript(target = 'bbb', source = 'bbb.dvi')
</example_commands>
</programlisting>
</summary>
</builder>

Expand Down
Loading

0 comments on commit f0715f3

Please sign in to comment.