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

.NET 6 Preview 5 for Linux was built with PGO enabled, causing it to litter default.profraw files #18829

Closed
PathogenDavid opened this issue Jul 9, 2021 · 10 comments · Fixed by dotnet/runtime#56113
Assignees
Milestone

Comments

@PathogenDavid
Copy link
Contributor

PathogenDavid commented Jul 9, 2021

On Ubuntu 20.04, using .NET 6 Preview 5 (or Preview 6) is causing default.profraw files to appear all over my project and bogus "LLVM Profile Error" messages to print to my console wherever I run dotnet commands. I don't normally run .NET Previews on Linux, but I assume this is not expected.

This seems to be occurring because the preview release of the SDK has PGO enabled via Clang's -fcs-profile-generate option. Ideally this would not be the case for the published preview builds.


I unfortunately cannot inspect the actual contents of the profiles using llvm-profdata show due to a version mismatch. (Manually reading the file's header in a hex editor suggests they're from something built with LLVM 9 or older.) However I can infer it's caused by the .NET Preview because they don't appear if I disable previews in global.json:

image

In case it matters, I installed the .NET preview using these instructions. Let me know if you need any further details from me!

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jul 9, 2021
@dotnet-issue-labeler
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.

@PathogenDavid
Copy link
Contributor Author

As an aside, this actually happened to me in a mixed C#/C++ project where I'm building the native components with Clang. So I wasted quite a lot of time chasing a misconfiguration in my own build process. Assuming I haven't missed the mark, I'd really appreciate it if you all would consider specifying a directory name for your PGO files to save people from the same fate.

@marcpopMSFT marcpopMSFT self-assigned this Jul 15, 2021
@PathogenDavid PathogenDavid changed the title .NET 6 Preview 5 for Linux was built with PGO enabled, causing it to litter default.profraw files .NET 6 Preview 5-6 for Linux was built with PGO enabled, causing it to litter default.profraw files Jul 16, 2021
@PathogenDavid PathogenDavid changed the title .NET 6 Preview 5-6 for Linux was built with PGO enabled, causing it to litter default.profraw files .NET 6 Preview 5 for Linux was built with PGO enabled, causing it to litter default.profraw files Jul 16, 2021
@PathogenDavid
Copy link
Contributor Author

Can confirm that this is still happening with Preview 6.

@marcpopMSFT marcpopMSFT added the needs team triage Requires a full team discussion label Jul 19, 2021
@marcpopMSFT
Copy link
Member

@agocke Could this be related to your change here: dotnet/installer#10229

@marcpopMSFT marcpopMSFT added this to the Discussion milestone Jul 21, 2021
@marcpopMSFT marcpopMSFT added Area-Install and removed needs team triage Requires a full team discussion untriaged Request triage from a team member labels Jul 21, 2021
@agocke
Copy link
Member

agocke commented Jul 21, 2021

Uh oh, looks like bits are getting crossed here -- PGO bits should never end up in the published packages

@agocke
Copy link
Member

agocke commented Jul 21, 2021

Trying to track this down now

@agocke
Copy link
Member

agocke commented Jul 21, 2021

OK, so it doesn't look like the .tar.gz files are affected... I just downloaded the same version and I don't think those are instrumented bits.

@agocke
Copy link
Member

agocke commented Jul 21, 2021

Found it: this is actually in the runtime build. It looks like packaging debs and rpms is at a separate post-step in publishing.

https://github.com/dotnet/runtime/blob/f399076cb971fcfdab397d8b3786f321acb4b4d5/eng/pipelines/installer/jobs/base-job.yml#L429

The PGO builds disable building the installers, but these steps come along after and crack open the zip file created from earlier. Since this step is included in the PGO build, it's packaging up the PGO bits and publishing with the exact same name as the non-PGO bits.

When they get published, this creates a race condition where whoever publishes first wins.

Simple fix is to disable this step for PGO, but I'd like to also find some way to prevent the PGO build from building extra things by default.

@redfoggg
Copy link

Happens to me too on ubuntu 21.04.

@agocke
Copy link
Member

agocke commented Jul 22, 2021

@redfoggg If you use the tar.gz files instead of the deb/RPMs, those should contain the proper preview binaries.

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

Successfully merging a pull request may close this issue.

4 participants