binary-reproducibility

Why does C# generate different EXEs for the same source-code?

自作多情 提交于 2019-12-28 12:28:34
问题 Every time we recompile our C# application we end up with EXEs with different MD5 signatures. We are recompiling on the same machine, minutes apart. Why doesn't the same source-code yield the same output? Is there a way to fix this? 回答1: "So every assembly has: A Timestamp, in two locations A GUID that matched the PDB What appears to be a completely random GUID generated every compile. A counter indicating what the build of the assembly is - generated only in subsequent Visual Studio builds."

In Tensorflow, is there a way to set a seed at the session level?

风格不统一 提交于 2019-12-10 19:30:43
问题 I'm trying to get repeatable results when running a session, but want to change the seed freely between sessions. Something like this: a = tf.random_uniform([1]) #Set seed here to e.g. 123 with tf.Session() as sess: print(sess.run(a)) #Output: A1 print(sess.run(a)) #Output: A2 #Set seed here to e.g. 42 with tf.Session() as sess: print(sess.run(a)) #Output: A3 print(sess.run(a)) #Output: A4 #Set seed here to e.g. 123 with tf.Session() as sess: print(sess.run(a)) #Output: A1 print(sess.run(a))

Yagarto (GCC, Win32) compiles same code differently on different PCs

有些话、适合烂在心里 提交于 2019-12-06 08:33:42
问题 I am using a Yagarto toolchain on Windows to compile a codebase of about 100K lines of code. We have two development PCs. However, they each build slightly different binaries despite having the same toolchain and building the same source code. I have checked using MD5 that we have the same compiler binaries, the same system headers, and we are compiling the same source, with the same commandline being passed to GCC, yet there are subtle differences. Out of the 81 object files in our codebase,

Yagarto (GCC, Win32) compiles same code differently on different PCs

萝らか妹 提交于 2019-12-04 13:13:40
I am using a Yagarto toolchain on Windows to compile a codebase of about 100K lines of code. We have two development PCs. However, they each build slightly different binaries despite having the same toolchain and building the same source code. I have checked using MD5 that we have the same compiler binaries, the same system headers, and we are compiling the same source, with the same commandline being passed to GCC, yet there are subtle differences. Out of the 81 object files in our codebase, 77 compile exactly the same; and four have minor differences. There is no functional difference, but

How to always produce byte-for-byte identical .exe on rebuild of C# application?

偶尔善良 提交于 2019-12-03 11:17:10
问题 I'll give you a little bit of background first as to why I'm asking this question: I am currently working in a stricly-regulated industry and as such our code is quite carefully looked-over by official test houses. These test houses expect to be able to build the code and generate an .exe or .dll which is EXACTLY the same each and every time (without changing any code obviously!). They check the MD5 and the SHA1 of the executables that they create to ensure this. Up until this point I have

Binary Reproducibility in Visual C++

爱⌒轻易说出口 提交于 2019-12-01 02:23:42
问题 Is there a way to force the same code to produce the same binary in Visual C++? Turn off the timestamp in the PE or force the timestamp in the PE to be some fixed value, in other words? 回答1: It's not only a timestamp - there's an embedded GUID used for PDB matching - as John Robbins explains. Even beyond that, there's just no way to force the compiler to generate consistent results, as Jim Griesmer explains - compiler writers are far more interested in generating correctly functioning code

Compiling Twice with Delphi 6 and getting the same checksum on the binary

你离开我真会死。 提交于 2019-11-30 21:40:31
For the purposes of binary / source code verification, i'd like to be able to make two compiles on the same computer 2 weeks apart and have the binaries be identical and thus pass some checksum test. So far I've found that most likely the timestamp will be written by the compiler into the binary. I can work around this by doing the compare on the dumpbin /rawdata results per this msdn article. http://support.microsoft.com/kb/164151 However the dumpbin results still differ in a about a dozen places and the difference still appears to be some kind of timestamp (changing from A1 73 to C4 76) for

Compiling Twice with Delphi 6 and getting the same checksum on the binary

时间秒杀一切 提交于 2019-11-30 17:35:07
问题 For the purposes of binary / source code verification, i'd like to be able to make two compiles on the same computer 2 weeks apart and have the binaries be identical and thus pass some checksum test. So far I've found that most likely the timestamp will be written by the compiler into the binary. I can work around this by doing the compare on the dumpbin /rawdata results per this msdn article. http://support.microsoft.com/kb/164151 However the dumpbin results still differ in a about a dozen

Can i specify the module version id (MVID) when building a .net assembly?

谁说我不能喝 提交于 2019-11-30 17:26:58
问题 We have some shared assemblies that get build automatically every night. When there are no changes made to the sources, i would expect the assembly binaries to be exactly the same as a previous version. However, there seem to be minor differences between assemblies. I have done some effort to determine the difference between two builds. I used ildasm to generate an il version, and compared the resulting text versions. The only difference (in IL) is the MVID (a random guid) in the module. Some

Why don't two binaries of programs with only comments changed exactly match in gcc?

大憨熊 提交于 2019-11-29 20:54:36
I created two C programs Program 1 int main() { } Program 2 int main() { //Some Harmless comments } AFAIK, when compiling, the compiler(gcc) should ignore the comments and redundant whitepaces, and hence the output must be similar. But when I checked the md5sums of the output binaries, they don't match. I also tried compiling with optimisation -O3 and -Ofast but they still didn't match. What is happening here? EDIT: the exact commands and there md5sums are(t1.c is program 1 and t2.c is program 2) gcc ./t1.c -o aaa gcc ./t2.c -o bbb 98c1a86e593fd0181383662e68bac22f aaa