Assuming I have "build server" and a "dev machine" that both have the following characteristics
- C# compiler
- Identical source code
- Identical system environment variables
- Identical compiler & compiler flags
- Identical architecture on the build server and dev machine
I also understand the following about the C# compiler from Eric Lippert's blog (I am using .NET but this question could be asked of any static language build process)
- The C# compiler by design never produces the same binary twice
- At a fundamental level, the job that the C# compiler does for you is it takes in C# code, analyzes it for correctness, and produces an equivalent program written in the PE format
- Compiler optimizations and multi-threaded compilers are non-determinstic
- The JIT will change the code at runtime
Knowing all this.
If I build the source on the build server and get a set of DLL's and executables that I call server binaries
Is it not redundant to rebuild the binaries on my dev machine, i.e build local binaries
Aren't the server binaries
and local binaries
valid substitutes for one another.
If so can I just copy all the server binaries
... but them where the local binaries
would have gone and treat them as thought I built them myself.
Obviously this might seem unnecessary in the case of just 1 dev machine, but if I have n
dev machines, I only have to build once time, not n
times.
Are there obvious draw backs to my logic? Is this common practice for .Net shops?