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

Move InitializeSourceRootMappedPaths targets down into common #5398

Open
clairernovotny opened this issue Jun 3, 2020 · 6 comments
Open
Labels

Comments

@clairernovotny
Copy link
Member

The targets for initializing SourceRoot items for deterministic builds lives in the Managed.core targets today. This means that other languages, like F#, need to copy the targets, which will lead to divergence and issues.

https://github.com/dotnet/roslyn/blob/master/src/Compilers/Core/MSBuildTask/Microsoft.Managed.Core.targets#L158

We should move these targets down into the common targets so they're available to all languages as deterministic builds is a desirable, and encouraged, for published libraries and applications.

@tmat @cartermp @ctaggart

@clairernovotny
Copy link
Member Author

See also dotnet/fsharp#9379

@clairernovotny clairernovotny changed the title Move SourceRootMappedPath targets down into common Move InitializeSourceRootMappedPaths targets down into common Jun 3, 2020
@rainersigwald
Copy link
Member

These concepts don't apply to VC++ builds at all, do they? Of course, we have plenty of .NET stuff in common.targets already, but we do try to separate it out. I'd leave it in .Managed, except that really seems to mean VB/C# today.

@clairernovotny
Copy link
Member Author

Do we need another layer of abstraction? (classic solution in computer science 😉)

@ctaggart
Copy link

ctaggart commented Jun 4, 2020

These concepts don't apply to VC++ builds at all, do they?

@rainersigwald, actually they do. Here is the documentation in the readme on Using Source Link in C++ projects. These targets should be moved to common.

@tmat
Copy link
Member

tmat commented Jun 4, 2020

I'm not sure if VC++ compiler already supports path mapping but if not it is likely going to at some point to allow reproducible builds. So this logic would make sense for C++ project as well.

@rainersigwald
Copy link
Member

There's an undocumented cl.exe flag to trim file paths that's used internally; I don't know if there's a public face for it yet. @olgaark, do you know if there are plans for path-prefix (repo root) stripping for deterministic builds in C++? Could you use the path map that exists today for .NET, or would it need to be different for some reason?

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

No branches or pull requests

5 participants