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

mcs.exe needs to sort glob to produce deterministic output #19257

Open
bmwiedemann opened this issue Mar 18, 2020 · 0 comments
Open

mcs.exe needs to sort glob to produce deterministic output #19257

bmwiedemann opened this issue Mar 18, 2020 · 0 comments

Comments

@bmwiedemann
Copy link
Contributor

bmwiedemann commented Mar 18, 2020

Steps to Reproduce

  1. have a filesystem with random readdir order: disorderfs -o allow_other --shuffle-dirents=yes $DIR $MNT
  2. build the at-spi-sharp source code
  3. check at-spi-sharp.dll content

Current Behavior

for i in $(seq 1 5) ; do 
"/usr/bin/mono" "/usr/lib/mono/4.5/mcs.exe" "-sdk:4" "-noconfig" "-unsafe" "-keyfile:../mono-uia.snk" "-out:bin/at-spi-sharp.dll" "-target:library" "./Accessible.cs" "./Action.cs" "./Application.cs" "./AssemblyInfo.cs" "./Component.cs" "./Desktop.cs" "./DeviceEventController.cs" "./Document.cs" "./EditableText.cs" "./EventBase.cs" "./EventDocument.cs" "./EventFocus.cs" "./EventKeyboard.cs" "./EventMouse.cs" "./EventObject.cs" "./EventTerminal.cs" "./EventWindow.cs" "./Hyperlink.cs" "./Hypertext.cs" "./Image.cs" "./Registry.cs" "./RelationSet.cs" "./Role.cs" "./Selection.cs" "./StateSet.cs" "./StateType.cs" "./Table.cs" "./Text.cs" "./UncachedChildren.cs" "./Value.cs" "./../ndesk-dbus/*.cs" "-r:System" "-r:System.Core" "-r:System.Xml" "-r:Mono.Posix" >/dev/null 2>&1 ; md5sum bin/at-spi-sharp.dll ;
 done |  sort | uniq -c

produces different md5sums for every run.

The problem also goes away when dropping the quotes from "./../ndesk-dbus/*.cs" so it seems, the non-determinism comes from mono resolving that glob. If bash handles the glob, everything becomes deterministic.

Expected Behavior

mono output should be deterministic, even with non-deterministic filesystem readdir order.

On which platforms did you notice this

[X] Linux

Version Used:

mono-core-6.8.0

See https://reproducible-builds.org/ for why this matters.

This bug was filed as part of my work on reproducible builds for openSUSE.

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

No branches or pull requests

1 participant