aspnet / KoreBuild

OBSOLETE REPO - see readme
Other
37 stars 23 forks source link

Two issues when running 'build initialize' in Razor sources #152

Closed Yves57 closed 7 years ago

Yves57 commented 7 years ago

I just cloned the Razor sources with Visual Studio 2017 RC (aspnet/Razor#903). When I tried to compile the Razor solution for the first time in Visual Studio, it requested to run build initialize in a command line.

But I had two problems with the script:

Eilon commented 7 years ago

@NTaylorMullen can you take a look?

NTaylorMullen commented 7 years ago

Hmm what version of VS2017 are you using @Yves57?

Yves57 commented 7 years ago

@NTaylorMullen Probably the latest (downloaded sunday 18). From the About dialog:

Microsoft Visual Studio Community 2017 RC
Version 15.0.26014.0 D15REL
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Community

Visual Basic 2017 RC   00369-50000-00000-AA466
Microsoft Visual Basic 2017 RC

Visual C# 2017 RC   00369-50000-00000-AA466
Microsoft Visual C# 2017 RC

Application Insights Tools for Visual Studio Package   8.4.01118.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2016   15.0.21206.0
ASP.NET and Web Tools 2016

ASP.NET Web Frameworks and Tools 2013   5.2.41123.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v2.9.6   15.0.21130.0
Azure App Service Tools v2.9.6

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   2.1.1.4
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio vNext - v2.9.41121.2

Microsoft Continuous Delivery Tools for Visual Studio   0.1
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

NuGet Package Manager   4.0.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SQL Server Data Tools   15.1.61124.0
Microsoft SQL Server Data Tools

TSCPackage Extension   1.0
TSCPackage Visual Studio Extension Detailed Info

TypeScript   2.1.3.0
TypeScript tools for Visual Studio
NTaylorMullen commented 7 years ago

A few people at work had the same problem. Can you try having the following bits checked:

image image

image

davidfowl commented 7 years ago

Visual Studio Extension development? You shouldn't need that.

NTaylorMullen commented 7 years ago

@davidfowl agree. I haven't isolated the problem but performing these two tasks fixed it for Ajay

Yves57 commented 7 years ago

@NTaylorMullen First thing, the workarounds that I have described made compilation works. So I don't need specific help, don't waste you time if not necessary. But if it may help you, that's fine for me.

I am making the modifications in my setup. After that, I propose to download the latest ZIP of the current Razor repo (I need 'fresh' sources because my current clone works fine now), then open Visual Studio, then trying a first compilation inside Visual Studio. Is it correct for you?

NTaylorMullen commented 7 years ago

@Yves57 Doing that works fine on my box which is the troublesome part 😢

Yves57 commented 7 years ago

Just a question first: what is the problem for you? I should never have to call "build initialize", or the two script errors?

Bad news, still a script problem 😢 Here is the test report (with maybe too much screenshots, but I don't know if it may help you): 1) Visual Studio Setup (sorry it is in french but I think that the translation is easy) image

2) Downloaded the Razor repo ZIP file (decompressed in a non-space directory path).

3) Open Visual Studio, and just ask for Build.

4) Waiting a long time (slow connection), with several message on the status bar. Here are the most significant (in the right order). image

image

image

image

5) Keep Visual Studio open, and start a Visual Studio command line.

6) Call "build initialize". And here is the screenshot (no download problem because SDK is already installed, but the script still fail with the dot. image

rynowak commented 7 years ago

Wondering if our build scripts have some problems in a non-English environment.

I see these lines in the common.props

<_SecondBasedTimeStamp>$([System.DateTime]::UtcNow.Subtract($([System.DateTime]::Parse("2015-01-01"))).TotalSeconds.ToString())</_SecondBasedTimeStamp>
<_SecondBasedTimeStamp>t$([System.Int64]::Parse($(_SecondBasedTimeStamp.Substring(0, $(_SecondBasedTimeStamp.IndexOf("."))))).ToString("x9"))</_SecondBasedTimeStamp>

His separator in fr-FR would be , not . - hence the -1. :fr: All of this needs to be done with invariant culture.

Eilon commented 7 years ago

@rynowak oh that does seem problematic then... it's quite clearly wrong, assuming it uses the default CurrentCulture (unless MSBuild sets something else by default, which I doubt).

Eilon commented 7 years ago

@NTaylorMullen can you fix? Should be easy enough to pass in System.Globalization.CultureInfo.InvariantCulture.

Yves57 commented 7 years ago

In fact I think that @rynowak is the only guy that succeeded to translate my French-English to a correct English. There is the Comma problem, but I think there is a timeout problem too (default value set to 1'40 if I remember). France is far from Seattle...

NTaylorMullen commented 7 years ago

@natemcmaster Is there any reason why we chose the property setting mechanism @rynowak listed above versus something like: $([System.DateTime]::UtcNow.ToString("yyyyMMddhhmmss"))?

natemcmaster commented 7 years ago

The int-parsing issue looks like a localization issue that can probably be fixed by using the ToString overload for invariant culture. The intention is to keep the build number. NuGet enforces a 20 character limit on the pre-release label. Something like preview2-yyyyMMddhhmmss would be too long.

Eilon commented 7 years ago

@natemcmaster unfortunately MSBuild doesn't let you use CultureInfo.InvariantCulture in expressions ☹️ But I think @NTaylorMullen had some ideas of how to solve this, though it might just be a matter of using a code task.

NTaylorMullen commented 7 years ago

This should be good now after @natemcmaster's change. @Yves57 could you re-test and close this if your issue is resolved?

Yves57 commented 7 years ago

@NTaylorMullen Already done (see #154 comment).

Yves57 commented 7 years ago

And what about the timeout?

NTaylorMullen commented 7 years ago

Hmm, @Yves57 I don't have that issue. When I re-clone and run build initialize for the first time the proper common.props gets pulled down. It's possible that things didn't flow through our system when you tried it. Would you mind trying one more time?

natemcmaster commented 7 years ago

@Yves57 how much bandwidth do you have? @NTaylorMullen I have a network conditioning simulator so we can try the dotnet-install.ps1 scripts on a 'slow' connection.

Yves57 commented 7 years ago

@natemcmaster @NTaylorMullen I just retried, and I still have the timeout problem when downloading the SDK after the 1'40 timeout default value. If I download the file "manually" by Internet Explorer, it takes about 3 minutes.

My bandwidth is about 3Mbps (Yes it is possible :smile:).

natemcmaster commented 7 years ago

@Yves57 I can reproduce by setting my network down to 3Mbps. I'll add a timeout to our script.

FYI, this script is basically a copy of https://github.com/dotnet/cli/blob/rel/1.0.0/scripts/obtain/dotnet-install.ps1. It looks like the CLI team ran into this issue too: https://github.com/dotnet/cli/pull/4659

Yves57 commented 7 years ago

@natemcmaster Fine, thank you!

natemcmaster commented 7 years ago

Resolved in https://github.com/aspnet/KoreBuild/commit/6fa76aa6762b5a37e95187748e093b5d0f81f58c.

Feel free to reopen if this doesn't solve your issue.