You are not logged in.

#1 2018-08-29 09:41:24

flakedave
Member
Registered: 2010-06-23
Posts: 21

[SOLVED] Woes building F# projects using ionide and VS Code...

Hi Archers,

I am using Visual Studio Code to get started with simple F# examples, and would need some help.

I installed ionide-FAKE and ionide-fsharp, and created a new project via the VS Code Command Palette (F#: new project > console application).

When building in VS code via the "run script" button found in the window of build.fsx I get:

/home/n00b/Sandbox/ftest/build.fsx(15,21): warning FS0044: This construct is deprecated. Please use nuget 'Fake.IO.FileSystem' and Fake.IO.Globbing.Operators instead



/home/n00b/Sandbox/ftest/build.fsx(24,8): warning FS0044: This construct is deprecated. FAKE0001 Use the Fake.Core.Process module instead



/home/n00b/Sandbox/ftest/build.fsx(36,9): warning FS0044: This construct is deprecated. FAKE0001 Use the Fake.Core.Process module instead



/home/n00b/Sandbox/ftest/build.fsx(46,1): warning FS0044: This construct is deprecated. Use Fake.Core.Target instead (FAKE0001 - package: Fake.Core.Target - member: Fake.Core.Target.Create)



/home/n00b/Sandbox/ftest/build.fsx(47,5): warning FS0044: This construct is deprecated. Use Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem - member: Fake.IO.Shell.CleanDirs)



/home/n00b/Sandbox/ftest/build.fsx(50,1): warning FS0044: This construct is deprecated. Use Fake.Core.Target instead (FAKE0001 - package: Fake.Core.Target - member: Fake.Core.Target.Create)



/home/n00b/Sandbox/ftest/build.fsx(51,22): warning FS0044: This construct is deprecated. Please add 'open Fake.DotNet' and use 'DotNet.*' instead, see https://fake.build/dotnet-dotnet.html for an example (the fake 5 module is called Fake.DotNet.Cli)



/home/n00b/Sandbox/ftest/build.fsx(51,22): warning FS0044: This construct is deprecated. Please add 'open Fake.DotNet' and use 'DotNet.*' instead, see https://fake.build/dotnet-dotnet.html for an example (the fake 5 module is called Fake.DotNet.Cli)



/home/n00b/Sandbox/ftest/build.fsx(54,1): warning FS0044: This construct is deprecated. Use Fake.Core.Target instead (FAKE0001 - package: Fake.Core.Target - member: Fake.Core.Target.Create)



/home/n00b/Sandbox/ftest/build.fsx(62,1): warning FS0044: This construct is deprecated. Use Fake.Core.Target instead (FAKE0001 - package: Fake.Core.Target - member: Fake.Core.Target.Create)



