Skip to content

Commit

Permalink
Change the module imports from relative imports to top-level absolute…
Browse files Browse the repository at this point in the history
… imports for the Microsoft tools.

Moving any of the Microsoft tools that used relative imports to the scons site tools folder would fail on import (i.e., the relative import paths become invalid when the tools are moved).
  • Loading branch information
jcbrill committed Oct 11, 2023
1 parent 120b2cd commit 78b73a7
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
registry query that returns a path that does not exist. Multiple invocation
paths were not prepared to handle the MissingConfiguration exception. The
MissingConfiguration exception type was removed.
- The MSCommon module import was changed from a relative import to a top-level
absolute import in the following Microsoft tools: midl, mslib, mslink, mssdk, msvc,
msvs. Moving any of these tools that used relative imports to the scons site tools
folder would fail on import (i.e., the relative import paths become invalid when
moved).

From Vitaly Cheptsov:
- Fix race condition in `Mkdir` which can happen when two `SConscript`
Expand Down
5 changes: 5 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ IMPROVEMENTS
------------

- Now tries to find mingw if it comes from Chocolatey install of msys2.
- MSVC: Module imports were changed from a relative import to a top-level
absolute import in the following Microsoft tools: midl, mslib, mslink, mssdk, msvc,
msvs. Moving any of these tools that used relative imports to the scons site tools
folder would fail on import (i.e., the relative import paths become invalid when
moved).

PACKAGING
---------
Expand Down
2 changes: 1 addition & 1 deletion SCons/Tool/midl.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import SCons.Scanner.IDL
import SCons.Util

from .MSCommon import msvc_setup_env_tool
from SCons.Tool.MSCommon import msvc_setup_env_tool

tool_name = 'midl'

Expand Down
5 changes: 4 additions & 1 deletion SCons/Tool/mslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
import SCons.Tool.msvc
import SCons.Util

from .MSCommon import msvc_setup_env_tool, msvc_setup_env_once
from SCons.Tool.MSCommon import (
msvc_setup_env_tool,
msvc_setup_env_once,
)

tool_name = 'mslib'

Expand Down
7 changes: 5 additions & 2 deletions SCons/Tool/mslink.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@
import SCons.Tool.msvs
import SCons.Util

from .MSCommon import msvc_setup_env_once, msvc_setup_env_tool
from .MSCommon.common import get_pch_node
from SCons.Tool.MSCommon import (
msvc_setup_env_once,
msvc_setup_env_tool,
)
from SCons.Tool.MSCommon.common import get_pch_node

tool_name = 'mslink'

Expand Down
6 changes: 4 additions & 2 deletions SCons/Tool/mssdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
selection method.
"""

from .MSCommon import mssdk_exists, \
mssdk_setup_env
from SCons.Tool.MSCommon import (
mssdk_exists,
mssdk_setup_env,
)

def generate(env) -> None:
"""Add construction variables for an MS SDK to an Environment."""
Expand Down
9 changes: 7 additions & 2 deletions SCons/Tool/msvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@
import SCons.Warnings
import SCons.Scanner.RC

from .MSCommon import msvc_setup_env_tool, msvc_setup_env_once, msvc_version_to_maj_min, msvc_find_vswhere
from .MSCommon.common import get_pch_node
from SCons.Tool.MSCommon import (
msvc_setup_env_tool,
msvc_setup_env_once,
msvc_version_to_maj_min,
msvc_find_vswhere,
)
from SCons.Tool.MSCommon.common import get_pch_node

tool_name = 'msvc'

Expand Down
5 changes: 4 additions & 1 deletion SCons/Tool/msvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
import SCons.Warnings
from SCons.Defaults import processDefines
from SCons.compat import PICKLE_PROTOCOL
from .MSCommon import msvc_setup_env_tool, msvc_setup_env_once
from SCons.Tool.MSCommon import (
msvc_setup_env_tool,
msvc_setup_env_once,
)

tool_name = 'msvs'

Expand Down

0 comments on commit 78b73a7

Please sign in to comment.