Skip to content

Migrate StripEmbeddedLibraries from ILLink step#10871

Closed
sbomer wants to merge 1 commit intomainfrom
dev/svbomer/stripembedded-inplace
Closed

Migrate StripEmbeddedLibraries from ILLink step#10871
sbomer wants to merge 1 commit intomainfrom
dev/svbomer/stripembedded-inplace

Conversation

@sbomer
Copy link
Member

@sbomer sbomer commented Mar 2, 2026

(Trying out an alternative to #10695 that should involve fewer build changes)

Port StripEmbeddedLibraries from a custom ILLink linker step to an IAssemblyModifierPipelineStep so it runs as part of the post-trim AssemblyModifierPipeline instead.

Write modified assemblies to a temp 'new/' subdirectory then immediately copy back using the same rename-to-backup pattern as MarshalMethodsAssemblyRewriter, avoiding conflicts from reading and writing assemblies in the same directory.

Strip R2R (crossgen'd) metadata before writing so Mono.Cecil can handle mixed-mode assemblies without throwing NotSupportedException.

…peline

Port StripEmbeddedLibraries from a custom ILLink linker step to an
IAssemblyModifierPipelineStep so it runs as part of the post-trim
AssemblyModifierPipeline instead.

Write modified assemblies to a temp 'new/' subdirectory then immediately
copy back using the same rename-to-backup pattern as
MarshalMethodsAssemblyRewriter, avoiding conflicts from reading and
writing assemblies in the same directory.

Strip R2R (crossgen'd) metadata before writing so Mono.Cecil can handle
mixed-mode assemblies without throwing NotSupportedException.
@sbomer sbomer self-assigned this Mar 3, 2026
@sbomer
Copy link
Member Author

sbomer commented Mar 5, 2026

This doesn't work because it strips out the R2R (I just learned that the modifier pipeline runs after R2R for coreclr): #10891.

@sbomer sbomer closed this Mar 5, 2026
@sbomer sbomer deleted the dev/svbomer/stripembedded-inplace branch March 5, 2026 22:55
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.

1 participant