/home/n00b/Sandbox/ftest/build.fsx(77,3): warning FS0044: This construct is deprecated. Use Fake.Core.Target instead (FAKE0001 - package: Fake.Core.Target - member: Fake.Core.TargetOperators.(==>)



/home/n00b/Sandbox/ftest/build.fsx(76,3): warning FS0044: This construct is deprecated. Use Fake.Core.Target instead (FAKE0001 - package: Fake.Core.Target - member: Fake.Core.TargetOperators.(==>)



/home/n00b/Sandbox/ftest/build.fsx(75,3): warning FS0044: This construct is deprecated. Use Fake.Core.Target instead (FAKE0001 - package: Fake.Core.Target - member: Fake.Core.TargetOperators.(==>)


/home/n00b/Sandbox/ftest/build.fsx(79,1): warning FS0044: This construct is deprecated. Use Fake.Core.Target instead (FAKE0001 - package: Fake.Core.Target - member: Fake.Core.Target.runOrDefault)

Building project with version: LocalBuild
Shortened DependencyGraph for Target Build:
<== Build
   <== Restore
      <== InstallDotNetCLI
         <== Clean

The running order is:
  - Clean
  - InstallDotNetCLI
  - Restore
  - Build
Running build with 1 worker
Starting Target: Clean
Creating /home/n00b/Sandbox/ftest/build/
Finished Target: Clean
Starting Target: InstallDotNetCLI (==> Clean)
dotnet --info
/home/n00b/.local/share/dotnetcore/dotnet --info
cmd 2.0.2 already installed in LocalApplicationData
Finished Target: InstallDotNetCLI
Starting Target: Restore (==> InstallDotNetCLI)
/home/n00b/.local/share/dotnetcore/dotnet restore
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.InvalidOperationException: The terminfo database is invalid.
   at System.TermInfo.Database..ctor(String term, Byte[] data)
   at System.TermInfo.Database.ReadDatabase(String term, String directoryPath)
   at System.TermInfo.Database.ReadDatabase(String term)
   at System.TermInfo.Database.ReadActiveDatabase()
   at System.ConsolePal.TerminalFormatStrings.<>c.<.cctor>b__27_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.ConsolePal.EnsureInitializedCore()
   at System.ConsolePal.ControlCHandlerRegistrar.Register()
   at System.Console.add_CancelKeyPress(ConsoleCancelEventHandler value)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)

Unhandled Exception: System.InvalidOperationException: The terminfo database is invalid.
   at System.TermInfo.Database..ctor(String term, Byte[] data)
   at System.TermInfo.Database.ReadDatabase(String term, String directoryPath)
   at System.TermInfo.Database.ReadDatabase(String term)
   at System.TermInfo.Database.ReadActiveDatabase()
   at System.ConsolePal.TerminalFormatStrings.<>c.<.cctor>b__27_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.ConsolePal.EnsureInitializedCore()
   at System.ConsolePal.ControlCHandlerRegistrar.Register()
   at System.Console.add_CancelKeyPress(ConsoleCancelEventHandler value)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
Running build failed.
Error:
System.Exception: dotnet restore failed
  at Microsoft.FSharp.Core.PrintfModule+PrintFormatToStringThenFail@1645[TResult].Invoke (System.String message) [0x00000] in <5b229b8fdff9fae1a74503838f9b225b>:0
  at FSI_0001.runDotnet (System.String workingDir, System.String args) [0x00042] in <8388f607f51546269890b35ef5f8017a>:0
  at FSI_0001+clo@56-4.Invoke (System.String p) [0x00009] in <8388f607f51546269890b35ef5f8017a>:0
  at Microsoft.FSharp.Collections.SeqModule.Iterate[T] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] action, System.Collections.Generic.IEnumerable`1[T] source) [0x0002c] in <5b229b8fdff9fae1a74503838f9b225b>:0
  at FSI_0001+clo@54-3.Invoke (Microsoft.FSharp.Core.Unit _arg3) [0x0000a] in <8388f607f51546269890b35ef5f8017a>:0
  at Fake.TargetHelper.runSingleTarget (Fake.TargetHelper+TargetTemplate`1[a] target) [0x00049] in <5b5f575eccf1c534a74503835e575f5b>:0

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target             Duration
------             --------
Clean              00:00:00.0018162
InstallDotNetCLI   00:00:00.4530963
Restore            Failure
Total:             00:00:01.2090829
---------------------------------------------------------------------
Status:            Failure
---------------------------------------------------------------------
---------------------------------------------------------------------
  1) System.Exception: dotnet restore failed
  at Microsoft.FSharp.Core.PrintfModule+PrintFormatToStringThenFail@1645[TResult].Invoke (System.String message) [0x00000] in <5b229b8fdff9fae1a74503838f9b225b>:0
  at FSI_0001.runDotnet (System.String workingDir, System.String args) [0x00042] in <8388f607f51546269890b35ef5f8017a>:0
  at FSI_0001+clo@56-4.Invoke (System.String p) [0x00009] in <8388f607f51546269890b35ef5f8017a>:0
  at Microsoft.FSharp.Collections.SeqModule.Iterate[T] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] action, System.Collections.Generic.IEnumerable`1[T] source) [0x0002c] in <5b229b8fdff9fae1a74503838f9b225b>:0
  at FSI_0001+clo@54-3.Invoke (Microsoft.FSharp.Core.Unit _arg3) [0x0000a] in <8388f607f51546269890b35ef5f8017a>:0
  at Fake.TargetHelper.runSingleTarget (Fake.TargetHelper+TargetTemplate`1[a] target) [0x00049] in <5b5f575eccf1c534a74503835e575f5b>:0
---------------------------------------------------------------------
Press enter to close script...

I have Ionide FAKE 1.2.3 and Ionide-fsharp 3.25.3 and in addition

$ pacman -Q | grep dotnet
dotnet-host 2.1.3+401-1
dotnet-runtime 2.1.3+401-1
dotnet-sdk 2.1.3+401-1

$ pacman -Q | grep ncurses
lib32-ncurses 6.1-2
ncurses 6.1-3

and I tried reviewing https://bugs.archlinux.org/task/57260 and https://github.com/dotnet/corefx/issues/26966, but the

TERM=xterm dotnet build 

workaround in .bashrc didn't work for me.

Also, running

./build.sh

generated by ionide in the project directory gave me an error like that above.

I am probably making some very dumb mistake here... what is it?

Last edited by flakedave (2018-09-08 14:57:12)

Offline

#2 2018-09-08 14:56:49

flakedave
Member
Registered: 2010-06-23
Posts: 21

Re: [SOLVED] Woes building F# projects using ionide and VS Code...

Using

TERM=xterm

solved.

Offline

Board footer

Powered by FluxBB