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

EmbedUntrackedSources not honoured for F# projects on GitHub #181

Closed
SteveGilham opened this issue Sep 30, 2018 · 6 comments
Closed

EmbedUntrackedSources not honoured for F# projects on GitHub #181

SteveGilham opened this issue Sep 30, 2018 · 6 comments

Comments

@SteveGilham
Copy link

I have a project that includes a build-time generated (and untracked) file of the form

namespace MyNameSpace
module SolutionRoot =
  let location = """some/file/path"""

which is located at some\file\path\_Generated\SolutionRoot.fs

If I build the project with SourceLink (Microsoft.SourceLink.GitHub Version="1.0.0-beta-63127-02") and <EmbedUntrackedSources>true</EmbedUntrackedSources> the untracked file is not detected as such, but is linked by URL instead along with all the others that generate symbols. So when I invoke the sourcelink global tool on the symbols with option test, I get error: url failed NotFound: Not Found when it tries to locate this untracked file in GitHub at the url _Generated\SolutionRoot.fs relative to the current commit root.

Using EmbedAllSources instead does embed every file that generates symbols, including this one, and sourcelink test passes.

I am assuming that as the F# compiler is source-control agnostic, the issue lies somewhere on the SourceLink side.

@tmat
Copy link
Member

tmat commented Sep 30, 2018

Could you please run msbuild /bl:log.binlog proj.fsproj and share the resulting log file?

@tmat
Copy link
Member

tmat commented Sep 30, 2018

Also, what's the content of .gitignore file? SourceLink determines untracked files based on .gitignore.

@SteveGilham
Copy link
Author

Zipped binlog -- log.zip
Zipped .gitignore -- gitignore.zip : the appropriate line of the latter would be _*/

A C# project in this solution happily processes a FAKE generated assembly version file with path _Generated/AssemblyVersion.cs as a file to embed under these circumstances (the equivalent _Generated/AssemblyVersion.fs is a total no-show because all the [<Literal>] values compile with the [DebuggerBrowsable(DebuggerBrowsableState.Never)] attribute)

SteveGilham added a commit to SteveGilham/altcover that referenced this issue Sep 30, 2018
@tmat
Copy link
Member

tmat commented Sep 30, 2018

The log shows that SourceLink identifies correctly the files that need to be embedded:

image

It seems however that the F# build targets do not read the EmbeddedFiles items. This has been fixed recently in F#: dotnet/fsharp#4075, but the fix doesn't seem to make it to VS 2017 update. Can you try the latest build? See https://github.com/Microsoft/visualfsharp/wiki/Using-CI-Builds

@tmat tmat closed this as completed Sep 30, 2018
@saul
Copy link

saul commented Mar 28, 2019

@tmat - completely unrelated but what tool are you using to produce the screenshot above? Looks very useful for MSBuild debugging

@bording
Copy link

bording commented Mar 28, 2019

@saul You can get it from http://msbuildlog.com/

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

No branches or pull requests

4 participants