Skip to content

Conversation

@mwichmann
Copy link
Collaborator

Many tools contain a stanza like this, usually for the Windows case, where installed programs are rarely added to the "standard" path in SCons' execution environment (i.e. env['ENV']["PATH']):

    javac = SCons.Tool.find_program_path(env, 'javac', default_paths=paths)
    if javac:
        javac_bin_dir = os.path.dirname(javac)
        env.AppendENVPath('PATH', javac_bin_dir)

This change adds a keyword argument add_path to find_program_path() to instruct it to add the path a program was discovered in, if it was in the extra paths passed in. The default is False, retaining the existing behavior.

Signed-off-by: Mats Wichmann [email protected]

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 read the README.rst)
  • I have updated the appropriate documentation

Many tools contain a stanza like this, usually for the Windows case,
where installed programs are rarely added to the "standard" path
in SCons' execution environment (i.e. env['ENV']["PATH']):

    javac = SCons.Tool.find_program_path(env, 'javac', default_paths=paths)
    if javac:
        javac_bin_dir = os.path.dirname(javac)
        env.AppendENVPath('PATH', javac_bin_dir)

This change adds a keyword argument add_path to find_program_path() to
instruct it to add the path a program was discovered in, if it was in the
extra paths passed in. The default is False, retaining the existing behavior.

Signed-off-by: Mats Wichmann <[email protected]>
@mwichmann mwichmann added the Tools Issues related to tools subsystem label Jun 14, 2022
@bdbaddog bdbaddog changed the title find_prorgram_path() can now add discovered path find_program_path() can now add discovered path Jun 14, 2022
@bdbaddog bdbaddog merged commit a52667a into SCons:master Jun 14, 2022
@mwichmann mwichmann added this to the 4.4 milestone Jun 15, 2022
@mwichmann mwichmann deleted the feature/toolfind-addpath branch June 15, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tools Issues related to tools subsystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants