ProjectScaffold icon indicating copy to clipboard operation
ProjectScaffold copied to clipboard

Can't generate docs on Linux or OSX

Open GabrieleCocco opened this issue 11 years ago • 22 comments

From a clear clone on OSX 10.9.3 + Mono 3.4.0, after having setup the project info through build.sh, I run build.sh ReleaseDoc and I get the following error:

fsharpi --define:RELEASE generate.fsx

/Users/gabriele/Projects/ProjectScaffold/docs/tools/generate.fsx(29,1): error FS0078: Unable to find the file 'NuGet.Core.dll' in any of /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.5 /Users/gabriele/Projects/ProjectScaffold/docs/tools/../../packages/FSharp.Formatting.2.4.1/lib/net40 /Users/gabriele/Projects/ProjectScaffold/docs/tools/../../packages/RazorEngine.3.3.0/lib/net40 /Users/gabriele/Projects/ProjectScaffold/docs/tools/../../packages/FSharp.Compiler.Service.0.0.36/lib/net40 /Users/gabriele/Projects/ProjectScaffold/docs/tools /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.0/

GabrieleCocco avatar Jul 18 '14 03:07 GabrieleCocco

I tried to fix the issue copying the suggested dll from within packages/FAKE/tools to docs/tools (simply cause the trace above says this folder is among the inspected ones). Doing this fixes the missing dll problem, but raises another one (please note I did not touch any src file, just did build.sh the first time to setup NeGet and repo info):

fsharpi --define:RELEASE generate.fsx Copying file: /Users/gabriele/Projects/ProjectScaffold/docs/output/img/logo.png Copying styles and scripts: /Users/gabriele/Projects/ProjectScaffold/docs/output/content/style.css Copying styles and scripts: /Users/gabriele/Projects/ProjectScaffold/docs/output/content/tips.js Generating 'index.html' System.Exception: Generating HTML failed. at FSharp.Literate.RazorRender.ProcessFile[IDictionary2](System.String source, Microsoft.FSharp.Core.FSharpOption1 properties) [0x00000] in :0 at FSharp.Literate.Templating.generateFile (System.String contentTag, IEnumerable1 parameters, Microsoft.FSharp.Core.FSharpOption1 templateOpt, System.String output, IEnumerable1 layoutRoots) [0x00000] in <filename unknown>:0 at FSharp.Literate.Templating.processFile (FSharp.Literate.LiterateDocument doc, System.String output, FSharp.Literate.ProcessingContext ctx) [0x00000] in <filename unknown>:0 at FSharp.Literate.Literate.ProcessScriptFile (System.String input, Microsoft.FSharp.Core.FSharpOption1 templateFile, Microsoft.FSharp.Core.FSharpOption1 output, Microsoft.FSharp.Core.FSharpOption1 format, Microsoft.FSharp.Core.FSharpOption1 formatAgent, Microsoft.FSharp.Core.FSharpOption1 prefix, Microsoft.FSharp.Core.FSharpOption1 compilerOptions, Microsoft.FSharp.Core.FSharpOption1 lineNumbers, Microsoft.FSharp.Core.FSharpOption1 references, Microsoft.FSharp.Core.FSharpOption1 fsiEvaluator, Microsoft.FSharp.Core.FSharpOption1 replacements, Microsoft.FSharp.Core.FSharpOption1 includeSource, Microsoft.FSharp.Core.FSharpOption1 layoutRoots) [0x00000] in <filename unknown>:0 at <StartupCode$FSharp-Literate>[email protected] (System.String file, System.String output) [0x00000] in <filename unknown>:0 at Microsoft.FSharp.Core.FSharpFunc2[System.String,System.String].InvokeFast[Unit](Microsoft.FSharp.Core.FSharpFunc2 func, System.String arg1, System.String arg2) [0x00000] in <filename unknown>:0 at <StartupCode$FSharp-Literate>.$Main.processDirectory@165 (Microsoft.FSharp.Core.FSharpOption1 format, Microsoft.FSharp.Core.FSharpFunc2 processScriptFile, Microsoft.FSharp.Core.FSharpFunc2 processMarkdown, System.String indir, System.String outdir) [0x00000] in :0 at FSharp.Literate.Literate.ProcessDirectory (System.String inputDirectory, Microsoft.FSharp.Core.FSharpOption1 templateFile, Microsoft.FSharp.Core.FSharpOption1 outputDirectory, Microsoft.FSharp.Core.FSharpOption1 format, Microsoft.FSharp.Core.FSharpOption1 formatAgent, Microsoft.FSharp.Core.FSharpOption1 prefix, Microsoft.FSharp.Core.FSharpOption1 compilerOptions, Microsoft.FSharp.Core.FSharpOption1 lineNumbers, Microsoft.FSharp.Core.FSharpOption1 references, Microsoft.FSharp.Core.FSharpOption1 fsiEvaluator, Microsoft.FSharp.Core.FSharpOption1 replacements, Microsoft.FSharp.Core.FSharpOption1 includeSource, Microsoft.FSharp.Core.FSharpOption1 layoutRoots) [0x00000] in :0 at FSI_0002.buildDocumentation () [0x00000] in :0 at <StartupCode$FSI_0002>.$FSI_0002.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

GabrieleCocco avatar Jul 18 '14 04:07 GabrieleCocco

Should be fixed by this direct commit: https://github.com/fsprojects/ProjectScaffold/commit/ccdd395f7ba0e9a79ccffb029dffe57d80c6209c

fsgit avatar Jul 18 '14 07:07 fsgit

Reopened and renamed because of the problem with generating docs

