{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/2844","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/2844/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/2844/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/2844/events","html_url":"https://github.com/dotnet/roslyn/issues/2844","id":77463031,"number":2844,"title":"System.IO.EndOfStreamException: Failed to read past end of stream when building on FreeBSD","user":{"login":"ajensenwaud","id":5827908,"avatar_url":"https://avatars.githubusercontent.com/u/5827908?v=3","gravatar_id":"","url":"https://api.github.com/users/ajensenwaud","html_url":"https://github.com/ajensenwaud","followers_url":"https://api.github.com/users/ajensenwaud/followers","following_url":"https://api.github.com/users/ajensenwaud/following{/other_user}","gists_url":"https://api.github.com/users/ajensenwaud/gists{/gist_id}","starred_url":"https://api.github.com/users/ajensenwaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajensenwaud/subscriptions","organizations_url":"https://api.github.com/users/ajensenwaud/orgs","repos_url":"https://api.github.com/users/ajensenwaud/repos","events_url":"https://api.github.com/users/ajensenwaud/events{/privacy}","received_events_url":"https://api.github.com/users/ajensenwaud/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Infrastructure","name":"Area-Infrastructure","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-05-18T02:18:47Z","updated_at":"2015-08-10T08:01:21Z","closed_at":null,"body":"Hello, \r\nI receive a strange compilation error when attempting to build Roslyn on FreeBSD. I am using the latest Mono build, v.4.0.1.34 on FreeBSD 10.1 (amd64). \r\n\r\nSee error below: \r\n```\r\nfreebsd-frankfurt% ./cibuild.sh --mono-path /usr/local/lib/mono\r\nUsing mono path /usr/local/lib/mono\r\nRestoring NuGet packages\r\nAll packages listed in packages.config are already installed.\r\nAll packages listed in packages.config are already installed.\r\n'xunit.runners 2.0.0-alpha-build2576' already installed.\r\nCompiling the toolset compilers\r\n        Compiling the C# compiler\r\nXBuild Engine Version 12.0\r\nMono, Version 4.0.1.0\r\nCopyright (C) 2005-2013 Various Mono authors\r\n        Configuration: Debug Platform: AnyCPU\r\n        Configuration: Debug Platform: AnyCPU\r\nUnhandled Exception:\r\nSystem.IO.EndOfStreamException: Failed to read past end of stream.\r\n  at System.IO.BinaryReader.ReadChar () [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CvtResFile.ReadStringOrID (System.IO.BinaryReader fhIn) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CvtResFile.ReadResFile (System.IO.Stream stream) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.Compilation.MakeWin32ResourceList (System.IO.Stream win32Resources, Microsoft.CodeAnalysis.DiagnosticBag diagnostics) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.SetupWin32Resources (Microsoft.CodeAnalysis.CSharp.Emit.PEModuleBuilder moduleBeingBuilt, System.IO.Stream win32Resources, Microsoft.CodeAnalysis.DiagnosticBag diagnostics) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CompileImpl (Microsoft.CodeAnalysis.Emit.CommonPEModuleBuilder moduleBuilder, System.IO.Stream win32Resources, System.IO.Stream xmlDocStream, Boolean generateDebugInfo, Microsoft.CodeAnalysis.DiagnosticBag diagnostics, System.Predicate`1 filterOpt, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.Compilation.Compile (Microsoft.CodeAnalysis.Emit.CommonPEModuleBuilder moduleBuilder, System.IO.Stream win32Resources, System.IO.Stream xmlDocStream, Boolean generateDebugInfo, Microsoft.CodeAnalysis.DiagnosticBag diagnostics, System.Predicate`1 filterOpt, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.Compilation.Emit (Microsoft.CodeAnalysis.EmitStreamProvider peStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider pdbStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider xmlDocumentationStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider win32ResourcesStreamProvider, IEnumerable`1 manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, Microsoft.CodeAnalysis.CodeGen.CompilationTestData testData, System.Func`1 getHostDiagnostics, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.Compilation.Emit (Microsoft.CodeAnalysis.EmitStreamProvider peStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider pdbStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider xmlDocumentationStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider win32ResourcesProvider, IEnumerable`1 manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, System.Func`1 getHostDiagnostics, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CommonCompiler.RunCore (System.IO.TextWriter consoleOutput, Microsoft.CodeAnalysis.ErrorLogger errorLogger, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CommonCompiler.Run (System.IO.TextWriter consoleOutput, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CommandLine.Csc+<>c__DisplayClass1_0.<Run>b__0 (System.IO.TextWriter textWriterOut, System.IO.TextWriter _) [0x00000] in <filename unknown>:0\r\n  at Roslyn.Utilities.ConsoleUtil.RunWithOutput[Int32] (Boolean utf8Encoding, System.Func`3 func) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CommandLine.Csc.Run (System.String clientDirectory, System.String sdkDirectory, System.String[] args, IAnalyzerAssemblyLoader analyzerLoader) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.BuildTasks.BuildClient.RunWithConsoleOutput (System.String[] args, System.String clientDir, System.String workingDir, System.String sdkDir, IAnalyzerAssemblyLoader analyzerLoader, RequestLanguage language, System.Func`5 fallbackCompiler) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CommandLine.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CommandLine.Csc2.Main (System.String[] args) [0x00000] in <filename unknown>:0\r\n[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.EndOfStreamException: Failed to read past end of stream.\r\n  at System.IO.BinaryReader.ReadChar () [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CvtResFile.ReadStringOrID (System.IO.BinaryReader fhIn) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CvtResFile.ReadResFile (System.IO.Stream stream) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.Compilation.MakeWin32ResourceList (System.IO.Stream win32Resources, Microsoft.CodeAnalysis.DiagnosticBag diagnostics) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.SetupWin32Resources (Microsoft.CodeAnalysis.CSharp.Emit.PEModuleBuilder moduleBeingBuilt, System.IO.Stream win32Resources, Microsoft.CodeAnalysis.DiagnosticBag diagnostics) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CompileImpl (Microsoft.CodeAnalysis.Emit.CommonPEModuleBuilder moduleBuilder, System.IO.Stream win32Resources, System.IO.Stream xmlDocStream, Boolean generateDebugInfo, Microsoft.CodeAnalysis.DiagnosticBag diagnostics, System.Predicate`1 filterOpt, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.Compilation.Compile (Microsoft.CodeAnalysis.Emit.CommonPEModuleBuilder moduleBuilder, System.IO.Stream win32Resources, System.IO.Stream xmlDocStream, Boolean generateDebugInfo, Microsoft.CodeAnalysis.DiagnosticBag diagnostics, System.Predicate`1 filterOpt, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.Compilation.Emit (Microsoft.CodeAnalysis.EmitStreamProvider peStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider pdbStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider xmlDocumentationStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider win32ResourcesStreamProvider, IEnumerable`1 manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, Microsoft.CodeAnalysis.CodeGen.CompilationTestData testData, System.Func`1 getHostDiagnostics, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.Compilation.Emit (Microsoft.CodeAnalysis.EmitStreamProvider peStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider pdbStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider xmlDocumentationStreamProvider, Microsoft.CodeAnalysis.EmitStreamProvider win32ResourcesProvider, IEnumerable`1 manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, System.Func`1 getHostDiagnostics, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CommonCompiler.RunCore (System.IO.TextWriter consoleOutput, Microsoft.CodeAnalysis.ErrorLogger errorLogger, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CommonCompiler.Run (System.IO.TextWriter consoleOutput, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CommandLine.Csc+<>c__DisplayClass1_0.<Run>b__0 (System.IO.TextWriter textWriterOut, System.IO.TextWriter _) [0x00000] in <filename unknown>:0\r\n  at Roslyn.Utilities.ConsoleUtil.RunWithOutput[Int32] (Boolean utf8Encoding, System.Func`3 func) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CommandLine.Csc.Run (System.String clientDirectory, System.String sdkDirectory, System.String[] args, IAnalyzerAssemblyLoader analyzerLoader) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.BuildTasks.BuildClient.RunWithConsoleOutput (System.String[] args, System.String clientDir, System.String workingDir, System.String sdkDir, IAnalyzerAssemblyLoader analyzerLoader, RequestLanguage language, System.Func`5 fallbackCompiler) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CommandLine.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0\r\n  at Microsoft.CodeAnalysis.CSharp.CommandLine.Csc2.Main (System.String[] args) [0x00000] in <filename unknown>:0\r\n/usr/local/lib/mono/4.5/Microsoft.CSharp.targets: error : Compiler crashed with code: 1.\r\n```\r\n\r\nOS: \r\n```\r\nFreeBSD freebsd-frankfurt 10.1-RELEASE-p9 FreeBSD 10.1-RELEASE-p9 #0: Tue Apr  7 01:09:46 UTC 2015     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64\r\n```\r\n\r\nCompiler: \r\n```\r\nfreebsd-frankfurt% mcs --version\r\nMono C# compiler version 4.0.1.0\r\n```\r\n\r\nMono version: \r\n```\r\nfreebsd-frankfurt% mono --version\r\nMono JIT compiler version 4.0.1 (tarball Sun May 17 01:45:36 UTC 2015)\r\nCopyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com\r\n        TLS:           __thread\r\n        SIGSEGV:       altstack\r\n        Notification:  kqueue\r\n        Architecture:  amd64\r\n        Disabled:      none\r\n        Misc:          softdebug\r\n        LLVM:          supported, not enabled.\r\n        GC:            sgen\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/129349805","html_url":"https://github.com/dotnet/roslyn/issues/2844#issuecomment-129349805","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/2844","id":129349805,"user":{"login":"janhenke","id":592974,"avatar_url":"https://avatars.githubusercontent.com/u/592974?v=3","gravatar_id":"","url":"https://api.github.com/users/janhenke","html_url":"https://github.com/janhenke","followers_url":"https://api.github.com/users/janhenke/followers","following_url":"https://api.github.com/users/janhenke/following{/other_user}","gists_url":"https://api.github.com/users/janhenke/gists{/gist_id}","starred_url":"https://api.github.com/users/janhenke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janhenke/subscriptions","organizations_url":"https://api.github.com/users/janhenke/orgs","repos_url":"https://api.github.com/users/janhenke/repos","events_url":"https://api.github.com/users/janhenke/events{/privacy}","received_events_url":"https://api.github.com/users/janhenke/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T08:01:21Z","updated_at":"2015-08-10T08:01:21Z","body":"Certainly it would be a great thing to have Roslyn on FreeBSD as well. Before adding it to the official instructions though, I would like to fix the points you mentioned. It should work out of the box without having to compile all the build dependencies yourself.\r\n\r\nAs far as I see the first step would be to get current Mono point release into ports? @ajensenwaud do you know the status of that?"}}