Skip to content

[WIP] Add netcore using .NET CLI - #47

Closed
enricosada wants to merge 22 commits into
fsprojects:masterfrom
enricosada:add_netcore_using_dotnetcli
Closed

enricosada wants to merge 22 commits into
fsprojects:masterfrom
enricosada:add_netcore_using_dotnetcli

Conversation

@enricosada

Copy link
Copy Markdown
Contributor

There are three issues:

  • BinaryFormatters not supported by netcore afaik (it's used? or only the open namespace?)
  • Configuration for appsettings, not supported by netcore afaik (maybe use Microsoft.Framework.Configuration package?
  • a bug with overload resolution of fsc.exe, i think, i'll create an issue in visualfsharp

Only the bug with overload stop the build, i made the appsettings fail with not supported exception atm

I'll add appveyor build soon

But having .net cli installed (only windows works atm, there is a bug), from repo root

  • dotnet restore
  • cd src/Argu
  • dotnet build

there is a temporary smoke test prject in src/Argu.Dotnetcli.Tests (it can be removed or moved after)

  • cd src/Argu.Dotnetcli.Tests
  • dotnet build --framework net46 to check net46 works
  • ./bin/Debug/net46/win7-x64/Argu.Dotnetcli.Tests.exe to run it

when dnxcore works

  • cd src/Argu.Dotnetcli.Tests
  • dotnet run --framework dnxcore50

When everything is green, the built assembly can be added to current Argu nuget package for netcore framework

@enricosada enricosada changed the title [WIP]Add netcore using .NET CLI [WIP] Add netcore using .NET CLI Feb 25, 2016
@enricosada
enricosada force-pushed the add_netcore_using_dotnetcli branch from c475691 to 8da00cf Compare February 25, 2016 16:32
@enricosada

Copy link
Copy Markdown
Contributor Author

the appveyor build error

Compiling Argu for DNXCore,Version=v5.0 
    'a     
 to 
    IArgParserTemplate    
involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed. 
C:\projects\argu-6jatx\.dotnet\cli\bin\dotnet.exe compile-fsc @C:\projects\argu-6jatx\src\Argu\obj\Debug\dnxcore50\dotnet-compile.rsp returned Exit Code 1 
C:\projects\argu-6jatx\src\Argu\ArgInfo.fs(229,64): error FS0495: The member or object constructor 'PreComputeUnionConstructor' has no argument or settable return property 'bindingFlags'. The required signature is static member FSharpValue.PreComputeUnionConstructor : unionCase:UnionCaseInfo * ?allowAccessToPrivateRepresentation:bool -> (obj [] -> obj). 
C:\projects\argu-6jatx\src\Argu\ArgInfo.fs(233,9): error FS0008: This runtime coercion or type test from type 
C:\projects\argu-6jatx\src\Argu\UnParsers.fs(84,76): error FS0495: The member or object constructor 'GetUnionFields' has no argument or settable return property 'bindingFlags'. The required signature is static member FSharpValue.GetUnionFields : value:obj * unionType:Type * ?allowAccessToPrivateRepresentation:bool -> UnionCaseInfo * obj []. 
C:\projects\argu-6jatx\src\Argu\UnParsers.fs(92,25): error FS0752: The operator 'expr.[idx]' has been used on an object of indeterminate type based on information prior to this program point. Consider adding further type constraints 
C:\projects\argu-6jatx\src\Argu\UnParsers.fs(150,76): error FS0495: The member or object constructor 'GetUnionFields' has no argument or settable return property 'bindingFlags'. The required signature is static member FSharpValue.GetUnionFields : value:obj * unionType:Type * ?allowAccessToPrivateRepresentation:bool -> UnionCaseInfo * obj []. 
C:\projects\argu-6jatx\src\Argu\UnParsers.fs(158,20): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. 
C:\projects\argu-6jatx\src\Argu\ArgumentParser.fs(38,57): error FS0495: The member or object constructor 'IsUnion' has no argument or settable return property 'bindingFlags'. The required signature is static member FSharpType.IsUnion : typ:Type * ?allowAccessToPrivateRepresentation:bool -> bool. 
C:\projects\argu-6jatx\src\Argu\ArgumentParser.fs(42,53): error FS0495: The member or object constructor 'GetUnionCases' has no argument or settable return property 'bindingFlags'. The required signature is static member FSharpType.GetUnionCases : unionType:Type * ?allowAccessToPrivateRepresentation:bool -> UnionCaseInfo []. 

Compilation failed. 
    0 Warning(s) 
    8 Error(s) 

the PreComputeUnionConstructor for example it's trying to use the wrong overload

Or someones has ideas? /cc @dsyme @KevinRansom

@eiriktsarpalis

Copy link
Copy Markdown
Member

Hi Enrico,

The BinaryFormatter namespace declaration is indeed a leftover from a feature that has long been removed. You can safely remove it.

Regarding AppSettings, I think it would be best if all the relevant API was cleared off for CLR builds, as opposed to raising NotSupportedExceptions in the midst of execution.

@enricosada

Copy link
Copy Markdown
Contributor Author

ok about binaryformatter, one #ifdef less 😄

i'll ifdef the whole appsettings api out instead of throw. I was asking because maybe you had a replacement in mind, but remove it it's safer atm

the overload bug is something i dont know how to workaround, if noone find an idea we need to wait the fix of fsc

@eiriktsarpalis

Copy link
Copy Markdown
Member

#46

@matthid matthid mentioned this pull request Jul 1, 2016
@enricosada

Copy link
Copy Markdown
Contributor Author

closed in favor of #57

@enricosada enricosada closed this Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants