fsprojects/IfSharp

#load "Paket.fsx" fails while parsing the lock file

afairy opened this issue · 3 comments

Description

#load "Paket.fsx" fails while parsing the paket.lock file

Repro steps

I installed mono and fsharp on ubuntu 17.04 (using the xenial packages), following the Readme.
Then I created an F# notebook, and tested the Screen examples in the readme. When I reached the Integrated NuGet part and evaluated #load "Paket.fsx" an error was shown

Expected behavior

#load "Paket.fsx" doesn't produce an error message

Actual behavior

Expression evaluation failed: Error during parsing of /home/lo/fsharp/ifsharp/paket.lock.
Message: unknown lock file format RESTRICTION: == net451
ExceptionError during parsing of /home/lo/fsharp/ifsharp/paket.lock.
Message: unknown lock file format RESTRICTION: == net451
  at <StartupCode$Paket-Core>.$LockFile+Parse@696-26.Invoke (System.String message) [0x00001] in <593d0e63a970bee8a7450383630e3d59>:0 
  at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () [0x00012] in <5939249c904cf4daa74503839c243959>:0 
  at Microsoft.FSharp.Core.PrintfImpl+Final3@247[TState,TResidue,TResult,A,B,C].Invoke (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] env, A a, B b, C c) [0x0007d] in <5939249c904cf4daa74503839c243959>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3301-2[T2,T3,T4,TResult,T1].Invoke (T2 u, T3 v, T4 w) [0x00001] in <5939249c904cf4daa74503839c243959>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3266-1[T2,T3,TResult,T1].Invoke (T2 u, T3 v) [0x00001] in <5939249c904cf4daa74503839c243959>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) [0x00001] in <5939249c904cf4daa74503839c243959>:0 
  at <StartupCode$Paket-Core>.$LockFile+Parse@696-29.Invoke (System.String arg30) [0x00001] in <593d0e63a970bee8a7450383630e3d59>:0 
  at Microsoft.FSharp.Core.FSharpFunc`2[T,TResult].InvokeFast[V] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] func, T arg1, TResult arg2) [0x0001f] in <5939249c904cf4daa74503839c243959>:0 
  at Microsoft.FSharp.Core.FSharpFunc`2[T,TResult].InvokeFast[V,W] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] func, T arg1, TResult arg2, V arg3) [0x0003d] in <5939249c904cf4daa74503839c243959>:0 
  at Paket.LockFile.Parse (System.String lockFileName, System.String[] lines) [0x00054] in <593d0e63a970bee8a7450383630e3d59>:0 
  at Paket.RestoreProcess.Restore (System.String dependenciesFileName, Microsoft.FSharp.Core.FSharpOption`1[T] projectFile, System.Boolean force, Microsoft.FSharp.Core.FSharpOption`1[T] group, Microsoft.FSharp.Collections.FSharpList`1[T] referencesFileNames, System.Boolean ignoreChecks, System.Boolean failOnChecks) [0x00091] in <593d0e63a970bee8a7450383630e3d59>:0 
  at <StartupCode$Paket-Core>.$PublicAPI+Restore@282-10.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00052] in <593d0e63a970bee8a7450383630e3d59>:0 
  at Paket.Utils.RunInLockedAccessMode[a] (System.String rootFolder, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] action) [0x00084] in <593d0e63a970bee8a7450383630e3d59>:0 
  at Paket.Dependencies.Restore (System.Boolean force, Microsoft.FSharp.Core.FSharpOption`1[T] group, Microsoft.FSharp.Collections.FSharpList`1[T] files, System.Boolean touchAffectedRefs, System.Boolean ignoreChecks, System.Boolean failOnChecks) [0x0001b] in <593d0e63a970bee8a7450383630e3d59>:0 
  at Paket.Dependencies.Restore (System.Boolean ignoreChecks) [0x00009] in <593d0e63a970bee8a7450383630e3d59>:0 
  at <StartupCode$FSI_0026>.$FSI_0026_Paket$fsx.main@ () [0x0006d] in <dd7f24248da547e6a2b292b87af79033>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <a07d6bf484a54da2861691df910339b1>:0 

Related information

  • Ubuntu 17.04 (Zesty)
  • Mono JIT compiler version 5.0.1.1 (2017-02/5077205 Thu May 25 09:19:18 UTC 2017)
  • The paket.lock file looks like this:
GENERATE-LOAD-SCRIPTS: ON
RESTRICTION: == net451
NUGET
  remote: https://www.nuget.org/api/v2
    FSharp.Core (4.2.1)

As a newcomer to .net I don't know if this is caused by the mono version (5.0.1 seems to be supported on mac at least) or the fact that the mono paket.exe install step seems to have installed an fsharp version (4.2.1) different from the ubuntu package (4.1.9).

Any ideas?

How are you installing? Source, beta1, or beta2? I have beta2 and source working on MacOS with Mono 5.0.1.1 but haven't tried Ubuntu (but others have it working https://github.com/Microsoft/AzureNotebooks/issues/115).

Did you use the mono paket.bootstrapper.exe? That's in the current install instructions but may cause a mismatch with the Paket.Core.dll we ship. Maybe try something closer to the Mac instructions on a clean copy as an experiment?

I followed the Mac instructions, no more error! I had used beta2 previously also.

The Linux instructions also confused me with the directory: they say run from install directory ~/opt, but ~/opt/ifsharp is the actual install directory, so I ran it from the ifsharp directory, which I now realize might have overwritten the paket.lock file, which already exists.

Great, glad it's working now. Thanks for reporting, it prompted us to update the docs #152 with thanks to @npmurphy. We previously had more messy workarounds but have been able to improve the kernel and adjust to Jupyter changes with beta2.