fsgit avatar Jul 18 '14 08:07 fsgit

The generated file is:

// ------------------------------------------------------------------------------
//  <autogenerated>
//      This code was generated by a tool.
//      Mono Runtime Version: 4.0.30319.17020
// 
//      Changes to this file may cause incorrect behavior and will be lost if 
//      the code is regenerated.
//  </autogenerated>
// ------------------------------------------------------------------------------

namespace CompiledRazorTemplates.Dynamic {
    using System;
    using System.Collections.Generic;
    using System.Linq;


    public class bdfebedcbe : FSharp.Literate.DocPageTemplateBase<System.Object> {

#line hidden

        public bdfebedcbe() {
        }

        public override void Execute() {

  Layout = "template";
  Title = Properties["page-title"];
  Description = Properties["project-summary"];

WriteLiteral("\r\n");

Write(Properties["document"]);

WriteLiteral("\r\n");

Write(Properties["tooltips"]);

        }
    }
}

caindy avatar Jul 31 '14 19:07 caindy

FWIW, neither the output above nor the output listed in #68 contain any specific parsing errors from the error handling code in FSharp.Formatting

caindy avatar Jul 31 '14 19:07 caindy

@tpetricek - It would be great if the scaffolding (or FSharp.Formatting) could drop the dependency on Razor. Is Razor really doing anything particularly complicated here? Could we have a fully cross-platform F#-only FSharp.Formatting?

dsyme avatar Aug 01 '14 11:08 dsyme

It's not that complicated, but we would need a good OSS templating tool. Ideally it would be a separate project and pluggable into asp.NET as well. I read about ideas of a Fazor project but didn't see it happen. Maybe you can ask on Twitter. On Aug 1, 2014 1:28 PM, "Don Syme" [email protected] wrote:

@tpetricek https://github.com/tpetricek - It would be great if the scaffolding (or FSharp.Formatting) could drop the dependency on Razor. Is Razor really doing anything particularly complicated here? Could we have a fully cross-platform F#-only FSharp.Formatting?

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/ProjectScaffold/issues/65#issuecomment-50874322 .

forki avatar Aug 01 '14 11:08 forki

I think @7sharp9 knows some things about fixing the Razor engine on Mono.

I'd love to drop it too. We just need some pretty basic OSS templating tool instead. I would welcome any pull requests to F# Formatting that replace Razor - either with another dependency or even with a simple templating tool written in F# instead.

Though it should probably not be completely basic - the templates currently do some non-trivial things. We could move the grouping into the F# code itself, but it still needs some composition, looping and if statements.

tpetricek avatar Aug 06 '14 12:08 tpetricek

I made a PR that fixed Razor, not sure if it made it to a nuget release of Razor though. It was some time ago ...

7sharp9 avatar Aug 06 '14 12:08 7sharp9

I started implementing F# support in Razor years ago, but I'm sure Razor has changed substantially since then.

dahlbyk avatar Aug 06 '14 12:08 dahlbyk

DotLiquid might be a good candidate. It is a .NET implementation of Liquid, which is the default template engine for Jekyll (used on Github pages). I've not tried it on Mono.

bentayloruk avatar Aug 06 '14 12:08 bentayloruk

Incidentally, my fix was here in the RazorEngine: https://github.com/Antaris/RazorEngine/commit/2098fb0264839b09601f5b2bf335eafa567d352e

When I built all from source I could use formatting fine, some of the fsx scripts were troublesome though. Ive never built the scaffolding, so it might not be relevant ...

7sharp9 avatar Aug 06 '14 12:08 7sharp9

The other problem with Razor is that the newer versions require .NET 4.5, while F# Formatting can work fine with just .NET 4.0. So updating to newer version of Razor also means updating to .NET 4.5 (might not be a big deal though). F# support for Razor sounds nice, but it probably does not fix the problem here.

@7sharp9 Thanks for the clarification! We could try updating the package.

tpetricek avatar Aug 06 '14 13:08 tpetricek

I was going to start using ProjectScaffold soon, as it doesn't work out of the box on osx its dissapointing :-(

7sharp9 avatar Aug 06 '14 13:08 7sharp9

@tpetricek I rebuilt everything from scratch so I probably made everything .Net 4.5, I cant actually remember now.

7sharp9 avatar Aug 06 '14 13:08 7sharp9

@7sharp9 It is disappointing indeed! That's why we need help from some mono experts ;-)

tpetricek avatar Aug 06 '14 13:08 tpetricek

@7sharp9 Are you having a different issue than the one at the start of this thread? If so, please create an new issue. I'm in the process of moving my primary dev stack over to OS X. So I intend to tackle this issue (maybe a few others) in the very near future.

pblasucci avatar Aug 06 '14 15:08 pblasucci

@pblasucci I had issues with Razor ages ago, thats what @tpetricek was referring to.

I have the same issue thats described here just checked.

7sharp9 avatar Aug 06 '14 15:08 7sharp9

Any updates on this? Where should we put some effort together to get this working?

icorderi avatar Aug 22 '14 18:08 icorderi

The best way to get this started would be to start a discussion on the F# Formatting project page: http://github.com/tpetricek/FSharp.Formatting/

I think writing a custom system might be more work than one would expect, but if there is something we could use instead of Razor, that would be fantastic...

tpetricek avatar Aug 22 '14 22:08 tpetricek

Ok, created Issue #188 over at FSharp.Formatting.

icorderi avatar Aug 23 '14 02:08 icorderi

Please try with #135.

matthid avatar Jan 20 '15 12:01 matthid