dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
593 stars 52 forks source link

WebSharper build.cmd type constraint mismatch error #510

Closed cgravill closed 8 years ago

cgravill commented 8 years ago

I wanted to try some of the recent changes and attempted a build from source control and got some errors

CoreCompile:
  C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\fsc.exe -o:obj\Release\WebSharper.Build.exe --debug:pdbonly --noframework --define:TRACE --doc:C:
  \dev\websharper\msbuild\\..\build\Release\WebSharper.Build.xml --keyfile:C:\dev\websharper\msbuild\/../tools/WebSharper.snk --optimize+ -r:C:\dev\websharper\
  packages\AjaxMin\lib\net40\AjaxMin.dll -r:C:\dev\websharper\build\Bootstrap\Bootstrap.exe -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.N
  ETFramework\v4.0\4.3.0.0\FSharp.Core.dll" -r:C:\dev\websharper\packages\IntelliFactory.Build\lib\net45\IntelliFactory.Build.dll -r:C:\dev\websharper\packages
  \IntelliFactory.Core\lib\net40\IntelliFactory.Core.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" -
  r:C:\dev\websharper\packages\Nuget.Core\lib\net40-Client\NuGet.Core.dll -r:C:\dev\websharper\packages\sharpcompress\lib\net40\SharpCompress.dll -r:"C:\Progra
  m Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Configuration.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft
  \Framework\.NETFramework\v4.5\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" -r:"C:\Prog
  ram Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.IO.Compression.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Micros
  oft\Framework\.NETFramework\v4.5\System.IO.Compression.FileSystem.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
  \System.Numerics.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.dll" -r:"C:\Program Files (x86)\Refer
  ence Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
  \System.Xml.Linq.dll" --target:exe --warn:3 --warnaserror:76 --fullpaths --flaterrors --subsystemversion:6.00 --highentropyva+ "C:\Users\a-cograv\AppData\Loc
  al\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.fs" C:\dev\websharper\msbuild\/AssemblyInfo.fs C:\dev\websharper\msbuild\/AssemblyInfo.extra.fs Config.
  fs Utils.fs Minify.fs Main.fs

then get an error

C:\dev\websharper\src\build\WebSharper.Build\Main.fs(52,27): error FS0193: Type constraint mismatch. The type ↔    'a -> 'b    ↔is not compatible with type↔
 Framework    ↔The type ''a -> 'b' is not compatible with the type 'Framework'. See also C:\dev\websharper\src\build\WebSharper.Build\Main.fs(52,26)-(52,46). [
C:\dev\websharper\src\build\WebSharper.Build\WebSharper.Build.fsproj]

I look a look at Main.fs and the line

.WithFramework(fun fw -> fw.Net40)

doesn't seem to match what's currently in https://github.com/intellifactory/build/blob/master/IntelliFactory.Build/BuildTool.fs#L111

I commented it out as a test and was able to get further in build.

There's another issue with

.AddDependency(Config.PackageId, nuPkg.GetComputedVersion())

Should I be running something else? Or need to update something somewhere?

Tarmil commented 8 years ago

The GitHub repository for IF.Build is severely outdated, BitBucket is the reference repository. The method trying to be called is this one. I don't understand why it's failing to do so though.

cgravill commented 8 years ago

Looks like I had a stale version of the build tool. I wiped the repository and now the error is gone.

Thanks!