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

Unix: don't spawn 'uname -m' when we can get the ProcessorArchitecture from the runtime. #5897

Merged
merged 4 commits into from
Nov 20, 2020

Conversation

tmds
Copy link
Member

@tmds tmds commented Nov 19, 2020

No description provided.

@tmds
Copy link
Member Author

tmds commented Nov 19, 2020

Most commands I run with dotnet cli that involve msbuild spawn one or more uname -m child processes.

For example:

$ strace -qq -f -e execve dotnet build
execve("/usr/bin/dotnet", ["dotnet", "build"], 0x7ffc4faa3748 /* 59 vars */) = 0
[pid 22919] execve("/usr/lib64/dotnet/dotnet", ["dotnet", "exec", "/usr/lib64/dotnet/sdk/5.0.100-pr"..., "-maxcpucount", "-verbosity:m", "-restore", "-consoleloggerparameters:Summary"], 0x561504fa6a90 /* 64 vars */) = 0
Microsoft (R) Build Engine version 16.8.0-preview-20414-02+a55ce4fbb for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

[pid 22934] execve("/usr/bin/uname", ["uname", "-m"], 0x565242790720 /* 65 vars */) = 0
  Determining projects to restore...
[pid 22947] execve("/usr/bin/uname", ["uname", "-m"], 0x7f15102a0640 /* 65 vars */) = 0
  All projects are up-to-date for restore.
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  console -> /tmp/console/bin/Debug/net5.0/console.dll

This change will eliminate those.

cc @rainersigwald

{
ProcessorArchitectureType = ProcessorArchitectures.ARM;
}
else if (arch.StartsWith("aarch64", StringComparison.OrdinalIgnoreCase))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added aarch64 case here.

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

src/Shared/NativeMethodsShared.cs Outdated Show resolved Hide resolved
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
@rainersigwald
Copy link
Member

PR build hang was #5520, I'll rerun.

@rainersigwald
Copy link
Member

@tmds our builds are currently broken due to an Arcade infrastructure issue and we have been asked to prioritize getting #5879 into 16.9 preview 2, so we'll merge this as soon as everything's working again and that's started.

@rainersigwald rainersigwald added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Nov 19, 2020
@rainersigwald rainersigwald merged commit b045412 into dotnet:master Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants