Skip to content

Commit

Permalink
Merge branch 'master' into issue/alias-action
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbaddog authored Feb 17, 2025
2 parents b5a2151 + a6abb0f commit 448bca2
Show file tree
Hide file tree
Showing 21 changed files with 438 additions and 130 deletions.
8 changes: 8 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ NOTE: Python 3.6 support is deprecated and will be dropped in a future release.

RELEASE VERSION/DATE TO BE FILLED IN LATER

From Ruben Di Battista:
- Expose `extra_libs` kwarg in Configure checks `CheckLibWithHeader`
and 'CheckLib' and forward it downstream to `CheckLib`

From Joseph Brill:
- Added error handling when creating MSVC detection debug log file specified by
SCONS_MSCOMMON_DEBUG.
Expand Down Expand Up @@ -201,6 +205,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- Test framework reformatted using settings from pyproject.toml.
Includes code embedded in docstrings.
- Clarify how pre/post actions on an alias work.
- Handle case of "memoizer" as one member of a comma-separated
--debug string - this was previously missed.
- test YACC/live.py fixed - finally started failing on an "old-style"
(K&R flavor) function declaration, updated.

From Adam Scott:
- Changed Ninja's TEMPLATE rule pool to use `install_pool` instead of
Expand Down
37 changes: 22 additions & 15 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ Introduction

Thanks for taking the time to contribute to SCons!

This will give a brief overview of the development process,
This is a brief overview of the development process,
and about the SCons tree (right here, if you're reading this
in Github, or in a cloned repository).
in Github, or in a repository clone).

There are lots of places we could use help - please don't
think we're only interested in contributions to code.

If you're going to contribute, we'd love to get to know you
a bit and understand and what problems you're looking to solve,
a bit and understand what problems you're looking to solve,
or what you are intending to improve, whether that's documentation,
code, examples, tutorials, etc. A great way to introduce yourself is to
to hop onto the `SCons Discord Server <https://discord.gg/bXVpWAy>`_
to chat. You don't have to be a regular Discord user,
there is a web interface.
to chat. You don't have to use the Discord app,
as there is a web interface (does require an account).
You can also use the
`SCons Users Mailing List <https://pairlist4.pair.net/mailman/listinfo/scons-users>`_.

Resources
=========
Expand All @@ -38,15 +40,20 @@ Reporting Bugs

One of the easiest ways to contribute is by filing bugs.
The SCons project welcomes bug reports and feature requests,
but we *do* have a preference for having talked about them first -
we request you send an email to the
`SCons Users Mailing List <https://pairlist4.pair.net/mailman/listinfo/scons-users>`_
or hop on the Discord channel (see link above), and if so
instructed, then proceed to an issue report.
but unless they're really trivial (like doc typos),
we *do* have a preference for having talked about them first.
This step helps identify possible collaborators and reviewers,
and pre-screens issues that may already have solutions,
be in progress, or perhaps are the result of a misunderstanding.
You can either ask on the Discord channel (see link above),
or send am email to the mailing list.
You can also use
`GitHub Discussions <https://github.com/SCons/scons/discussions>`_.
If so instructed, please proceed to an issue report.

You can explore the list of existing bugs on GitHub.
Sometimes there's work in progress which may include temporary
workarounds for the problem you've run into::
workarounds for the problem you are running into::

https://github.com/SCons/scons/issues

Expand All @@ -58,12 +65,12 @@ This tree contains a lot more than just the SCons engine itself.
Some of it has to do with packaging it in a couple
of forms: a Python-installable package (source distribution
and installable wheel file, which get uploaded to the Python
Package Index), a portable zip (or tar) distribution
Package Index, PyPI), a portable zip (or tar) distribution
called "scons-local", and a full source bundle. You usually
don't need to worry about the packaging parts when working
on a source or doc contribution - unless you're adding an entirely
new file, then the packaging bits may need to know about it. The
project maintainers can usually help with that part.
new file, then the packaging bits may need to know about it.
The project maintainers can help with that part.
There are also tests and tools in the tree.

The *full* development cycle is not just to test code changes directly,
Expand Down Expand Up @@ -111,7 +118,7 @@ on the documentation process at the Documentation Toolchain page:
https://github.com/SCons/scons/blob/master/doc/overview.rst


You can execute SCons directly from this repository. For Linux or UNIX::
You can execute SCons directly from this repository. For Linux/UNIX/MacOS::

$ python scripts/scons.py [arguments]

Expand Down
4 changes: 4 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ DEPRECATED FUNCTIONALITY

