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

Build doc using dotnet fsi 3.0.100 #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

thinkbeforecoding
Copy link
Contributor

This time, the documentation is run with dotnet fsi generate.fsx for real !

@thinkbeforecoding
Copy link
Contributor Author

@sergey-tihon @dsyme I you want to have a look.
There are some hacks in the generate.fsx to force loading FCS and Fable.Core... #r was not enough to make it load the assemblies. But forcing some code execution make it work...
Some assemblies were then missing in the Compiler context, and they're not automatically resolved. But passing them on the command line fix it.

@thinkbeforecoding
Copy link
Contributor Author

The build is failing on travis because I also have to instal a 2.2 version of netcore

@thinkbeforecoding
Copy link
Contributor Author

This was due to paket.bootstrapper running as netcoreapp2.1 ... so netcore runtime 2.1 or 2.2 had to be installed to run paket.

Now, everything is working as expected.

@thinkbeforecoding
Copy link
Contributor Author

@sergey-tihon @dsyme , I invited you to review since you can be interested to use it for other projects

Comment on lines +8 to +17
// HACK: force usage of Fsharp.Compiler.Services
// or the indirect reference from FSharp.Literate will fail to load
let dummy (pos: FSharp.Compiler.Range.pos) =
pos.Column
FSharp.Compiler.Range.mkPos 1 1 |> dummy

// HACK: Force usage of Fable.Core
// or the indirect reference from Fable.React will fail to load
typeof<Fable.Core.EraseAttribute>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wow! It really works but looks sad...
I think that we should report this as dotnet fsi issue to dotnet/fsharp repo.
What do you think @thinkbeforecoding ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and I was even not ale to make the one for FSharp.Compiler work with a typeof<...> I don't really know why...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really like to have @dsyme or @cartermp take on the issue...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of the issues around doc generation using dotnet fsi. Odd problem

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dsyme FCS and Fable.Core are inderect references for FSharp.Literate and Fable.React. Just adding a #r to the assembly at the begining is not enough to make it work, dotnet fsi complains when loading FSharp.Literate or Fable.React that indirect dependencies cannot be found.
The hack is to actively use code from FCS and Fable.Core in dummy expression to force the assembly to load. Then the rest of the code works as expected.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotnet/fsharp#7725

If this still doesn't work, can you point me to a repro and I will try to figure out what is needed.

Thanks

KEvin

@cartermp
Copy link

@thinkbeforecoding should this be updated to the 3.1.201 SDK?

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

Successfully merging this pull request may close these issues.

5 participants