gradle-native icon indicating copy to clipboard operation
gradle-native copied to clipboard

Sync only input derived data when assembling derived data directory

Open lacasseio opened this issue 2 years ago • 2 comments

As a user delegating to Xcode, I want to sync only input-derived data directories (keeping unrelated and existing files) when assembling the derived data directory for delegation so that I can ensure xcodebuild perform an incremental build.

### Sub-stories
- [ ] https://github.com/nokeedev/gradle-native/issues/799

Acceptance Criteria

  • [ ] Deleting a file from any input-derived data directory should be clear from the assembled derived data directory.
  • [x] Adding a file in any input-derived data directory should be added to the assembled derived data directory. (fixed by https://github.com/nokeedev/gradle-native/pull/791)
  • [x] Changes to files from any input-derived data directory synched to the assembled derived data directory. (fixed by https://github.com/nokeedev/gradle-native/pull/791)
  • [x] ~New files in the assembled derived data directory should not be removed in subsequent execution.~ (covered by https://github.com/nokeedev/gradle-native/issues/789)

lacasseio avatar Feb 23 '23 13:02 lacasseio

Essentially, this issue is about performing a lenient sync which could be described as only the files from the source directory should be synced into the destination directory. Any additional files in the destination directory should be left untouched. There is a tiny gap where a source file could be replaced by "an additional file" between two syncs which would essentially cause the "additional file" to be deleted. Despite being a very small possibility, it would essentially mean, for this particular scenario, that Xcode is overwriting an input file with an output (or intermediate) file. This behaviour is a terrible practice and should be avoided at all costs, e.g. modifying the build specification.

lacasseio avatar Mar 01 '23 08:03 lacasseio

Following the investigation https://github.com/nokeedev/gradle-native/issues/798, we should split the derived data assembling to another task. It would also allow for a solution to https://github.com/nokeedev/gradle-native/issues/770.

lacasseio avatar Mar 06 '23 12:03 lacasseio