CHANGED/ENHANCED EXISTING FUNCTIONALITY
---------------------------------------
- Expose the `extra_libs` keyword argument in `CheckLibWithHeader` and 'CheckLib'

- List modifications to existing features, where the previous behavior
wouldn't actually be considered a bug
Expand Down Expand Up @@ -179,6 +180,9 @@ FIXES
- Fix Issue #2281, AddPreAction() & AddPostAction() were being ignored if no action
was specified when the Alias was initially created.

- Handle case of "memoizer" as one member of a comma-separated
--debug string - this was previously missed.

IMPROVEMENTS
------------

Expand Down
33 changes: 22 additions & 11 deletions SCons/SConf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,12 +1101,17 @@ def CheckCXXHeader(context, header, include_quotes: str = '""'):


def CheckLib(context, library = None, symbol: str = "main",
header = None, language = None, autoadd: bool=True,
append: bool=True, unique: bool=False) -> bool:
header = None, language = None, extra_libs = None,
autoadd: bool=True, append: bool=True, unique: bool=False) -> bool:
"""
A test for a library. See also CheckLibWithHeader.
A test for a library. See also :func:`CheckLibWithHeader`.
Note that library may also be None to test whether the given symbol
compiles without flags.
.. versionchanged:: NEXT_RELEASE
Added the *extra_libs* keyword parameter. The actual implementation
is in :func:`SCons.Conftest.CheckLib` which already accepted this
parameter, so this is only exposing existing functionality.
"""

if not library:
Expand All @@ -1116,25 +1121,31 @@ def CheckLib(context, library = None, symbol: str = "main",
library = [library]

# ToDo: accept path for the library
res = SCons.Conftest.CheckLib(context, library, symbol, header = header,
language = language, autoadd = autoadd,
append=append, unique=unique)
res = SCons.Conftest.CheckLib(context, library, symbol, header=header,
language=language, extra_libs=extra_libs,
autoadd=autoadd, append=append, unique=unique)
context.did_show_result = True
return not res

# XXX
# Bram: Can only include one header and can't use #ifdef HAVE_HEADER_H.

def CheckLibWithHeader(context, libs, header, language,
call = None, autoadd: bool=True, append: bool=True, unique: bool=False) -> bool:
# ToDo: accept path for library. Support system header files.
extra_libs = None, call = None, autoadd: bool=True,
append: bool=True, unique: bool=False) -> bool:
"""
Another (more sophisticated) test for a library.
Checks, if library and header is available for language (may be 'C'
or 'CXX'). Call maybe be a valid expression _with_ a trailing ';'.
As in CheckLib, we support library=None, to test if the call compiles
As in :func:`CheckLib`, we support library=None, to test if the call compiles
without extra link flags.
.. versionchanged:: NEXT_RELEASE
Added the *extra_libs* keyword parameter. The actual implementation
is in :func:`SCons.Conftest.CheckLib` which already accepted this
parameter, so this is only exposing existing functionality.
"""
# ToDo: accept path for library. Support system header files.
prog_prefix, dummy = createIncludesFromHeaders(header, 0)
if not libs:
libs = [None]
Expand All @@ -1143,8 +1154,8 @@ def CheckLibWithHeader(context, libs, header, language,
libs = [libs]

res = SCons.Conftest.CheckLib(context, libs, None, prog_prefix,
call = call, language = language, autoadd=autoadd,
append=append, unique=unique)
extra_libs = extra_libs, call = call, language = language,
autoadd=autoadd, append=append, unique=unique)
context.did_show_result = 1
return not res

Expand Down
15 changes: 12 additions & 3 deletions SCons/Script/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
start_time = time.time()

import collections
import itertools
import os
from io import StringIO

Expand All @@ -53,9 +54,17 @@
# to not add the shims. So we use a special-case, up-front check for
# the "--debug=memoizer" flag and enable Memoizer before we import any
# of the other modules that use it.

_args = sys.argv + os.environ.get('SCONSFLAGS', '').split()
if "--debug=memoizer" in _args:
# Update: this breaks if the option isn't exactly "--debug=memoizer",
# like if there is more than one debug option as a csv. Do a bit more work.

_args = sys.argv + os.environ.get("SCONSFLAGS", "").split()
_args = (
arg[len("--debug=") :].split(",")
for arg in _args
if arg.startswith("--debug=")
)
_args = list(itertools.chain.from_iterable(_args))
if "memoizer" in _args:
import SCons.Memoize
import SCons.Warnings
try:
Expand Down
Loading

0 comments on commit 448bca2

Please sign in to comment.