Possible to skip recompiling a package if all inputs are identical?

271 views
Skip to first unread message

Richard Musiol

unread,
Jun 2, 2016, 5:17:02 PM6/2/16
to golang-dev
Hi,


I am wondering if it would be possible to not recompile a package if all inputs to the compiler are identical, especially when the source code of a dependency has changed, but only in a way that does not influence the compiler's output of the current package.

My current understanding is that the following inputs are used:
- Source code of the current package
- Export data of dependencies
- Environment flags like GOOS, etc.

Those are not used:
- Source code of dependencies
- Machine code of dependencies

Can checksums of the export data of dependencies be used to detect that only source code and machine code have changed, but not the export data?

Matthew Dempsky

unread,
Jun 2, 2016, 5:20:23 PM6/2/16
to Richard Musiol, golang-dev
On Thu, Jun 2, 2016 at 11:39 AM, Richard Musiol <neel...@gmail.com> wrote:
I am wondering if it would be possible to not recompile a package if all inputs to the compiler are identical, especially when the source code of a dependency has changed, but only in a way that does not influence the compiler's output of the current package.

Austin Clements

unread,
Jun 3, 2016, 12:25:50 PM6/3/16
to Richard Musiol, golang-dev
Note that the effect of this might be more limited than you'd like. To enable cross-package inlining, the export data effectively includes the source of exported functions and anything that got inlined into them (in AST form), so even a change that doesn't affect the package API might still change the export data. It would be interesting to get some data on just how effective this would be, perhaps by replaying the git history of some non-trivial Go package?

--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages