Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Pain with CRLF/LF - can't we just make it work either way? #119

Closed
dsyme opened this issue Feb 9, 2016 · 6 comments
Closed

Pain with CRLF/LF - can't we just make it work either way? #119

dsyme opened this issue Feb 9, 2016 · 6 comments
Milestone

Comments

@dsyme
Copy link

dsyme commented Feb 9, 2016

Hi Cameron

As mentioned here we have some problems building repos on Windows that use SourceLink,

Basically we want to use "test=auto" in .gitattributes (since it works well). However then Windows copies of repos get files with CRLF and others with LF somewhat at random. Then SourceLink complains that there's a mismatch. I've been tempted to remove the use of SourceLink because of this but luckily I still have one repo where things build clean and SourceLink passes its validation checks.

Anyway, is there some way to make SourceLink be more forgiving here?

Thanks
Don

@ctaggart
Copy link
Owner

The line endings situation is documented here:
http://ctaggart.github.io/SourceLink/line-endings.html

A possible way is to add linefeed support to SourceLink.Fake #91 so that it can convert files to the same line endings before compilation. A proposed design for adding source indexes to portable pdb files has SourceLink running before the compile, which would make this pain go away #116. I'm really looking forward to F# support for portable pdb files. dotnet/fsharp#718.

@dsyme
Copy link
Author

dsyme commented Feb 11, 2016

Note we can't use LF for "visualfsharp" because various tests depend on CRLF as the default on Windows: dotnet/fsharp#954 (comment)

It's possible that FSharp.Compiler.Service has a similar dependency, I'm not sure.

I suppose the files that require CRLF should be listed like that in gitattributes.

@ctaggart
Copy link
Owner

I'm working on v2 right now. It will be dotnet tooling that supports the /sourcelink option built into the F# and C# compilers. Since it is run before compile, I can adjust the line endings before they are compiled.

https://github.com/ctaggart/SourceLink/blob/v1/SourceLink/Commands.fs#L22
https://github.com/ctaggart/SourceLink/blob/v1/Exe/LineFeed.fs

@dsyme
Copy link
Author

dsyme commented Feb 25, 2017

:) thanks

@sideeffffect
Copy link

SourceLink seems to be failing again for ProjectScaffold

https://ci.appveyor.com/project/fsgit/projectscaffold

is the lf autofix really working?

fsprojects/ProjectScaffold#292

@ctaggart
Copy link
Owner

ctaggart commented Jun 8, 2017

I responded in the ProjectScaffold issue. I recommend removing SourceLink v1 and upgrading to use SourceLink v2 as described in the quick start.

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

No branches or pull requests

3 participants