fsprojects / FSharp.Configuration

The FSharp.Configuration project contains type providers for the configuration of .NET projects.
http://fsprojects.github.io/FSharp.Configuration/
Other
114 stars 63 forks source link

WIP: use paket to pull in the TP SDK and update to latest #135

Closed baronfel closed 6 years ago

baronfel commented 6 years ago

I did the grunt-part of the new TP SDK update, and now am raising a flag to finish the job. The TP project builds, but the tests fail with errors like:

/Users/chet/code/oss/FSharp.Configuration/tests/FSharp.Configuration.Tests/unknown(1,1): error FS0073: internal error: One of your modules expects the type 'FSharp.Configuration.Tests.YamlTests.Lists' to be defined within the module being emitted.  You may be missing an input file

Which come from invoking the TP in the test project. I'm imagining I missed something related to Suppressing Relocation, so any tips here would be ideal.

sergey-tihon commented 6 years ago

Thank for you efforts @baronfel. I am nit quite sure ... but maybe Yaml TP emits code that use some types/functions not available in test project.

For example it may be some call from quotation to function defined in private module insite TP assembly, that it inaccessible from test project. According to error message, it may be use of some type defined in provate module. (this is just a guess)

baronfel commented 6 years ago

Still no resolution, but I updated to latest SDK again.

dsyme commented 6 years ago

@baronfel I updated the TPSDK and fixed one bug, getting a little further, see commit to your branch above

Error is now:

  2) FS3033: C:\GitHub\dsyme\FSharp.Configuration\tests\FSharp.Configuration.Tests\YamlProvider.Tests.fs(8,17): The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error: Type mismatch when building 'args': invalid parameter for a method or indexer property. Expected 'System.Collections.Generic.IEnumerable`1[System.String]', but received type 'System.Collections.Generic.IEnumerable`1[System.String]'.Parameter name: receivedType

It is likely this is a bug in the TPSDK, I will look soon

baronfel commented 6 years ago

Thanks @dsyme! I think I've seen that error message before, over on Fsharp.Data.TypeProviders as well.

baronfel commented 6 years ago

Is there some guidance available for when we should create ProvidedAssemblies? I see here now that we have one for the yamlConfig type, and then another made in the instanciation function for that type as well. What practical effect does that have? Those are two logically- and file-system-distinct assemblies from what I can tell.

dsyme commented 6 years ago

@baronfel There is only the one in the instantiation function for generative type provider. The other is GetExecutingAssembly

baronfel commented 6 years ago

You're correct, I slid right past that binding

dsyme commented 6 years ago

@baronfel @sergey-tihon I fixed the remaining issue. The problem we were hitting is now documented here: https://github.com/fsprojects/FSharp.TypeProviders.SDK/#explicit-construction-of-code-makegenerictype-makegenericmethod-and-uncheckedquotations

dsyme commented 6 years ago

I think we can merge this and consider republishing the TP

@baronfel You may have seen we're looking for maintainers for this repo - @dtchepak and @forki might be able to help a bit. Any interest? We're mainly just looking for someone to republish the packages after updates like this, though there have been a few incoming issues too, thanks

sergey-tihon commented 6 years ago

Thank you @baronfel ! PR is merged as released as v1.4.0

P.S. @baronfel we will be happy to see your name on maintainers list.

baronfel commented 6 years ago

I'd be interested in becoming a maintainer 👍 Just send a PR to the readme?

dsyme commented 6 years ago

@baronfel I'll add you to the readme, the github team and the nuget package

dsyme commented 6 years ago

@baronfel OK, added. You have to accept the nuget.org and github invitations.