-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes SPM seems to duplicate checked out files #5589
Comments
|
The plugin machinery takes the source files in the Plugins subdirectory as inputs, but never writes there. So I suspect that there's some issue here with the checkout. The point about TSAN is interesting — I don't know if that could write any files to the source directory, but I'd be surprised if it did. Have you only seen this with TSAN? The " 2" suffix thing looks like the kind of thing you'd get if you duplicated a file in Finder, which is also suspicious. The error itself makes perfect sense if there are three copies of the source files inside that directory, so the question is how they got there. If there are any steps to reproduce this reliably, please do add them (as you noted you will). This is baffling. |
|
Hej @abertelrud - very long time, nice to see you here! (I've changed surname, but Research & Trade + GradientKit should jog your memory if needed ;-) I can't say its only with TSAN, it was just what I worked with the last few weeks so unclear if that is the root cause - my best guess is that its related to branch switching, but as mentioned I'll definitely try to nail down root use pattern that triggers and will update the case. You are absolutely right about the suffix, sometimes it also gets a " 3" etc, the compilation issues I get is simply due to the same files being there in multiple copies - it looks basically as someone went into the Finder and did 'duplicate' on all files (which I definitely did not...). |
|
Hej Jocke! Long time indeed! Great to hear from you! Yes, I remember well, though I would not have guessed immediately that it was you, because of the different surname. Yes GradientKit was forever ago. Maybe it's time to make a second version of that, now as a package! :) This is a really odd one — as far as I know there is nothing in SwiftPM that would add that suffix as tiebreaker. I suppose it's possible Foundation does that in some way on Darwin, but it's still odd (and we shell out to I still have not been able to reproduce this, but I also suspect that it's actually orthogonal to plugins. If you find any hints of what might cause it, that would be very interesting indeed. |
|
No other macOS tools in play really - got a fairly clean new setup with minimal cruft. Haven’t been reproducing it lately but haven’t used tsan either so that’s my current best guess - I’ll update with details when I get it reproduced again for sure when nailing it down - it happened quite often a few weeks ago so seems likely it’s something that will be possible to reproduce eventually. Stay tuned. |
|
Ok, after having this reproducible often before I can now classify it as a Heisenbug, will close this now and reopen if I manage to reproduce again. Perhaps related to asan/tsan as I was using them a lot when reproducing it, but haven't worked with them lately, but will revert with more precise information if I encounter it again. Thanks. |
Description
As outlined in https://forums.swift.org/t/docc-gets-duplicated-file-checked-out/57742/2 :
We see a weird behaviour with the docc plugin and wonder if anyone else have run in to it or have any hints - quite often we'll get duplicate checkout of docc plugin source files (see below) which leads to a broken build as there are multiple source files with the same content (suffixed "2", "3", ...) removing the .build directory will give a perfectly clean compilation. In this case I had a clean build, ran tests with TSAN and then triggered the problem.
Haven't used any other SPM plugins so can't say if it's an issue with SPM, with the DocC plugin or with our environment (we are simply using GitHub and checking out from there).
In this specific example the package manifest is fairly minimal:
Expected behavior
Only get a single copy of each source file checked out which should change properly when e.g. switching branches.
Actual behavior
I sometimes get double-checked or triple-checked out files as outlined in the description, doing
rm -rf .buildand rebuilding fixes the issue, but it is tedious for larger projects.Steps to reproduce
Unfortunately not reproducible at will yet, will update if I figure out what triggers the issue.
Swift Package Manager version/commit hash
Swift 5.6.1
Swift & OS version (output of
swift --version && uname -a)The text was updated successfully, but these errors were encountered: