Skip to content

Conversation

@bdbaddog
Copy link
Contributor

Fixed GH Issue #4809 4809. scoop.sh installed scons (and likely scons-local )created msvs project files would fail.

See #4810 for discussion.
This is the implementation of the fix discussed in that PR.

Largely the work of.
@jcbrill & @madmiraal

Note: I tested this live with the SConstruct from #4809 and scoop.sh installed scons
(And then locally editing scoop installed scons' msvs.py"

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

@bdbaddog bdbaddog requested a review from mwichmann January 18, 2026 05:08
jcbrill added a commit to jcbrill/scons that referenced this pull request Jan 20, 2026
Changes:
* Change SCons/Tool/msvs.py function comment before getExecScriptMain and replace with docstring.  Taken from PR SCons#4817.
* Revert python executable code
* Generate scons_home (user env, SCONS_HOME, or SCONS_LIB_DIR path specification) and scons_path (currently executing SCons module path) paths in unified script in SCons/Tool/msvs.py and testing/framework/TestSConsMSVS.py.  Similar to the two code paths in PR SCons#4817.
* Set the SCONS_HOME variable in the testenv as is done with SCONS_LIB_DIR.  Add SCONS_HOME to testing/framework/TestSConsMSVS.py.
else:
exec_script_main = f"from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-{self.scons_version}'), join(sys.prefix, 'scons-{self.scons_version}'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()"
exec_script_main = f"import sys; sys.path = [ scons_parent ] + sys.path; import SCons.Script; SCons.Script.main()"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bug in the else clause: [ scons_parent ] should be an f-string with either a preceding scons_parent variable definition or an inline path calculation similar to the construction in SCons/Tool/msvs.py.

By default, the else clause is not exercised by the test suite.

Was reviewing the code when making #4818 functionally equivalent (with other changes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants