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

Satellite assemblies do not pass PathMap to Csc task #45256

Closed
jaredpar opened this issue Dec 2, 2024 · 4 comments · Fixed by #45257
Closed

Satellite assemblies do not pass PathMap to Csc task #45256

jaredpar opened this issue Dec 2, 2024 · 4 comments · Fixed by #45257
Assignees
Labels
untriaged Request triage from a team member

Comments

@jaredpar
Copy link
Member

jaredpar commented Dec 2, 2024

Describe the bug

The CoreGenerateSatelliteAssemblies target does not pass $(PathMap) to the <Csc> task for generating satellite assemblies. That means the resulting DLL embeds original path names, not mapped path names. Further it does not pass $(Features) either which means it won't pass through -p:Features=debug-determinism which makes it harder to see why resources are differing.

To Reproduce

Build an assembly with -p:DeterministicSourcePaths and notice that $(PathMap) is not passed to the compiler

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Dec 2, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

1 similar comment
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

jaredpar added a commit that referenced this issue Dec 2, 2024
Pass a few parameters to `<Csc>` that were missing and impact build reproducibility.

closes #45256
@KalleOlaviNiemitalo
Copy link
Contributor

That means the resulting DLL embeds original path names, not mapped path names.

Which files' path names does it embed? I thought most file paths are in the PDB, which is not generated for resource DLLs.

@jaredpar
Copy link
Member Author

jaredpar commented Dec 3, 2024

Which files' path names does it embed?

In the default case the source file name isn't directly embedded. Basically using PathMap won't solve my problems (discovered that after debugging further once I had Features working). But in the more general case a slightly custom resource generation could embed file names via say CallerFileInfo slipping in. It's more good hygiene and future proofing than fixing specific bug. Also passing Features is important for us being able to pass debug flags to the compiler.

For the specific case I'm looking at, the problem is that the name of the resource file is getting embedded. The resource files are passed essentially in this format:

/resource:C:\Users\jaredpar\code\roslyn\artifacts\obj\Microsoft.CodeAnalysis\Debug\net8.0\Microsoft.CodeAnalysis.CodeAnalysisResources.de.resources
/resource:C:\Users\jaredpar\code\roslyn\artifacts\obj\Microsoft.CodeAnalysis\Debug\net8.0\Microsoft.CodeAnalysis.C_.Users.jaredpar.code.roslyn.src.Dependencies.Collections.Internal.Strings.de.resources

Notice in the second case it replaces the directory separator with _ in the names. Given the that argument does not have a resource name (would follow the file path with a comma separator) the resource gets the name of the file. The resource name is visibly embedded into the PE file hence the path ends up impacting the build output.

Will likely file a separate bug to follow up on this. Think it's a fairly easy fix of passing an explicit name here that isn't dependent on path but I'm not as familiar with resources so want to make sure that doesn't have any side effects I'm not thinking of.

github-actions bot pushed a commit that referenced this issue Jan 13, 2025
Pass a few parameters to `<Csc>` that were missing and impact build reproducibility.

closes #45256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants