Skip to content

Generation of comInterfaces sometimes fails when it is being done in parallel. #13290

@lukaszgo1

Description

@lukaszgo1

Regression from PR #13226 cc @LeonarddeR

Steps to reproduce:

Build NVDA from a clean checkout on a multicore machine. If the issue does not show up repeat as many times as needed.

Actual behavior:

Occasionally build fails with the following:

scons: *** [source\comInterfaces\AcrobatAccessLib.py] RuntimeError : input() already active
Traceback (most recent call last):
  File "C:\Users\my_user_name\nvda\.venv\lib\site-packages\SCons\Action.py", line 1279, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "C:\Users\my_user_name\nvda\source\comInterfaces_sconscript", line 70, in interfaceAction
    makeIDEFriendly(path)
  File "C:\Users\my_user_name\nvda\source\comInterfaces_sconscript", line 48, in makeIDEFriendly
    for line in fileinput.input(path, inplace=True):
  File "C:\Python37\lib\fileinput.py", line 93, in input
    raise RuntimeError("input() already active")
RuntimeError: input() already active
ia2_p.c
scons: building terminated because of errors.

Expected behavior:

Build should be successful every time.

System configuration

NVDA installed/portable/running from source:

From source

NVDA version:

Latest master as of January 29-th

Windows version:

N/A

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

N/A

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Yes

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

No such issues with versions before introduction of #13226

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

Technical:

Since fileinput redirects stdout to a file we cannot do this in multiple threads at the same time. I see two ways of fixing this:

  • No longer use fileinput - read the file, create the IDE friendly version in memory and overwrite the file instead.
  • Tell SCons not to generate COMInterfaces in parallel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions