jet / falanx

Generates F# code from protobuf schema for binary and json format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project does not compile under linux

vchekan opened this issue · comments

Describe the bug
Project does not compile under linux

To Reproduce
First, global.json pin sdk version to 2.1.403, which is outdated and makes it impossible(or difficult) to compile project out of the box. After removing global.json dotnet build starts but paket fails:

$ dotnet build Falanx.sln 
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  shasum: /home/vadim/projects/falanx/.paket/../paket-files/paket.restore.cached: 
  shasum: /home/vadim/projects/falanx/.paket/../paket-files/paket.restore.cached: 
  shasum: /home/vadim/projects/falanx/.paket/../paket-files/paket.restore.cached: 
  shasum: /home/vadim/projects/falanx/.paket/../paket-files/paket.restore.cached: 
  Paket version 5.189.1
  Starting full restore process.
  Stacktrace:
  
    at <unknown> <0xffffffff>
  
  Unhandled Exception:
  System.NullReferenceException: Object reference not set to an instance of an object
  [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
/home/vadim/projects/falanx/.paket/Paket.Restore.targets(91,5): error MSB3073: The command "mono --runtime=v4.0.30319 "/home/vadim/projects/falanx/.paket/paket.exe" restore" exited with code 1. [/home/vadim/projects/falanx/Falanx.Proto.Generator/Falanx.Proto.Generator.fsproj]
  Paket version 5.189.1
  Paket version 5.189.1
  Stacktrace:
  Stacktrace:
  
  
    at <unknown> <0xffffffff>
    at <unknown> <0xffffffff>
  
  
  Unhandled Exception:
  Unhandled Exception:
  System.NullReferenceException: Object reference not set to an instance of an object
  System.NullReferenceException: Object reference not set to an instance of an object
  [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
/home/vadim/projects/falanx/.paket/Paket.Restore.targets(91,5): error MSB3073: The command "mono --runtime=v4.0.30319 "/home/vadim/projects/falanx/.paket/paket.exe" restore" exited with code 1. [/home/vadim/projects/falanx/Falanx.Proto.Codec.Binary/Falanx.Proto.Codec.Binary.fsproj]
/home/vadim/projects/falanx/.paket/Paket.Restore.targets(91,5): error MSB3073: The command "mono --runtime=v4.0.30319 "/home/vadim/projects/falanx/.paket/paket.exe" restore" exited with code 1. [/home/vadim/projects/falanx/Falanx.Proto.Codec.Json/Falanx.Proto.Codec.Json.fsproj]
  Paket version 5.189.1

Environement (please complete the following information):

  • OS: linux:
$ lsb_release -irc
Distributor ID:	LinuxMint
Release:	18.3
Codename:	sylvia
  • Framework [e.g. netstandard2.0, net461]
$ dotnet --list-sdks
2.0.2 [/usr/share/dotnet/sdk]
2.1.500 [/usr/share/dotnet/sdk]

pack and test seem to build but not a normal build, on osx this is due to the sln being in the same dir as the build.proj file. Apparently on windows it is fine...

First, global.json pin sdk version to 2.1.403, which is outdated and makes it impossible(or difficult) to compile project out of the box

the global.json is needed to pin the .net core sdk, because that bundle a specific compiler, sdk, msbuild version. commands/behaviour/knownbugs/workaround can change a bit between versions (that's why is pinned).

It doesnt matter if is a bit out of date (will be upgraded from time to time), and all version of .net core sdk can be installed side by side (the dotnet command with check what to use based on the global.json, if found).

Link to sdk versions in .net core archive

About compile error, i'll check with @vchekan but it builds on osx and unix on travis ci, and locally in my ubuntu and windows WLS

as a note, it is a paket error

/home/vadim/projects/falanx/.paket/Paket.Restore.targets(91,5): error MSB3073: The command "mono --runtime=v4.0.30319 "/home/vadim/projects/falanx/.paket/paket.exe" restore" exited with code 1. [/home/vadim/projects/falanx/Falanx.Proto.Generator/Falanx.Proto.Generator.fsproj]

rerunning same command should give same error.

@vchekan the mono version?

@enricosada "because that bundle a specific compiler, sdk, msbuild"
When you say version, do you mean major.minor or including patch version?
It does not compile out of the box on Ubuntu 18.10 too because it install runtimes 2.1.502 and 2.2.101 as of today.

the global.json, by design, pin a major.minor.patch, is not possibile to specify 2.1.* (and will not help anyway, because patch version change things too, a small change is from 2.1.401 to 2.1.402, but 2.1.500 is a bigger bump in sdk version)

@vchekan you can try follow the instruction at https://github.com/dotnet/core/blob/master/release-notes/2.1/2.1.5/2.1.5-download.md to download and install the correct version 2.1.403 (will be installed side by side) or with the tar+unzip
as a note, ubuntu 18.10 is not yet supported by .net core sdk ( https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x ), only 18.04, but doesnt seem related to the error

With regards to global.json, installing required version will solve my problem but will not solve problem of everyone who is trying to compile project on default linux configuration. Most liux package managers keep only recent version of sdk. Is sdk patch revision incompatibility a known problem or hypothetical one?

It's like how is expected to work.

You can install multiple sdk side by side also in linux/osx.

It's not possibile to trust developers to have a compatible version installed, that can be older or newer (but not compatibile because different workaround, sdk stuff, etc)