Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to build NVDA after introduction of UIA remote library #13346

Closed
lukaszgo1 opened this issue Feb 16, 2022 · 7 comments
Closed

Impossible to build NVDA after introduction of UIA remote library #13346

lukaszgo1 opened this issue Feb 16, 2022 · 7 comments

Comments

@lukaszgo1
Copy link
Contributor

Steps to reproduce:

Check out NVDA repository and execute scons source

Actual behavior:

Build fails with the following:


D:\my_repos\nvda>scons source -j1
Ensuring NVDA Python virtual environment
call py -m SCons source -j1
scons: Reading SConscript files ...
Building using 1 job
scons: done reading SConscript files.
scons: Building targets ...
msbuild D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\UIAutomation.sln /t:Restore /p:RestorePackagesConfig=true,Configuration=Release,Platform=x86
Microsoft (R) Build Engine 16.11.2+f32259642 dla platformy .NET Framework
Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone.

Projekty w tym rozwiązaniu są kompilowane pojedynczo. Aby umożliwić kompilację równoległą, dodaj przełącznik "-m".
Kompilacja rozpoczęła się 2022-02-16 12:28:00.
Projekt "D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\UIAutomation.sln" w węźle 1 (elementy docelowe: Restore).
ValidateSolutionConfiguration:
  Tworzenie konfiguracji rozwiązania "Release|x86".
_GetAllRestoreProjectPathItems:
  Trwa określanie projektów do przywrócenia...
Kompilowanie projektu "D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\UIAutomation.sln" wykonane (elementy docelowe: Restore).


Kompilacja powiodła się.
    Ostrzeżenia: 0
    Liczba błędów: 0

Czas, który upłynął: 00:00:00.87
Delete("include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.ui.uiautomation\Generated Files")
msbuild /t:Build /p:Configuration=Release,Platform=x86,OutDir=D:\my_repos\nvda\build\x86\microsoft-ui-uiautomation\lib/ include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.ui.uiautomati
on\Microsoft.UI.UIAutomation.vcxproj
Microsoft (R) Build Engine 16.11.2+f32259642 dla platformy .NET Framework
Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone.

Kompilacja rozpoczęła się 2022-02-16 12:28:01.
Projekt "D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.ui.uiautomation\Microsoft.UI.UIAutomation.vcxproj" w węźle 1 (elementy docelowe: Build).
InitializeBuildStatus:
  Modyfikowanie "Release\Microsof.7D645239.tlog\unsuccessfulbuild".
Midl:
  C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x86\midl.exe /metadata_dir "C:\Program Files (x86)\Windows Kits\10\References\10.0.22000.0\Windows.Foundation.FoundationContract\4.0.0.
  0" /winrt /W1 /nologo /char signed /env win32 /winmd "Release\Microsoft.UI.UIAutomation.winmd" /h "Microsoft.UI.UIAutomation_h.h" /tlb "Release\Microsoft.UI.UIAutomation.tlb" /target "NT60" /
  nomidl /struct_by_ref Microsoft.UI.UIAutomation.idl
  MIDLRT Processing .\Microsoft.UI.UIAutomation.idl
  Microsoft.UI.UIAutomation.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt\Windows.Foundation.idl
  Windows.Foundation.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt\inspectable.idl
  inspectable.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared\wtypes.idl
  wtypes.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared\wtypesbase.idl
  wtypesbase.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared\basetsd.h
  basetsd.h
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared\guiddef.h
  guiddef.h
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\unknwn.idl
  unknwn.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt\hstring.idl
  hstring.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt\AsyncInfo.idl
  AsyncInfo.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt\EventToken.idl
  EventToken.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt\windowscontracts.idl
  windowscontracts.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt\IVectorChangedEventArgs.idl
  IVectorChangedEventArgs.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\oaidl.idl
  oaidl.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\objidl.idl
  objidl.idl
  MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt\Windows.UI.UIAutomation.idl
  Windows.UI.UIAutomation.idl
.\Microsoft.UI.UIAutomation.idl(9): error MIDL2025: syntax error : expecting . near "runtimeclass" [D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.ui.uiautomation
\Microsoft.UI.UIAutomation.vcxproj]
.\Microsoft.UI.UIAutomation.idl(9): error MIDL2009: undefined symbol : unsealed.AutomationRemoteObject [D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.ui.uiautoma
tion\Microsoft.UI.UIAutomation.vcxproj]
.\Microsoft.UI.UIAutomation.idl(15): error MIDL2025: syntax error : expecting the keyword "interface" near "void" [D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.
ui.uiautomation\Microsoft.UI.UIAutomation.vcxproj]
.\Microsoft.UI.UIAutomation.idl(15): error MIDL2026: cannot recover from earlier syntax errors; aborting compilation [D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microso
ft.ui.uiautomation\Microsoft.UI.UIAutomation.vcxproj]
Kompilowanie projektu "D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.ui.uiautomation\Microsoft.UI.UIAutomation.vcxproj" wykonane (elementy docelowe: Build) - NIE
POWODZENIE.


Kompilacja NIE POWIODŁA SIĘ.

"D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.ui.uiautomation\Microsoft.UI.UIAutomation.vcxproj" (element docelowy Build) (1) ->
(element docelowy Midl) ->
  .\Microsoft.UI.UIAutomation.idl(9): error MIDL2025: syntax error : expecting . near "runtimeclass" [D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.ui.uiautomati
on\Microsoft.UI.UIAutomation.vcxproj]
  .\Microsoft.UI.UIAutomation.idl(9): error MIDL2009: undefined symbol : unsealed.AutomationRemoteObject [D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microsoft.ui.uiauto
mation\Microsoft.UI.UIAutomation.vcxproj]
  .\Microsoft.UI.UIAutomation.idl(15): error MIDL2025: syntax error : expecting the keyword "interface" near "void" [D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\microsof
t.ui.uiautomation\Microsoft.UI.UIAutomation.vcxproj]
  .\Microsoft.UI.UIAutomation.idl(15): error MIDL2026: cannot recover from earlier syntax errors; aborting compilation [D:\my_repos\nvda\include\microsoft-ui-uiautomation\src\uiAutomation\micro
soft.ui.uiautomation\Microsoft.UI.UIAutomation.vcxproj]

    Warnings: 0
    Errors count: 4

passed time: 00:00:01.85
scons: *** [build\x86\microsoft-ui-uiautomation\lib\Microsoft.UI.UIAutomation.dll] Error 1
scons: building terminated because of errors.
Deactivating NVDA Python virtual environment

Expected behavior:

Build succeeds

System configuration

NVDA installed/portable/running from source:

From sources

NVDA version:

Latest master after introduction of PR #13283

Windows version:

Windows 7 X64

Name and version of other software in use when reproducing the issue:

Visual Studio 2019

Other information about your system:

With the same version of Visual Studio build works on Windows 11

Other questions

Does the issue still occur after restarting your computer?

Yes, it does

Have you tried any other versions of NVDA? If so, please report their behaviors.

Build worked until merge of #13283

If NVDA add-ons are disabled, is your problem still occurring?

N/A

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

N/A

@lukaszgo1
Copy link
Contributor Author

cc @michaelDCurran We should either understand why build does not work on Windows 7 and fix the cause, or at the very least clearly document what are system requirements for NVDA development if this cannot be fixed.

@LeonarddeR
Copy link
Collaborator

I assume you have the Windows 11 SDK installed? I don't understand why the midl compiler would actually fail on a particular version of Windows.
Could you also test with VS2022 on Windows 7?
Note that, while NVDA still runs on Windows 7, we shouldn't bother about building it on Windows 7, though I agree we need to document that somewhere if possible.

@LeonarddeR
Copy link
Collaborator

Ugh, for me they actually also fail on Visual Studio 2022 because I don't have the VS2019 build tools installed. clearly the project has them hardcoded. Mus say that the way we're building this is quite nasty.

@lukaszgo1
Copy link
Contributor Author

Yes, I do have Windows 11 SDK installed. I've opened microsoft/Microsoft-UI-UIAutomation#89 to establish what is the cause or get a clarification as to what versions of Windows are supported when building.

michaelDCurran added a commit that referenced this issue Feb 16, 2022
…r, layout column number and section number (#13283)" (#13350)

This reverts commit a3ed8b8.
Reverted due to #13346 and microsoft/microsoft-ui-uiautomation/#89
@michaelDCurran
Copy link
Member

Use of the UIA remote ops library has been reverted until we can solve these build issues.

@MarcoZehe
Copy link
Contributor

I can confirm that NVDA Master builds again on my machine.

@seanbudd
Copy link
Member

Closed by ac06b96

michaelDCurran added a commit that referenced this issue Feb 24, 2022
…Word via UIA, using UIA remote ops (#13387)

This reintroduces the commits in pr #13283 which had been reverted in pr #13350. However it also addresses build issues.

Summary of the issue:
PR #13283 introduced support for reporting line/column/section numbers in Microsoft word via UI Automation, by using the UI Automation Remote Operations Library.
However, this PR had to be reverted in #13350 as
1. UIA would not initialize properly in binary builds due to a missing manifest file. (Improper initialization of UIA during NVDA start #13347)
2. NVDA failed to build on Visual Studio 2022. Specifically when building the Remote Ops library with msbuild, midl would fail with an error about a system environment variable being missing.
3. NVDA could no longer be built on Windows 7. (Impossible to build NVDA after introduction of UIA remote library #13346)

Description of how this pull request fixes the issue:
This PR reintroduces all of the original changes, but:
• setup.py now includes *.manifest files in the lib directory.
• NVDA again now requires Visual Studio 2019. However, builds will not fail if a newer version of Visual Studio (E.g. 2022) is installed along side 2019. this is managed by setting MSVC_VERSION in scons before it looks for Visual Studio, so that it specifically selects VS 2019 (VC 14.2).
Although building on Windows 7 could not be fixed, the readme now notes that only building on Windows 10 and higher is supported.
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

No branches or pull requests

5 participants