-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
windows: find out what is needed to run binary on clean system (visual studio c++ 2010 redist?) #276
Comments
It seems you have to install the Windows 7.1 SDK first: https://www.microsoft.com/en-us/download/details.aspx?id=8442 For x64 choose: GRMSDKX_EN_DVD.iso This is tested on Windows 10. |
In a VM with Windows 10 that has installed on it:
two clj-kondo.exe versions behave more normally (usage info is output upon execution with no arguments) from cmd.exe. The two versions I tested for clj-kondo were:
This system has (to my current recollection) never had Windows SDK for Windows 7 (version 7.1) installed on it. It also happens to have on it:
|
@sogaiu Does more normally also mean that it works correctly? E.g. |
@borkdude Yes, for both versions of clj-kondo installed, I got output about 0 errors and 0 warnings for the sample code you mentioned. |
I can confirm that on a fresh Win10 VM with
Here it should give a warning about a duplicate key... |
@borkdude similar results here -- no warnings and no errors. Out of curiosity, have you verified that clj-kondo is actually receiving the form? |
@sogaiu My bad, it turns out it worked perfectly.
You have to omit the quotes, else it's passed as a string literal apparently. |
@borkdude Nice that it works :) Keep hearing about quoting issues recently... Oddly enough, on the Windows 7 SP1 machine (where the execution is not normal), I have:
But there is no:
|
@sogaiu I compiled that version of clj-kondo.exe on a Windows 10 VM. @lispyclouds informed me that
on Windows 7 and Windows 10, so that might be the issue. I think it makes sense to only support Windows 10 going forward, since Windows 7 is reaching end of life soon? |
@borkdude Interesting, thanks for that. Sure, I suppose not supporting Windows 7 makes sense. Windows 10 support makes sense...but isn't there something between those two? |
@borkdude Sounds sensible. Do I understand it correctly that something apart from the clj-kondo executable is necessary for appropriate execution then? If so, does that suggest something extra (e.g. an installer, some dependency info expressed in scoop -- though I don't know if there is support for the redistributables there, etc.) would be helpful? |
Also see oracle/graal#1407 |
Another data point... Windows 10, clj-kondo.exe (v2019. 06.16-alpha) in PATH. Running "clj-kondo --lint -" cmd.exe: -:0:0: error: could not process file GNU Emacs 26.2.90: |
@scottdw Thanks for reporting! The more data we have on this, the better it is. In cmd.exe I'm seeing this:
which seems correct. I can't reproduce the problem you posted where In Emacs: could this be a path problem? I'm not sure. How did you install clj-kondo? Via scoop or manual download? Are you using other linters, that do work in Emacs? About this issue: did you have to install any extra dependencies to make clj-kondo run? What Visual Studio C++ redistributables do you have installed? |
@scottdw Additional comment. I just found out that with
Can you post your output from this command in Emacs? |
I'm pretty sure it's not a path issue, or at least not an issue finding the binary. Comparing the output in the scratch buffer between the following calls:
seems to indicate that it finds the binary, it just doesn't produce any output.
Perhaps running through Emacs is affecting which dynamic libraries are used when running clj-kondo. Running through the "Git Bash" shell (mingw based, like Emacs) produces similar results.
|
@scottdw Thanks for the feedback! I think I'll mark Windows as 'experimental' or 'unsupported' although I will keep providing the binaries built from Appveyor in the future. Until we've sorted this out. It seems the binary depends on external .dll and it's hard to say which, unless GraalVM clarifies this. See oracle/graal#1407. |
This might help in appveyor: https://lucasg.github.io/2018/04/29/Dependencies-command-line/ |
Based on recent experiments, I think it's likely that some of the supposed inconsistent behaviors may be the result of PATH variations. On Windows, apparently PATH may influence what DLLs get loaded. The following has lots more detail: https://docs.microsoft.com/en-us/windows/desktop/Dlls/dynamic-link-library-search-order I'm not sure, but my guess is that the section titled "Search Order for Desktop Applications" may be the relevant one for native-image programs. I looked for info on console programs, but so far haven't found anything relevant. Also found the following: https://github.com/numpy/numpy/wiki/windows-dll-notes It references the former (as well as other) documents and contains observations. Intend to digest it a bit. Possibly it's a better starting point. |
The most recent experiments I've done in a Windows 10 VM suggest that putting clj-kondo.exe and mscvr100.dll in the same directory often leads to a working situation (see below for why this may not always work). May be other folks can verify whether this works for them. My current impression is that it may be even safer / stabler if redirection / SxS is implemented as described here: https://github.com/numpy/numpy/wiki/windows-dll-notes#user-content-side-by-side-assemblies One of the issues this method appears to address is the one of "already-loaded" (previous loading) dll as described in the section: https://github.com/numpy/numpy/wiki/windows-dll-notes#user-content-which-dll
This is an issue because it may affect stability of execution as well as security and as a consequence related support issues may be more likely to arise as well. Another approach would be to have a statically compiled clj-kondo.exe, but this doesn't look practical yet. IIUC, this would require changes upstream from the Graal / native-image folks. |
As another data point, I've got Win 10 Pro and the C++ redistributable 2010 installed (10.0.4.40219 according to add/remove programs), and I can't get clj-kondo.exe to launch at all - it seems to just exit without reading anything from stdin. I tried the latest version on scoop and the I looked for |
Maybe related: oracle/graal#1469 |
@timgilbert IIUC, currently, even if clj-kondo.exe is run with the appropriate DLLs (ATM, I still think this is some appropriate version of mscvr100.dll), due to issues with native-image, I don't think it's likely to work on Windows. At one point I tested a private assembly situation for clj-kondo so it would use a mscvr100.dll that lived in the same directory as clj-kondo.exe, but that wasn't sufficient to get it to behave correctly. As far as we understand, there is at least one issue on the Graal side -- it's hard to say it's a Clojure issue, because native-image binaries for Linux and macos work appropriately. The link borkdude posted gives some details on our findings. I have tested an ugly work-around for a similar native-image project, but I'm not sure if it's worth implementing just yet. I am waiting on the Graal folks for a response. If it looks like it's going to be a long time before they address this issue (it's not clear yet whether they will want to or even if they wanted to, how long that might take), perhaps the work-around will be worth it for some cases. That's up to borkdude to decide for clj-kondo :) The work-around consists of using an additional program that can handle stdin / stdout communications properly to have it act as an intermediary / wrapper around Windows native-image programs generated from Clojure source. From testing, it looks like writing to / reading from files on secondary storage is something Windows native-image programs generated from Clojure source can handle. The intermediary would take what it receives on stdin, write it to a file and then invoke the native-image program with two file paths, one for the native-image program to read from and the other to write to. The native-image program would then read content from one of the files, perform its processing and write to the second file path provided to it. Subsequently, the wrapper program would read the content of the second file and send that out of its stdout. Not great, but it appears to work in my limited testing. |
Related: oracle/graal#1762 To avoid the dependency on a separate @bobvandette is looking into building the JDK static libraries for Windows with /MT (they are currently all built with /MD, which prevents native images from being built with /MT). He notes that this would likely increase the generated native image size - it is currently unknown by how much. |
Thanks @remkop! I subscribed to that issue. In my opinion, a larger native binary size is less of a problem than the .dll errors. |
It is msvcr100.dll not mscvr100.dll i think ... |
@mbbee Thanks! I fixed the typo in my previous comment. |
Fixed with GraalVM 19.3.0 |
platform
Windows
problem
clj-kondo.exe starts and quits immediately without showing output
@sogaiu reported this here: #145 (comment)
I think this is because GraalVM requires the Windows 7.1 SDK and/or may require specific versions of .dlls to be present in the system, but I'm not sure.
The text was updated successfully, but these errors were encountered: