{"action":"created","issue":{"url":"https://api.github.com/repos/takari/io.takari.incrementalbuild/issues/16","labels_url":"https://api.github.com/repos/takari/io.takari.incrementalbuild/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/takari/io.takari.incrementalbuild/issues/16/comments","events_url":"https://api.github.com/repos/takari/io.takari.incrementalbuild/issues/16/events","html_url":"https://github.com/takari/io.takari.incrementalbuild/issues/16","id":116933900,"number":16,"title":"DefaultAggregatorBuildContext is not correct when output changes","user":{"login":"virtuald","id":567900,"avatar_url":"https://avatars.githubusercontent.com/u/567900?v=3","gravatar_id":"","url":"https://api.github.com/users/virtuald","html_url":"https://github.com/virtuald","followers_url":"https://api.github.com/users/virtuald/followers","following_url":"https://api.github.com/users/virtuald/following{/other_user}","gists_url":"https://api.github.com/users/virtuald/gists{/gist_id}","starred_url":"https://api.github.com/users/virtuald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virtuald/subscriptions","organizations_url":"https://api.github.com/users/virtuald/orgs","repos_url":"https://api.github.com/users/virtuald/repos","events_url":"https://api.github.com/users/virtuald/events{/privacy}","received_events_url":"https://api.github.com/users/virtuald/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-14T15:47:35Z","updated_at":"2015-11-14T16:45:35Z","closed_at":null,"body":"Adding the following to the `testBasic` unit test shows this failure:\r\n\r\n    // output changed for some reason\r\n    Files.write(new byte[] {0x01}, outputFile);\r\n    indexer = new FileIndexer();\r\n    actx = newContext();\r\n    output = actx.newInputSet();\r\n    output.addInputs(basedir, null, null);\r\n    output.aggregateIfNecessary(outputFile, indexer);\r\n    actx.commit(null);\r\n    Assert.assertTrue(outputFile.canRead());\r\n    Assert.assertEquals(1, indexer.outputs.size());\r\n\r\nI haven't looked, but I suspect this is also true for the other incremental build pieces?\r\n\r\nNow, I think one could have a good philosophical debate about whether this is expected behavior or not -- if the user changes the output out from underneath the build process without telling it, you could argue that the user deserves what they get. But what if something else changes it without the user knowing? Perhaps git changed the endlines if it's a text file, or some malware (though, you have other issues in that case), or perhaps the build process was generating python files and the user inserted some debugging stuff into the output file (I've done this!). In all of these cases I would expect that a rebuild would replace the output file. "},"comment":{"url":"https://api.github.com/repos/takari/io.takari.incrementalbuild/issues/comments/156718666","html_url":"https://github.com/takari/io.takari.incrementalbuild/issues/16#issuecomment-156718666","issue_url":"https://api.github.com/repos/takari/io.takari.incrementalbuild/issues/16","id":156718666,"user":{"login":"ifedorenko","id":79316,"avatar_url":"https://avatars.githubusercontent.com/u/79316?v=3","gravatar_id":"","url":"https://api.github.com/users/ifedorenko","html_url":"https://github.com/ifedorenko","followers_url":"https://api.github.com/users/ifedorenko/followers","following_url":"https://api.github.com/users/ifedorenko/following{/other_user}","gists_url":"https://api.github.com/users/ifedorenko/gists{/gist_id}","starred_url":"https://api.github.com/users/ifedorenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifedorenko/subscriptions","organizations_url":"https://api.github.com/users/ifedorenko/orgs","repos_url":"https://api.github.com/users/ifedorenko/repos","events_url":"https://api.github.com/users/ifedorenko/events{/privacy}","received_events_url":"https://api.github.com/users/ifedorenko/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T16:45:35Z","updated_at":"2015-11-14T16:45:35Z","body":"Earlier versions of incremantalbuild library used to rebuild modified outputs, but we removed that behaviour. Philosophy aside, there were good practical reasons for the change.\r\n\r\nFirst, tracking reverse, i.e. output-to-input association has significant overhead, both in terms of performance and overall implementation/behaviour of the library. Reasoning about chained generations like input->generated-input->output (think java annotation processing, for example), becomes much more complicated. In-place class file manipulation by tools like aspectj and proguard is another example when incremental rebuild of changed outputs is either not possible at all or at least very tricky to implement properly.\r\n\r\nSecond, but not as critical, I often use the same source tree both for command line builds and for eclipse work (I think many do). It was really annoying to see command line recompile all/most sources just because the same sources were compiled inside eclipse.\r\n\r\nAlso anecdotally, nobody appears to complain about current behaviour. \r\n\r\nIf you feel really strongly about rebuilding modified outputs, the easiest way to implement this is to \"escalate\" build if any of the old outputs changed. I suggest you try this and if you like the result we can discuss how to integrate it back to the library."}}