You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
Can't build CodeContracts - installer building fails #375
Hi everyone.
I've forked CC from master branch yesterday, and can't build it via batch file. I'm running buildcc.bat from MSBuild command prompt (VS2015) and getting this error:
You need to use VS2013. VS2015 is still not supported (the error message looks weird, but even if this one will pass you'll face another issue with VS2015)..
Sergey Teplyakov (@SergeyTeplyakov): well... I've built CC about 3 weeks ago successfully from master branch using VS 2015. Moreover, I was able to build it from unpacked ZIP-archive, without git installed, while now I had to clone git repository locally.
Definitely something was changed in build scripts (maybe, somewhere else, this is just an assumption). Also note, that CC libraries are built just fine. The case is in installer. Are you sure, that the problem is in VS (MSBuild version)?
VS2013 Developer Command Prompt plus Git in my path (I think latest Git for Windows) works fine for me, but I am also building from a cloned repository.
Could it be that git update-index fails in odd ways if it's not running from a git repo?
But the question is, why the failure is happening on the git command? I'll try to check it tomorrow (almost 1 a.m. in the morning right now in my time zone).
Yaakov (@yaakov-h)Dennis (@Dennis-Petrov) I used git update-index command to hide all changes made by build process to files in repository (version.cs and vsix manifests). It might also be achieved by a copy of a template file with entry in .gitignore but it would not work inside Visual Studio.
Most of the time I work with CodeContracts directly from git repository (I assume that most of us do). In such case executing buildCC.bat produced changes for files I did not want to commit. Using git add . was pretty hard. #328 was addressing this issue but I did not covered a situation when the source code is not on git repository or git is not available.
First commit in #376 fixes an invalid dash character. I was not building CC from VS2015 command prompt so did not encountered the issue before (command prompt for VS2013 works just fine even for the same version of git, so there may be something changed in MSBuild 14.0 regarding encoding).
Second commit in #376 adds condition before calling each git update-index. The condition is an error code returned by git rev-parse. Value of 0 means that git is available (command was run) and current directory is under git control.
I would like to ask you to take a look at this PR in case there are some other cases I not covered.
Hubert Bukowski (@hubuk): Looks like there's another issue. I've finally build it, but without VB stuff. Literally, I had to remove these projects from solution and their output from WiX script:
Dennis (@Dennis-Petrov) As Sergey Teplyakov (@SergeyTeplyakov) wrote, building from Visual Studio 2015 is not quite finished yet. Even if it was working before it produced invalid bits due to some rewriter issues with Roslyn (parts of CC are being rewriten too). Anyway, this is an easily reproducible on VS2015 command prompt build. It would be best to raise a separate issue for full VS2015 support with working tests.
Activity
SergeyTeplyakov commentedon Feb 9, 2016
You need to use VS2013. VS2015 is still not supported (the error message looks weird, but even if this one will pass you'll face another issue with VS2015)..
hubuk commentedon Feb 9, 2016
I was able to reproduce the issue. The error message is indeed weird:
When running on dev cmd for VS2013 with the same version of git (2.7.0.2 x64) everything works fine.
Dennis-Petrov commentedon Feb 9, 2016
Sergey Teplyakov (@SergeyTeplyakov): well... I've built CC about 3 weeks ago successfully from master branch using VS 2015. Moreover, I was able to build it from unpacked ZIP-archive, without git installed, while now I had to clone git repository locally.
Definitely something was changed in build scripts (maybe, somewhere else, this is just an assumption). Also note, that CC libraries are built just fine. The case is in installer. Are you sure, that the problem is in VS (MSBuild version)?
yaakov-h commentedon Feb 9, 2016
VS2013 Developer Command Prompt plus Git in my path (I think latest Git for Windows) works fine for me, but I am also building from a cloned repository.
Could it be that
git update-indexfails in odd ways if it's not running from a git repo?SergeyTeplyakov commentedon Feb 9, 2016
Dennis (@Dennis-Petrov) Now, it is clear that something is broken.
SergeyTeplyakov commentedon Feb 9, 2016
But the question is, why the failure is happening on the git command? I'll try to check it tomorrow (almost 1 a.m. in the morning right now in my time zone).
Dennis-Petrov commentedon Feb 9, 2016
Sergey Teplyakov (@SergeyTeplyakov): I've figured out it. :) There's a typo here (buildMSI10.xml):
The second dash before "assume" has 0x2013 code instead of 0x2D ("minus" key on keyboard). Looks like there several such typos there. These ones too:
hubuk commentedon Feb 9, 2016
My fault. PR created.
yaakov-h commentedon Feb 9, 2016
Oh good catch, that's a Unicode EN-Dash.
So the new question is: Why does it work for me/AppVeyor/etc.? A less pedantic versions of Git?
Dennis-Petrov commentedon Feb 9, 2016
Yaakov (@yaakov-h): also, why it does require git / git repo at all now? Do we need to improve README.MD?
yaakov-h commentedon Feb 9, 2016
No idea, that's a question for Hubert Bukowski (@hubuk) from #328.
hubuk commentedon Feb 9, 2016
Yaakov (@yaakov-h) Dennis (@Dennis-Petrov) I used
git update-indexcommand to hide all changes made by build process to files in repository (version.cs and vsix manifests). It might also be achieved by a copy of a template file with entry in .gitignore but it would not work inside Visual Studio.Most of the time I work with CodeContracts directly from git repository (I assume that most of us do). In such case executing buildCC.bat produced changes for files I did not want to commit. Using
git add .was pretty hard. #328 was addressing this issue but I did not covered a situation when the source code is not on git repository or git is not available.First commit in #376 fixes an invalid dash character. I was not building CC from VS2015 command prompt so did not encountered the issue before (command prompt for VS2013 works just fine even for the same version of git, so there may be something changed in MSBuild 14.0 regarding encoding).
Second commit in #376 adds condition before calling each
git update-index. The condition is an error code returned bygit rev-parse. Value of 0 means that git is available (command was run) and current directory is under git control.I would like to ask you to take a look at this PR in case there are some other cases I not covered.
Dennis-Petrov commentedon Feb 9, 2016
Hubert Bukowski (@hubuk): Looks like there's another issue. I've finally build it, but without VB stuff. Literally, I had to remove these projects from solution and their output from WiX script:
Microsoft.VisualBasic.Compatibility10
Microsoft.VisualBasic10
because both of them can't resolve reference to
Microsoft.VisualBasic.dllduring build.hubuk commentedon Feb 9, 2016
Dennis (@Dennis-Petrov) Could you provide a build log file?
Dennis-Petrov commentedon Feb 9, 2016
Sure. Added attachment.
build.zip
hubuk commentedon Feb 9, 2016
Dennis (@Dennis-Petrov) As Sergey Teplyakov (@SergeyTeplyakov) wrote, building from Visual Studio 2015 is not quite finished yet. Even if it was working before it produced invalid bits due to some rewriter issues with Roslyn (parts of CC are being rewriten too). Anyway, this is an easily reproducible on VS2015 command prompt build. It would be best to raise a separate issue for full VS2015 support with working tests.
Dennis-Petrov commentedon Feb 26, 2016
Shouldn't this issue be closed, since we're waiting for complete VS2015 support?
hubuk commentedon Feb 26, 2016
Dennis (@Dennis-Petrov) I think this issue may remain opened as a reference. But it is up to you.
johncrim commentedon Apr 12, 2017
I've sent a PR with a couple fixes that allow me to build the project using VS 2015. The PR is associated with #471.