Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate docs on Linux or OSX #65

Open
GabrieleCocco opened this issue Jul 18, 2014 · 22 comments
Open

Can't generate docs on Linux or OSX #65

GabrieleCocco opened this issue Jul 18, 2014 · 22 comments

Comments

@GabrieleCocco
Copy link

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
Copy link
Author

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>.$Main+processScriptFile@152.Invoke (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

@fsgit
Copy link
Contributor

fsgit commented Jul 18, 2014

Should be fixed by this direct commit: ccdd395

@fsgit fsgit closed this as completed Jul 18, 2014
@fsgit fsgit reopened this Jul 18, 2014
@fsgit
Copy link
Contributor

fsgit commented Jul 18, 2014

Reopened and renamed because of the problem with generating docs

@fsgit fsgit changed the title Unable to find NuGet.Core.dll Can't generate docs on Linux or OSX Jul 18, 2014
@caindy
Copy link
Contributor

caindy commented Jul 31, 2014

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
Copy link
Contributor

caindy commented Jul 31, 2014

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

@dsyme
Copy link
Contributor

dsyme commented Aug 1, 2014

@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?

@forki
Copy link
Member

forki commented Aug 1, 2014

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" notifications@github.com 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
#65 (comment)
.

@tpetricek
Copy link
Member

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.

@7sharp9
Copy link
Member

7sharp9 commented Aug 6, 2014

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 ...

@dahlbyk
Copy link

dahlbyk commented Aug 6, 2014

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

@bentayloruk
Copy link

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.

@7sharp9
Copy link
Member

7sharp9 commented Aug 6, 2014

Incidentally, my fix was here in the RazorEngine: Antaris/RazorEngine@2098fb0

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 ...

@tpetricek
Copy link
Member

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.

@7sharp9
Copy link
Member

7sharp9 commented Aug 6, 2014

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

@7sharp9
Copy link
Member

7sharp9 commented Aug 6, 2014

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

@tpetricek
Copy link
Member

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

@pblasucci
Copy link
Collaborator

@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.

@7sharp9
Copy link
Member

7sharp9 commented Aug 6, 2014

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

I have the same issue thats described here just checked.

@icorderi
Copy link

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

@tpetricek
Copy link
Member

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...

@icorderi
Copy link

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

@matthid
Copy link
Member

matthid commented Jan 20, 2015

Please try with #135.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests