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

Build stuck on unicode locale Windows #490

Merged
merged 2 commits into from
Dec 11, 2019

Conversation

myguitar
Copy link
Contributor

@myguitar myguitar commented Dec 6, 2019

This issue happens under two conditions

  1. Unicode language environment in Windows
  2. A python calls 'BaseTools/toolsetup.bat'
    (In EDKII, edksetup.bat directly in Windows command shell)
  • 'BuildLoader.py' calls 'BaseTools/toolsetup.bat' in a subprocess
  • 'BaseTools/toolsetup.bat' calls 'nmake cleanall'
  • 'cleanall' target runs 'python NmakeSubdirs.py' directly
  • 'NmakeSubdirs.py' creates multi-threads
  • The threads create another subprocesses

But, one of multi-threads is on deadlock when python handles stdout and
stderr in a subprocess pipe only if the output includes unicode chars.
Therefore, only stderr will be handled in the pipe same as a single
thread call.

Signed-off-by: Aiden Park aiden.park@intel.com

GIT allows only UNIX format in .patch file. Otherwise, git am or apply
will report 'fatal: git apply: bad git-diff - expected /dev/null'.
But, PatchCheck blocks non-CRLF changes in commit. It's mutual exclusive.
Therefore, skip CRLF check in git .patch files.

Signed-off-by: Aiden Park <aiden.park@intel.com>
This issue happens under two conditions
  1. Unicode language environment in Windows
  2. A python calls 'BaseTools/toolsetup.bat'
     (In EDKII, edksetup.bat directly in Windows command shell)

- 'BuildLoader.py' calls 'BaseTools/toolsetup.bat' in a subprocess
- 'BaseTools/toolsetup.bat' calls 'nmake cleanall'
- 'cleanall' target runs 'python NmakeSubdirs.py' directly
- 'NmakeSubdirs.py' creates multi-threads
-  The threads create another subprocesses

But, one of multi-threads is on deadlock when python handles stdout and
stderr in a subprocess pipe only if the output includes unicode chars.
Therefore, only stderr will be handled in the pipe same as a single
thread call.

Signed-off-by: Aiden Park <aiden.park@intel.com>
@myguitar myguitar removed the Do not merge Do not merge label Dec 11, 2019
@myguitar myguitar marked this pull request as ready for review December 11, 2019 20:31
@myguitar myguitar requested a review from a team as a code owner December 11, 2019 20:31
Copy link
Contributor

@mauricema mauricema left a comment

Choose a reason for hiding this comment

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

looks good to me.

@gdong1
Copy link
Collaborator

gdong1 commented Dec 11, 2019

Are the changes for Basetool coming from EDK2 base tool? If not, should we report issue to EDK2 base tool?

@myguitar
Copy link
Contributor Author

Are the changes for Basetool coming from EDK2 base tool? If not, should we report issue to EDK2 base tool?

Right, the change has been made in EDK2 BaseTools. I will follow up next step.

@gdong1
Copy link
Collaborator

gdong1 commented Dec 11, 2019

Are the changes for Basetool coming from EDK2 base tool? If not, should we report issue to EDK2 base tool?

Right, the change has been made in EDK2 BaseTools. I will follow up next step.
Got it. we need sync EDK2 base tool later sometime.

@myguitar myguitar merged commit 6295c4e into slimbootloader:master Dec 11, 2019
@myguitar myguitar deleted the build_on_unicode_windows branch December 11, 2019 21:35
myguitar added a commit to myguitar/edk2 that referenced this pull request Dec 11, 2019
This issue happens under two conditions.
  1. Unicode language environment in Windows
  2. Call 'edksetup.bat forcerebuild' with python subprocess.call()

Steps to reproduce
  C:\edk2>python
  Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40)
  Type help, copyright, credits or license for more information.
  >>> import subprocess
  >>> subprocess.call(['edksetup.bat', 'forcerebuild'])

  The edksetup.bat stuck at 'nmake cleanall'.

One of multi-threads is on deadlock when python handles stdout and
stderr in a subprocess pipe only if the outputs include unicode chars.
Only stderr will be handled in the pipe same as a single thread call.

Reported in Slim Bootloader.
  slimbootloader/slimbootloader#478
Local fix has been made in Slim Bootloader.
  slimbootloader/slimbootloader#490

Signed-off-by: Aiden Park <aiden.park@intel.com>
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.

None yet

3 participants