Skip to content

Make target-pack ILAsm builds deterministic in BuildIlFile - #1663

Merged
mthalman merged 2 commits into
mainfrom
copilot/fix-ilasm-deterministic-flag
May 15, 2026
Merged

Make target-pack ILAsm builds deterministic in BuildIlFile#1663
mthalman merged 2 commits into
mainfrom
copilot/fix-ilasm-deterministic-flag

Conversation

Copilot AI commented May 15, 2026

Copy link
Copy Markdown
Contributor

src/targetPacks/Directory.Build.targets assembled .il files without deterministic mode, producing non-reproducible PE timestamps/MVIDs for targeting-pack reference assemblies and causing downstream reproducibility drift. This update enables deterministic ILAsm output at the source.

  • Build target update

    • Updated BuildIlFile in src/targetPacks/Directory.Build.targets to pass -deterministic to ilasm.
  • Reproducibility impact

    • Ensures assemblies produced from target-pack .il sources are deterministic.
    • Eliminates a root source of nondeterminism that propagates into consumers compiling against these reference assemblies.
<Exec Command="$(IlasmPath) $(IlFile) -dll -quiet -nologo -deterministic &quot;-output=$(OutputFile)&quot;"
      IgnoreStandardErrorWarningFormat="true"
      CustomErrorRegularExpression=": error : " />

Copilot AI changed the title [WIP] Fix ilasm invocation to include -deterministic flag Make target-pack ILAsm builds deterministic in BuildIlFile May 15, 2026
Copilot AI requested a review from mthalman May 15, 2026 13:05
@mthalman
mthalman marked this pull request as ready for review May 15, 2026 13:07
@mthalman
mthalman requested a review from a team as a code owner May 15, 2026 13:07
@mthalman
mthalman enabled auto-merge (squash) May 15, 2026 13:07
@omajid

omajid commented May 15, 2026

Copy link
Copy Markdown
Member

I tested this locally myself. It does wonders. For me, the html-diff-render (without any exclusions/filtering) is down from 4.36 MB to 376KB. A 91% reduction.

@mthalman
mthalman merged commit 0447218 into main May 15, 2026
4 checks passed
@MichaelSimons
MichaelSimons deleted the copilot/fix-ilasm-deterministic-flag branch May 15, 2026 18:22
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone May 21, 2026
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.

targetPacks/Directory.Build.targets invokes ILAsm without -deterministic, causing non-reproducible reference assemblies

4 participants