Visual Studio solution not working due to extra new lines

188 views
Skip to first unread message

Maxime Viargues

unread,
Feb 12, 2020, 4:46:52 PM2/12/20
to gyp-developer
Hi there,

We've updated our GYP to the latest version to support Python 3 but we came across an issue on Windows. After generating the solutions, it fails to build in command line using MSBUILD because the solutions contain extra new lines.
The error shown is "Solution file error MSB5011: Parent project GUID not found in "network" project dependency section."

After inspecting the solution file it appears that there is en extra CR for each line so it looks like this:

Microsoft Visual Studio Solution File, Format Version 12.00

# Visual Studio 2015

Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "(algorithm)", "..\serato\algorithm", "{301D1456-B2AB-4E48-913D-F31B6EA08552}"

EndProject

instead of 

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2015
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "(algorithm)", "..\serato\algorithm", "{301D1456-B2AB-4E48-913D-F31B6EA08552}"
EndProject

and showing the new line characters it looks like:

Microsoft Visual Studio Solution File, Format Version 12.00(CR)
(CR)(LF)
# Visual Studio 2015(CR)
(CR)(LF)
etc.

Removing the extra (CR) fixes the problem.
Note that this only happens on Python 3, not in Python 2.
Also when the solution is opened with VisuaStudio, it removes the new line itself. But we don't open it when building on CI systems.

As a fix I replaced all the '\r\n' in pylib/gyp/MSVSNew.py with '\n' and that fixed the issue.

I wonder if the fix makes sense and if you could apply it on master?

Kind regards,
Maxime

Reply all
Reply to author
Forward
0 new messages