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

PublishSingleFile is not deterministic #11311

Closed
nioncode opened this issue Apr 16, 2020 · 1 comment
Closed

PublishSingleFile is not deterministic #11311

nioncode opened this issue Apr 16, 2020 · 1 comment
Assignees
Labels
untriaged Request triage from a team member

Comments

@nioncode
Copy link

When publishing an application with PublishSingleFile=true two times, the resulting binaries are not byte-for-byte identical. When doing a publish without PublishSingleFile, the output is completely identical.

When piping the resulting .exe through a hexdump, there is only a single place where the single-file binaries differ, so I assume this is some kind of build identifier.

Can we make the builds deterministic when using PublishSingleFile=true? This would ensure that build outputs between different machines can be correctly compared / cached, etc.

Steps to reproduce:

dotnet new console
dotnet publish -o publish -p:PlatformTarget=x86 -r win-x86
dotnet publish -o publish2 -p:PlatformTarget=x86 -r win-x86
diff -rq publish*
--> good, no changes

dotnet publish -o single-publish -p:PublishSingleFile=true -p:PlatformTarget=x86 -r win-x86
dotnet publish -o single-publish2 -p:PublishSingleFile=true -p:PlatformTarget=x86 -r win-x86
diff -rq single* 
--> Files single-publish/demo.exe and single-publish2/demo.exe differ


xxd single-publish/*.exe > hex1.txt
xxd single-publish2/*.exe > hex2.txt
diff hex*.txt
3840344,3840345c3840344,3840345
< 03a99570: 0000 0000 00e0 0000 000c 676e 6b72 6e6f  ..........gnkrno
< 03a99580: 6162 2e66 766a 0014 0200 0000 0000 0012  ab.fvj..........
---
> 03a99570: 0000 0000 00e0 0000 000c 7264 6972 316c  ..........rdir1l
> 03a99580: 6830 2e76 346e 0014 0200 0000 0000 0012  h0.v4n..........
@marcpopMSFT marcpopMSFT added the untriaged Request triage from a team member label Apr 16, 2020
@swaroop-sridhar
Copy link
Contributor

This is a dup of dotnet/runtime#3601

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants