Skip to content

Fix implicit cmd deps for no-src targets - #4975

Open
mwichmann wants to merge 2 commits into
SCons:masterfrom
mwichmann:issue2594
Open

mwichmann wants to merge 2 commits into
SCons:masterfrom
mwichmann:issue2594

Conversation

@mwichmann

@mwichmann mwichmann commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

If a target has no sources, the Executor's scan() is not called, which means node.get_implicit_deps() is never called. The discussion in the issued identified that the code had a gate to avoid calling if the source list was empty, but it doesn't seem to be needed, and missing the call to find implicit deps means calls like Command('foo', None, action=something-to-create-foo) would never get the command used by the action tracked as a dep.

Update: further prospecting suggests that the changes in d43c3fa (2007) were what broke the behavior - when Executor.scan() got the additional deps.extend(self.get_implicit_deps()) call to the new Executor.get_implicit_deps() which extended the resposibilities of scan and turned it into a gap if it didn't get called.

Fixes existing behavior, so no doc impacts.

AI assistance was used to generate regression tests.

Fixes #2594

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt and RELEASE.txt (and read the README.rst).
  • I have updated the appropriate documentation

If a target has no sources, the Executor's scan() is not called,
which means node.get_implicit_deps is never called.  The discussion in
the issued identified that the code had a gate to avoid calling if the
source list was empty, but it doesn't seem to be needed, and missing
the call to find implicit deps means calls like "Command('foo', None,
action=something-to-create-foo)" would never get the command used by
the action tracked as a dep.

AI assistance was used to generate regression tests.

Fixes SCons#2594

Signed-off-by: Mats Wichmann <[email protected]>
The "compiler" used by the test needs to write a its string in binary
to avoid Windows line-ending problem (all Windows builds failed on CI).

Signed-off-by: Mats Wichmann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

source=None disables dependency on action

1 participant