Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Orders source files before compilation to ensure reproducible output #742
Conversation
d27c8e0
to
4ff6a48
} | ||
|
||
func compile(path string, sourceFiles []source, minify bool) ([]byte, error) { | ||
|
file, err := parser.ParseFile(fileSet, fullPath, r, parser.ParseComments) | ||
// Files should be uniquely named and in the original package directory in order to be | ||
// ordered correctly | ||
newPath := path.Join(pkg.Dir, "__"+name) |
dave
Apr 6, 2018
•
Author
Yes it does, but fullPath is dependant on the goroot of the machine you're building this on... So some machines these files will come before the other files, and some after.
So on Andy's machine the file order would be:
/andys_go_root/src/time/format.go
/andys_go_root/src/time/sleep.go
/andys_go_root/src/time/sys_unix.go
/andys_go_root/src/time/tick.go
/andys_go_root/src/time/time.go
/andys_go_root/src/time/zoneinfo.go
/andys_go_root/src/time/zoneinfo_read.go
/src/time/time.go
... but on Zoe's machine it would be:
/src/time/time.go
/zoes_go_root/src/time/format.go
/zoes_go_root/src/time/sleep.go
/zoes_go_root/src/time/sys_unix.go
/zoes_go_root/src/time/tick.go
/zoes_go_root/src/time/time.go
/zoes_go_root/src/time/zoneinfo.go
/zoes_go_root/src/time/zoneinfo_read.go
See the issue for an explanation.
With this change the order will be identical on any machine because they'll be like this:
/src/time/__format.go
/src/time/__sleep.go
/src/time/__sys_unix.go
/src/time/__tick.go
/src/time/__time.go
/src/time/time.go
/src/time/__zoneinfo.go
/src/time/__zoneinfo_read.go
No description provided.