Skip to content

[main] Source code updates from dotnet/runtime - #7160

Closed
dotnet-maestro[bot] wants to merge 3 commits into
mainfrom
darc-main-04a62aae-a807-40d1-a57d-dfa8dc1c14a4
Closed

dotnet-maestro[bot] wants to merge 3 commits into
mainfrom
darc-main-04a62aae-a807-40d1-a57d-dfa8dc1c14a4

Conversation

@dotnet-maestro

@dotnet-maestro dotnet-maestro Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Note

This is a codeflow update. It may contain both source code changes from
the source repo
as well as dependency updates. Learn more here.

This pull request brings the following source code changes

From https://github.com/dotnet/runtime

Diff the source with this PR branch
darc vmr diff --name-only https://github.com/dotnet/runtime:4b5614930561c7d0ae7b36b44ff0826fda04c49d..https://github.com/dotnet/dotnet:darc-main-04a62aae-a807-40d1-a57d-dfa8dc1c14a4

@dotnet-maestro

Copy link
Copy Markdown
Contributor Author

Note

PRs from original repository included in this codeflow update:

💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance.

@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team June 10, 2026 02:22
@ViktorHofer
ViktorHofer enabled auto-merge (squash) June 10, 2026 09:09
@Youssef1313

Copy link
Copy Markdown
Member
  /Users/runner/work/1/s/src/runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.CoreCLR.cs(39,13): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context [/Users/runner/work/1/s/src/runtime/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
  /Users/runner/work/1/s/src/runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.CoreCLR.cs(40,13): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context [/Users/runner/work/1/s/src/runtime/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
  /Users/runner/work/1/s/src/runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.CoreCLR.cs(41,13): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context [/Users/runner/work/1/s/src/runtime/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
  /Users/runner/work/1/s/src/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.cs(198,36): error CS0111: Type 'ObjectiveCMarshal' already defines a member called 'GetOrCreateReferenceTrackingMemory' with the same parameter types [/Users/runner/work/1/s/src/runtime/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]

Did dotnet/runtime#128961 break something here?

@AaronRobinsonMSFT

@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

Did dotnet/runtime#128961 break something here?

I don't see how in this case. The dotnet/runtime repo built without issue. Are different settings/flags being used?

@Youssef1313

Copy link
Copy Markdown
Member

The diff appearing in runtime seems different from here. In this code flow, I see two GetOrCreateReferenceTrackingMemory methods for example (same signature - single object parameter).

@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

The diff appearing in runtime seems different from here. In this code flow, I see two GetOrCreateReferenceTrackingMemory methods for example (same signature - single object parameter).

I checked out 24547a76ba9 in the dotnet/runtime repo and it buids without issue. I'm not sure what is going on with this PR. I think there is something off.

@dotnet-maestro

Copy link
Copy Markdown
Contributor Author

@akoeplinger

Copy link
Copy Markdown
Member

@dotnet/prodconsvcs @premun seems like another codeflow problem. GetOrCreateReferenceTrackingMemory is getting duplicated in src/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.cs

Let's try whether recreating the PR helps.

@dotnet-maestro
dotnet-maestro Bot deleted the darc-main-04a62aae-a807-40d1-a57d-dfa8dc1c14a4 branch June 11, 2026 18:02
@akoeplinger

Copy link
Copy Markdown
Member

looks like we hit the same problem in the new PR

@premun

premun commented Jun 12, 2026

Copy link
Copy Markdown
Member

@dkurepa this might look like that bet git merge again when git just cooks up the duplicated code on its own?

@dkurepa

dkurepa commented Jun 15, 2026

Copy link
Copy Markdown
Member

So I had a look into why this keeps happening. It's a special case in the opposite direction flow.
We create a working branch from the point of last flow. In this case this is the backflow when the method that's getting duplicated didn't exist. This becomes the merge base.
The head branch has some version of this method, call it 1
The work branch gets the second version from the runtime commit we're flowing, version 2

Git sees these two versions and thinks they're different implementations, not changes two the same method, so it adds both when we merge the work branch into the head branch, so we get duplicate.

I don't think we can prevent this, but maybe we can detect when it happens and cleanup

@premun

premun commented Jun 15, 2026

Copy link
Copy Markdown
Member

But shouldn't like the context of the patch cause an application error and report a conflict? Or is it some bad luck when the context matches by chance because it's somethin like a closing brace etc?

@dkurepa

dkurepa commented Jun 15, 2026

Copy link
Copy Markdown
Member

The patch is applied successfully to the working branch, this happens when we rebase the working branch on top of the head branch, so the conflict would appear there.
But the method implementations are different enough that git thinks they're separate implementations so it keeps both

@dkurepa
dkurepa restored the darc-main-04a62aae-a807-40d1-a57d-dfa8dc1c14a4 branch June 22, 2026 14:43
@akoeplinger
akoeplinger deleted the darc-main-04a62aae-a807-40d1-a57d-dfa8dc1c14a4 branch June 29, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants