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
[SR-14976] Swift Package Manager (SPM) on Windows: BUFFER OVERFLOW on PreferredUILanguages/MachinePreferredUILanguages #4398
Comments
cc @compnerd |
I suspect that the crux of the issue is that there is something wrong with your package setup, and that is causing a diagnostic to be emitted. However, the diagnostic cannot be emitted because you do not have the English language available. The |
One thing that may be useful is to set a conditional breakpoint on |
Comment by Stefan Springer (JIRA)
On macOS, no error is committed when running `swift build -c release` for the package, even after removing `/Users/<user>/Library/Caches/org.swift.swiftpm`. And the repository and the dependent repositories are really simple. And there are no non-ASCII characters in the filenames. I think the packages are OK. |
Comment by Stefan Springer (JIRA)
Aha, you seem to be right, after starting Windows again, indeed an error war printed (Swift wanted to have swift-tools-version:5.4.0 instead of 5.3), I fixed that (also in the dependant repositories and changed "target" to "executableTarget" to avoid warnings). So I think the problem persist that SPM is not working correctly on Windows when no English language is present (and you have errors?). BTW: Now SPM says "Dependencies could not be resolved because no versions of 'SwiftXMLParser' match the requirement 0.1.18..<1.0.0 and root depends on 'SwiftXMLParser' 0.1.18..<1.0.0" which is not correct. OK, that has nothing to do with the issue described here (but still a main point for me since I cannot build on Windows 🙁 ). |
Comment by Stefan Springer (JIRA) Update: When trying again, SPM again gets stuck with the mentioned errors in Process Monitor. Seems to be a sporadic thing? (I did not change anything in the Windows settings, and no restart of Windows). |
Comment by Stefan Springer (JIRA) Any progress on this issue? I now tried Swift version 5.6-dev, and swift build seems to go a little bit further now, displaying "Computing version for ..." but then again stuck and doing nothing, meanwhile displaying errors in Process Monitor: swift.exe: RegQueryValue / BUFFER TOO SMALL, swift.exe: RegQueryValue / BUFFER OVERFLOW, etc. etc.. What can I do to make Swift (with SPM) usable on Windows? Any idea? Thanks! |
Comment by Stefan Springer (JIRA) See a newer discussion on a new Swift forums entry. |
Comment by Stefan Springer (JIRA) Some of the issues I ran into were solved by things that should be documented on the Getting Started page, see the new ticket #SR-15125 for suggestions of what to add there. Still remains one issue for me, see the new ticket #SR-15126. For this ticket: I do not know if the above BUFFER OVERFLOW errors are related my persisting problem or if they are somehow substantial. But somehow I think there should not be those errors. |
This warning is not from the Swift tooling but from other processes on the host. There is nothing that we can do here. |
Comment by Stefan Springer (JIRA)
The process monitor says that it is coming from swift.exe. But OK; I am not an expert here. |
Environment
Windows 10 Home in a Parallels 16 VM under macOS 11.5 on Intel using swift-5.4.2-RELEASE
Additional Detail from JIRA
md5: bf5b17b5707e16340adfddbea40948f8
is duplicated by:
Issue Description:
I had a Windows where German was the only installed language, and SPM got stuck after displaying the first "Fetching ..." (see my comment from July 25 and 26 on https://forums.swift.org/t/stochastic-errors-resolving-dependencies-and-or-building-with-feb-18-2021-snapshot/44929.)). Using Process monitor, I found:
swift.exe: RegQueryValue: BUFFER OVERFLOW: HKCU\Control Panel\Desktop\PreferredUILanguages
swift.exe: RegQueryValue: BUFFER OVERFLOW: HKCU\Control Panel\Desktop\MuiCached\MachinePreferredUILanguages
After adding dding "English (United States)"" as additional language and then setting the system language to English, the SPM then first went further (and displayed another error message about false package version which is also not OK as a message, but maybe that is another issue), but on another ty it again got stuck with the above errors.
An error that was always displayed in the process monitor was:
swift.exe: RegQueryValue: BUFFER TOO SMALL: HKLM\System\CurrentControlSet\Control\Notifications\418A073AA3BC8075
(The Swift package was https://github.com/stefanspringer1/SwiftXMLParserDemo.)
The text was updated successfully, but these errors were encountered: