Skip to content

Build as administrator is required on windows (sometimes?) #4440

Open
@koubaa

Description

@koubaa
  • I tried to submit the bug on the mailing list on 5/12/23 but looking at the archives it is not there. So I am posting here.
    SCons version: 4.0.1, installed via pip from pypi
    Python 3.10 from python.org
    Windows 10, Visual Studio 2019.
def GetVCVarsPath():¬
    vswhere_path = os.path.expandvars('%ProgramFiles(x86)%/Microsoft Visual Studio/Installer/vswhere.exe'args = [vswhere_path'-format', 'json''-utf8''-version', '[16.0,)'] # VS2019+¬
    # Prefer older Visual Studio versions over newer ones¬
    for cand in sorted(json.loads(check_output(args).decode('utf-8')),¬
                       key=lambda cand: cand['installationVersion']):¬
        install_path = cand['installationPath'vcvars_path = os.path.join(install_path'VC''Auxiliary''Build''vcvars64.bat'if os.path.exists(vcvars_path):¬
            return vcvars_path

We use MSVC_USE_SCRIPT=GetVCVarsPath(), function defined above. Users might also have Visual Studio 2022 installed, but this build requires VS2019.

Describe the bug
I set up a scons-based build system at my organization. Some users have complained to me that they can only run the build as administrator. I am not able to reproduce that problem myself. Here is the error message that the users who are affected get when they build as a non-admin.

cl : Command line error D8050 : cannot execute 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.20.27508\bin\HostX64\x64\c1xx.dll': failed to get command line into debug records
scons: building terminated because of errors.

I can try to get a minimal reproducible example, but apparently any c++ scons build is affected for these users. We use Visual Studio 2019

scons is invoked from python in a virtual environment where scons is installed as a subprocess. The executable in the subprocess is determined using the result of the subprocess where scons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    MSVCMicrosoft Visual C++ Support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions