Xcode8: race condition between saving and building causing "file modified during compiling " error
| Originator: | markd | ||
| Number: | rdar://27268734 | Date Originated: | 7/10/2016 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Version 8.0 beta 2 (8S162m) |
| Classification: | UI/Usability | Reproducible: | Rarely |
Summary: I was working along, did a command-S save, and then immediately did a command-R to run the app . I noticed the app wasn't running, but I got an error: <unknown>:0: error: input file 'ClassMakerController.swift' was modified during the build Attached is a screen recording I was making at the time, and which shows keystrokes. There was a save immediately before the command-R to initiate the run. I can type pretty fast (test over 90wpm) and command-S -> command-R can be done extremely quickly) I didn't see any saves after the run was kicked off, which makes me think there's a race condition between the saving of the file, and when the build starts, possibly leading to stale versions of the file actually being used if the save and the build happen in quick succession. Or in this case, the file changing underneath the compiler. Also attached is the pröject file, FWIW. Steps to Reproduce: I've seen this before occasionally. This was the first time I caught evidence. I haven't been able to reproduce it with rapid cmd-S and cmd-R. Expected Results: Actual Results: Version: Version 8.0 beta 2 (8S162m) 10.11.5 (15F34) Notes: Race conditions are hard. I sincerely wish you luck. Configuration: Attachments: 'ClassMaker.zip' and 'save-build-race-condition.mp4' were successfully uploaded.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!