fsprojects / FSharp.TypeProviders.SDK

The SDK for creating F# type providers
https://fsprojects.github.io/FSharp.TypeProviders.SDK/
MIT License
298 stars 94 forks source link

BasicProvider.Tests fails to compile #216

Closed sgtz closed 6 years ago

sgtz commented 6 years ago

Description

"BasicProvider.Tests" fails to compile

Repro steps

Please provide the steps required to reproduce the problem

BasicProviderTests.fsproj has

BasicProvider.fsproj has post build steps such as

because of this, [<assembly:CompilerServices.TypeProviderAssembly("BasicProvider.DesignTime.dll")>] in BasicProvider.fsproj is no longer sufficient to locate the BasicProvider.DesignTime.dll.

Expected behavior

The test project should build correctly.

Actual behavior

Build fails.

Known workarounds

Fix A: change copy destination

edit the post-build copy step in BasicProviderTests.fsproj to be

This defeats the purpose of the multi-platform targeting changes of late.

Fix B: change fsc library includes in compiler command line parameters. This fails, but it seems to be a step in the right direction

   --lib:./typeproviders/fsharp41/netstandard2.0

error:

.../FSharp.TypeProviders.SDK/examples/BasicProvider.Tests/FSC: Warning FS3005: Referenced assembly '/.../FSharp.TypeProviders.SDK/examples/BasicProvider/bin/Debug/netstandard2.0/BasicProvider.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found (FS3005) (BasicProvider.Tests)

possibly B is a step closer.

Suggestion:

Allow CompilerServices.TypeProviderAssembly to include relative paths, or, allow the --lib: the mechanism to work correctly with type providers, in concert with this TypeProviderAssembly attribute.

Related information

  • Operating system: OSX

  • Branch n/a

  • .NET Runtime, CoreCLR or Mono Version

mono --version

Mono JIT compiler version 5.10.1.25 (2017-12/de7bff29942 Thu Mar 29 21:18:02 EDT 2018) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: normal SIGSEGV: altstack Notification: kqueue Architecture: amd64 Disabled: none Misc: softdebug Interpreter: yes LLVM: yes(3.6.0svn-mono-master/8b1520c8aae) GC: sgen (concurrent by default)

  • Performance information, links to performance testing scripts n/a
sgtz commented 6 years ago

:-/ -- added conditionality to postBuild copy based on the build target. This was inclusion included in the pull request.