-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Update shared code from linker #70204
Conversation
Some changes made to the linker sources to help with this are here: dotnet/linker#2818 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -1,5 +1,5 @@ | |||
// Licensed to the .NET Foundation under one or more agreements. | |||
// The .NET Foundation licenses this file to you under the MIT license. | |||
// Copyright (c) .NET Foundation and contributors. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking to make sure we really want to touch the licensing header on this. This repo pretty much universally uses the header this is replacing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the AOT files (like this one to use the existing header).
The files which come from linker I would like to keep exactly identical - and linker uses the other header.
I'm not clear why there are two different headers (the one in linker was provided by LCA relatively recently, so maybe it's more "up to date"?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I definitely don't want us to introduce extra diffs compared to the dotnet/linker repo.
@stephentoub I've seen you doing these copyright header changes in the past - do you know what is it with the various repos using various headers? Looks like Copyright (c) .NET Foundation and contributors
is also used in the dotnet/sdk repo (besides dotnet/linker).
This change is introducing files shared between dotnet/linker repo and dotnet/runtime repo and we have a licensing header difference.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/TypeExtensions.cs
Show resolved
Hide resolved
{ | ||
missingMemberTypesString = string.Empty; | ||
|
||
var missingMemberTypes = GetMissingMemberTypes (targetMemberTypes, sourceMemberTypes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather we just let VS reformat these files to the coding style followed by this repo so that we don't need to context switch the coding style based on the directory the file is in. Having vastly different coding style per directory is confusing to anyone who doesn't have full context.
We don't run a code formatter script in this repo because we rely on people just following common sense. I only very rarely comment on style issues. It mostly just works out.
We weren't really able to follow the odd coding standards in the dotnet/linker repo until Marek introduced the CI gestapo to enforce it.
If you prefer to keep it this way, please at least add an .editorconfig
that stomps over the settings at the root of the repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to keep the files which come from linker repo exactly the same files - so that updating them is easy and all diffs are clearly visible. Also, updates to these files should ideally be done in the linker repo first (to keep one primary source).
So personally I would prefer we keep these files formatted as per dotnet/linker rules for now (and update the .editorconfig
). I plan to move linker to runtime repo once we branch for .NET 8 and then we would reformat everything to match the runtime style (... can't wait ...).
But that's just my opinion, if you think it's more important to match the runtime style I'll change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's likely the odd code style choices from dotnet/linker repo are going to interfere with various repo-wide cleanups people sometimes do (using tabs instead of spaces is the main one that I can see this directory fighting with). Just raising this.
Use the runtime's license header on the files which are AOT's own (shared files still keep the header from linker for now). Added editorconfig to keep the formatting of the shared files the same as in linker.
This brings in relatively recent version of the shared code from the dotnet/linker repo.
Main changes:
Formatting:
The files which are shared exactly from linker are kept as is (so tabs and so on)
The files which are AOT specific should follow the formatting of AOT projects
Testing:
Passes smoke tests and some additional validation done via linker tests which is not part of this change
Note: This is not up-to-date with linker but it's getting us much closer. Known "TODOs":