ctaggart / SourceLink

Source Code On Demand
MIT License
356 stars 55 forks source link

help enable SourceLink for Giraffe #367

Closed ctaggart closed 5 years ago

ctaggart commented 6 years ago

The AppVeyor build failed with:

C:\projects\giraffe\src\Giraffe\obj\Release\net461\Giraffe.AssemblyInfo.fs(15,69): error FS2003: The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '2.0.1+911276555477b7cab2e4fe9a8e1105e32f96ec61', but this value is invalid and has been ignored [C:\projects\giraffe\src\Giraffe\Giraffe.fsproj] https://ci.appveyor.com/project/ctaggart/giraffe/build/2.0.1-1

Usually that is a warning and not a failure. It shouldn't even be a warning and that was fixed on July 18th:

Support for arbitrary value in AssemblyInformationalVersionAttribute #4822 https://github.com/Microsoft/visualfsharp/issues/4822

The .NET SDK version is pinned. I'll try updating it.

ctaggart commented 6 years ago

https://github.com/Microsoft/visualfsharp/blob/master/build/targets/GenerateAssemblyAttributes.targets shows July 18th, but still doesn't work in .NET Core SDK 2.1.402 https://github.com/dotnet/core/blob/master/release-notes/2.1/2.1.4/2.1.4-download.md

The fsproj has <TreatWarningsAsErrors>true</TreatWarningsAsErrors>.

Workaround is probably <NoWarn>FS2003</NoWarn>.

dustinmoris commented 6 years ago

Quick question, I've never seen a Directory.Build.props file. Why would the SourceLink configuration sit there rather than inside the Giraffe.fsproj file?

ctaggart commented 6 years ago

It is just an easy way to apply it to all projects. It is the normal way I add it to most solutions. Feel free to put in the fsproj if you like that better.

dustinmoris commented 6 years ago

Ok cool, thanks for clarification! It's good to know, but currently the Giraffe repo has only one project so I think I'll move it in there. I will also add it to the other Giraffe repos (Giraffe.Razor, Giraffe.DotLiquid, etc.) :)

ctaggart commented 5 years ago

I tested that it is working for Giraffe 3.0.0. Congrats on 3.0.0! 🎉

PS C:\Users\taggac> sourcelink print-json "C:\Users\taggac\Downloads\giraffe.3.0.0\lib\netstandard2.0\Giraffe.pdb"
{"documents":{"C:\\projects\\giraffe\\*":"https://raw.githubusercontent.com/giraffe-fsharp/Giraffe/a036cfe7d3ef52af68ed1d43b5fe477d4c10a211/*"}}

PS C:\Users\taggac> sourcelink test "C:\Users\taggac\Downloads\giraffe.3.0.0\lib\netstandard2.0\Giraffe.pdb"
sourcelink test passed: C:\Users\taggac\Downloads\giraffe.3.0.0\lib\netstandard2.0\Giraffe.pdb

I see it depends on TaskBuilder.fs 2.0.0 or higher. If you use 2.1.0, it also has SourceLink enabled. https://github.com/rspeele/TaskBuilder.fs/pull/24

dustinmoris commented 5 years ago

Thanks! This will be in the next release: https://github.com/giraffe-fsharp/Giraffe/commit/81b61b311d659d5cbbcad7dfc9ccb3f8a68437dd