Skip to content

Build failing on OS X for new project created using Project Scaffold #205

Open

Description

@edhzsz

I found this while updating my paket dependencies in my project FReD and I am able to reproduce in a newly created project.

I haven't tested on Windows yet and TravisCI was able to build without problems:

It may be related to fsprojects/FSharp.Formatting#328

Environment

OSX 10.10.4

$ mono --version
Mono JIT compiler version 4.0.3 ((detached/d6946b4 Wed Jul 29 14:46:23 EDT 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: yes(3.6.0svn-mono-(detached/a173357)
GC: sgen

Updated today to the latest stable version of Xamarin Studio

$ fsharpc
F# Compiler for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License

packet.dependencies

source https://nuget.org/api/v2

nuget FSharp.Formatting
nuget NUnit
nuget NUnit.Runners
nuget FAKE
nuget SourceLink.Fake
nuget FSharp.Data

github fsharp/FAKE modules/Octokit/Octokit.fsx

Steps to reproduce

  • Clone ProjectScaffold repository
  • run build.sh
  • Fill in the project name and answer (or leave blank) all other questions

Expected behaviour

  • A new project should be scaffolded and configured
  • Build should complete successfully

Actual Behaviour

  • A new project is generated and configured
  • An error is reported on first build:
Generating '/Users/edhzsz/random_github_repos/testPS/ProjectScaffold/docs/tools/../content/index.html'
FSharp.Formatting Critical: 0 : 
Processing the file 'docpage' failed
Source written to: '/var/folders/14/k9w9t10j2s1dxc8yrpjxrr040000gn/T/tmp221b3e9a.tmp.cs'
Compilation errors:
 - warning: (0, 0) Assuming assembly reference `FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' matches assembly `FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. You may need to supply runtime policy
 - error: (0, 0) Assembly `FakeLib, Version=4.1.1.0, Culture=neutral, PublicKeyToken=null' references `FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version number than imported assembly `FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

FAKE is referencing FSharp.Code 4.4 since FAKE 4.1.0

Workaround

Modify packet.dependencies and use FAKE version 4.0.0

nuget FAKE = 4.0.0

Build is successful with FAKE 4.0.0

Activity

  1. edhzsz commented on Oct 10, 2015

    @edhzsz
    Author

    I am still able to reproduce the issue after updating everything to the latests.

    Updated Environment

    OSX 10.11

    $ mono --version
    Mono JIT compiler version 4.0.4 ((detached/d481017 Mon Sep 28 17:32:19 EDT 2015)
    Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           normal
        SIGSEGV:       altstack
        Notification:  kqueue
        Architecture:  x86
        Disabled:      none
        Misc:          softdebug 
        LLVM:          yes(3.6.0svn-mono-(detached/a173357)
        GC:            sgen
    

    Updated today to the latest stable version of Xamarin Studio

    $ fsharpc
    F# Compiler for F# 3.1 (Open Source Edition)
    Freely distributed under the Apache 2.0 Open Source License
    

    packet.dependencies

    source https://nuget.org/api/v2
    nuget FSharp.Formatting
    nuget NUnit
    nuget NUnit.Runners
    nuget FAKE
    nuget SourceLink.Fake
    nuget FSharp.Data
    github fsharp/FAKE modules/Octokit/Octokit.fsx
    

    packet.lock

    NUGET
      remote: https://nuget.org/api/v2
      specs:
        FAKE (4.0.0)
        FSharp.Compiler.Service (0.0.90)
        FSharp.Data (2.2.5)
          Zlib.Portable (>= 1.10.0) - framework: portable-net40+sl50+wp80+win80
        FSharp.Formatting (2.11.0)
          FSharp.Compiler.Service (>= 0.0.90 <= 1.3)
          FSharpVSPowerTools.Core (1.9.0)
        FSharpVSPowerTools.Core (1.9.0)
          FSharp.Compiler.Service (>= 0.0.90)
        Microsoft.Bcl (1.1.10)
          Microsoft.Bcl.Build (>= 1.0.14)
        Microsoft.Bcl.Build (1.0.21) - import_targets: false
        Microsoft.Net.Http (2.2.29)
          Microsoft.Bcl (>= 1.1.10)
          Microsoft.Bcl.Build (>= 1.0.14)
        NUnit (2.6.4)
        NUnit.Runners (2.6.4)
        Octokit (0.16.0)
          Microsoft.Net.Http
        SourceLink.Fake (1.1.0)
        Zlib.Portable (1.11.0) - framework: portable-net40+sl50+wp80+win80
    GITHUB
      remote: fsharp/FAKE
      specs:
        modules/Octokit/Octokit.fsx (7543f29800c1245a04f96b5f1be063b0568fd5d6)
          Octokit
    

    Updating packages

    $ mono ./.paket/paket.exe update
    Paket version 2.11.1.0
    Resolving packages for group Main:
     - FAKE 4.5.3
     - FSharp.Data 2.2.5
     - Zlib.Portable 1.11.0
     - FSharp.Formatting 2.11.0
     - FSharp.Compiler.Service 0.0.90
     - FSharpVSPowerTools.Core is pinned to 1.9.0
     - NUnit 2.6.4
     - NUnit.Runners 2.6.4
     - Octokit 0.16.0
     - Microsoft.Net.Http 2.2.29
     - Microsoft.Bcl 1.1.10
     - Microsoft.Bcl.Build 1.0.21
     - SourceLink.Fake 1.1.0
    Locked version resolution written to /Users/edhzsz/projects/fsharp/FReD/paket.lock
    15 seconds - ready.
    

    Building

    $ ./build.sh 
    No version specified. Downloading latest stable.
    Paket.exe 2.11.1.0 is up to date.
    Paket version 2.11.1.0
    0 seconds - ready.
    Building project with version: LocalBuild
    ...
    Generating '/Users/edhzsz/projects/fsharp/FReD/docs/tools/../content/index.html'
    FSharp.Formatting Critical: 0 : 
    Processing the file 'docpage' failed
    Source written to: '/var/folders/14/k9w9t10j2s1dxc8yrpjxrr040000gn/T/tmp60955186.tmp.cs'
    Compilation errors:
     - warning: (0, 0) Assuming assembly reference `FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' matches assembly `FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. You may need to supply runtime policy
     - error: (0, 0) Assembly `FakeLib, Version=4.5.3.0, Culture=neutral, PublicKeyToken=null' references `FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version number than imported assembly `FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    System.Exception: Generating HTML failed.
      at FSharp.Literate.RazorRender.handleCompile[String] (System.String source, Microsoft.FSharp.Core.FSharpFunc`2 f) [0x00000] in :0 
      at FSharp.Literate.RazorRender.ProcessFileModel[IDictionary`2] (System.Type modelType, System.Object model, Microsoft.FSharp.Core.FSharpOption`1 properties) [0x00000] in :0 
      at FSharp.Literate.Templating.generateFile (Microsoft.FSharp.Core.FSharpOption`1 references, System.String contentTag, IEnumerable`1 parameters, Microsoft.FSharp.Core.FSharpOption`1 templateOpt, System.String output, IEnumerable`1 layoutRoots) [0x00000] in :0 
      at FSharp.Literate.Templating.processFile (Microsoft.FSharp.Core.FSharpOption`1 references, FSharp.Literate.LiterateDocument doc, System.String output, FSharp.Literate.ProcessingContext ctx) [0x00000] in :0 
      at FSharp.Literate.Literate.ProcessScriptFile (System.String input, Microsoft.FSharp.Core.FSharpOption`1 templateFile, Microsoft.FSharp.Core.FSharpOption`1 output, Microsoft.FSharp.Core.FSharpOption`1 format, Microsoft.FSharp.Core.FSharpOption`1 formatAgent, Microsoft.FSharp.Core.FSharpOption`1 prefix, Microsoft.FSharp.Core.FSharpOption`1 compilerOptions, Microsoft.FSharp.Core.FSharpOption`1 lineNumbers, Microsoft.FSharp.Core.FSharpOption`1 references, Microsoft.FSharp.Core.FSharpOption`1 fsiEvaluator, Microsoft.FSharp.Core.FSharpOption`1 replacements, Microsoft.FSharp.Core.FSharpOption`1 includeSource, Microsoft.FSharp.Core.FSharpOption`1 layoutRoots, Microsoft.FSharp.Core.FSharpOption`1 generateAnchors, Microsoft.FSharp.Core.FSharpOption`1 assemblyReferences, Microsoft.FSharp.Core.FSharpOption`1 customizeDocument) [0x00000] in :0 
      at [email protected] (System.String file, System.String output) [0x00000] in :0 
      at Microsoft.FSharp.Core.FSharpFunc`2[System.String,System.String].InvokeFast[Unit] (Microsoft.FSharp.Core.FSharpFunc`2 func, System.String arg1, System.String arg2) [0x00000] in :0 
      at .$Main.processDirectory@199 (Microsoft.FSharp.Core.FSharpOption`1 format, Boolean processRecursive, Microsoft.FSharp.Core.FSharpFunc`2 processScriptFile, Microsoft.FSharp.Core.FSharpFunc`2 processMarkdown, System.String indir, System.String outdir) [0x00000] in :0 
      at FSharp.Literate.Literate.ProcessDirectory (System.String inputDirectory, Microsoft.FSharp.Core.FSharpOption`1 templateFile, Microsoft.FSharp.Core.FSharpOption`1 outputDirectory, Microsoft.FSharp.Core.FSharpOption`1 format, Microsoft.FSharp.Core.FSharpOption`1 formatAgent, Microsoft.FSharp.Core.FSharpOption`1 prefix, Microsoft.FSharp.Core.FSharpOption`1 compilerOptions, Microsoft.FSharp.Core.FSharpOption`1 lineNumbers, Microsoft.FSharp.Core.FSharpOption`1 references, Microsoft.FSharp.Core.FSharpOption`1 fsiEvaluator, Microsoft.FSharp.Core.FSharpOption`1 replacements, Microsoft.FSharp.Core.FSharpOption`1 includeSource, Microsoft.FSharp.Core.FSharpOption`1 layoutRoots, Microsoft.FSharp.Core.FSharpOption`1 generateAnchors, Microsoft.FSharp.Core.FSharpOption`1 assemblyReferences, Microsoft.FSharp.Core.FSharpOption`1 processRecursive, Microsoft.FSharp.Core.FSharpOption`1 customizeDocument) [0x00000] in :0 
      at FSI_0003.buildDocumentation () [0x00000] in :0 
      at .$FSI_0003.main@ () [0x00000] in :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, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 
    Stopped due to error
    Running build failed.
    Error:
    System.Exception: generating help documentation failed
      at FSI_0001.Build.generateHelp' (Boolean fail, Boolean debug) [0x00000] in :0 
      at [email protected] (Microsoft.FSharp.Core.Unit _arg1) [0x00000] in :0 
      at Fake.TargetHelper+targetFromTemplate@195[Microsoft.FSharp.Core.Unit].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in :0 
      at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) [0x00000] in :0
    ... 
    

    With FAKE version 4.0.0 the build is successful.

  2. matthid commented on Nov 22, 2015

    @matthid
    Member

    fixed in #217.
    Problem is FakeLib references F#4 while we are running with F#3.1. RazorEngine uses the loaded assemblies as references for compiling templates and the C# compiler doesn't like the missmatch...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions