ctaggart / froto

Froto: F# Protocol Buffers
MIT License
146 stars 27 forks source link

Build fails on OS X and Windows #43

Closed takemyoxygen closed 8 years ago

takemyoxygen commented 8 years ago

I'm trying to build Froto on OS X and Windows, but build fails on both platforms with different error messages:

OS X 10.11.5 (Mono 4.4.0):

Sometimes it's

  TestParser.Service.Parse rpc [FAIL]
      System.ExecutionEngineException : Failed to create shadow copy .ini file.
      Stack Trace:
          at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
          at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x3e5bae8 + 0x00093> in <filename unknown>:0 

but sometimes unit tests target completes successfully and build fails on the next step with

Running build failed.
Error:
System.Exception: Error during NuGet package creation. /Users/takemyoxygen/dev/code/froto/packages/NuGet.Commandline/tools/nuget.exe pack -Version 0.4.0-a1606261534 -OutputDirectory "/Users/takemyoxygen/dev/code/froto/bin" "/Users/takemyoxygen/dev/code/froto/Parser/bin/Release/Froto.Parser.0.4.0-a1606261534.nuspec"    
楆敬渠瑯映畯摮›䘧潲潴倮牡敳⹲摰❢ਮ
  at Fake.NuGetHelper.NuGet (Microsoft.FSharp.Core.FSharpFunc`2 setParams, System.String nuspecOrProjectFile) <0x91f2600 + 0x00233> in <filename unknown>:0 
  at FSI_0005.Build+clo@83-9.Invoke (Microsoft.FSharp.Core.Unit _arg7) <0x91f2168 + 0x0002f> in <filename unknown>:0 
  at Fake.TargetHelper+targetFromTemplate@195[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) <0x91ea810 + 0x00020> in <filename unknown>:0 
  at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) <0x91e45c8 + 0x000bd> in <filename unknown>:0

With the latter I guess I know what might be the reason: if I try to create NuGet package manually by running:

mono packages/NuGet.CommandLine/tools/NuGet.exe pack Parser/bin/Release/Froto.Parser.0.4.0-a1606261534.nuspec 

I get the following error:

Attempting to build package from 'Froto.Parser.0.4.0-a1606261534.nuspec'.
File not found: 'Froto.Parser.pdb'.

So, it's just because there's no .pdb files produced during build on Mono.

Windows 10

After I do

.\paket.bootstrapper.exe
.\paket restore
.\build.ps1

build fails with:

Running build failed.
Error:
System.Exception: Could not detect package version for FParsec ---> System.Exception: Package FParsec was not found.
   at Fake.NuGetHelper.version@113.Invoke(String message) in C:\code\FAKE\src\app\FakeLib\NuGet\NugetHelper.fs:line 113
   at Fake.NuGetHelper.GetPackageVersion(String deploymentsDir, String package) in C:\code\FAKE\src\app\FakeLib\NuGet\NugetHelper.fs:line 113
   --- End of inner exception stack trace ---
   at Fake.NuGetHelper.GetPackageVersion(String deploymentsDir, String package) in C:\code\FAKE\src\app\FakeLib\NuGet\NugetHelper.fs:line 127
   at FSI_0005.Build.clo@85-10.Invoke(NuGetParams p) in Y:\dev\code\froto\build.fsx:line 86
   at Fake.NuGetHelper.NuGet(FSharpFunc`2 setParams, String nuspecOrProjectFile) in C:\code\FAKE\src\app\FakeLib\NuGet\NugetHelper.fs:line 387
   at FSI_0005.Build.clo@83-9.Invoke(Unit _arg7) in Y:\dev\code\froto\build.fsx:line 85
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\FAKE\src\app\FakeLib\TargetHelper.fs:line 484
System.Exception: Could not detect package version for FParsec ---> System.Exception: Package FParsec was not found.
   at Fake.NuGetHelper.version@113.Invoke(String message) in C:\code\FAKE\src\app\FakeLib\NuGet\NugetHelper.fs:line 113
   at Fake.NuGetHelper.GetPackageVersion(String deploymentsDir, String package) in C:\code\FAKE\src\app\FakeLib\NuGet\NugetHelper.fs:line 113
   --- End of inner exception stack trace ---
   at Fake.NuGetHelper.GetPackageVersion(String deploymentsDir, String package) in C:\code\FAKE\src\app\FakeLib\NuGet\NugetHelper.fs:line 127
   at FSI_0005.Build.clo@85-10.Invoke(NuGetParams p) in Y:\dev\code\froto\build.fsx:line 86
   at Fake.NuGetHelper.NuGet(FSharpFunc`2 setParams, String nuspecOrProjectFile) in C:\code\FAKE\src\app\FakeLib\NuGet\NugetHelper.fs:line 387
   at FSI_0005.Build.clo@83-9.Invoke(Unit _arg7) in Y:\dev\code\froto\build.fsx:line 85
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\FAKE\src\app\FakeLib\TargetHelper.fs:line 484

Are these ones known issues or I'm just missing something?

By the way, is that really necessary to specify all dependencies when creating a package in build.fsx and list all files that should packaged in nuspec file?

ctaggart commented 8 years ago

Just seeing this. I'll have a look after work.

takemyoxygen commented 8 years ago

Some update: build fails for me OS X is because of some issue with xunit.console.exe on Mono, the same issue is mentioned here in section 5. It does work on Travic CI though, my guess is that there's only one CPU core available there and in fact, there's no parallelization.

Tried changing to Parallel = ParallelMode.NoParallelization, looks like unit test pass and build fails on NuGet package creation.

ctaggart commented 8 years ago

Thanks for the update @takemyoxygen. Sorry that I haven't been able to get to it yet. What was the error with the NuGet package creation?

takemyoxygen commented 8 years ago

Error messages of both OS X and Windows build failures on NuGet step are in the description of the issue above:

jhugard commented 8 years ago

Merged. Note, however, that the continuous-integration/travis-ci/pr build is still very flakey. The unit tests are failing with a timeout; suspect that some test or tests are taking a long time when the Ci server is under load.