Skip to content
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

What .dlls are needed for a Windows binary? #1407

Open
borkdude opened this issue Jun 20, 2019 · 4 comments
Open

What .dlls are needed for a Windows binary? #1407

borkdude opened this issue Jun 20, 2019 · 4 comments

Comments

@borkdude
Copy link

borkdude commented Jun 20, 2019

If I'm compiling a binary on Windows 10 with GraalVM native, what .dlls are needed on other Windows 10 systems to be able to run this binary?

Does the --static option have any effect on this?

In installing Visual Studio C++ 2010 redistributable sufficient? After some testing it seems so.

Also, if there are any open source projects already building Windows binaries for distribution, I'd be happy to take a peek!

We have been able to compile a Windows binary on Appveyor, but it doesn't work on Windows 10 systems:
https://github.com/borkdude/clj-kondo/blob/master/appveyor.yml

@olpaw
Copy link
Member

olpaw commented Jun 24, 2019

Does the --static option have any effect on this?

It doesn't. See https://github.com/oracle/graal/blob/9ce4ed93a2797e922ff3a364e1f7b192984b9537/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeBootImageViaCC.java#L161win

In installing Visual Studio C++ 2010 redistributable sufficient?

Generally, yes. (E.g. zlib is not needed on Windows as it is included in jre\lib\zip.lib in graalvm-19.0.2 on Windows). If you need native-code security providers the same rules as on other platforms apply. (see https://github.com/oracle/graal/blob/master/substratevm/JCA-SECURITY-SERVICES.md). On Windows the dll is in jre\bin\sunec.dll.

cc @pejovica @cstancu

@sogaiu
Copy link

sogaiu commented Jul 5, 2019

For Windows 10, msvcr100.dll from VS C++ Redistributable 2010 appears to be sufficient for simple setups.

On a related note, due to Windows' different and complicated methods of determining which dlls to load, it appears significantly more complex than necessary (at least compared to macos and various linux distributions) to ensure the appropriate dll is loaded and not some other file that happens to have the same name.

Some details of these issues are touched upon here:

https://github.com/numpy/numpy/wiki/windows-dll-notes

After various false starts, I had some success with getting a side-by-side private assembly to work, which IIUC can ensure (or at least drastically increase the chance) that the specific dlls one wishes to have used by the executable to actually be used (instead of "already loaded" by the system ones, for example).

In the current situation though, to follow this approach, IIUC, we must provide an external application manifest as well as an external assembly manifest, and this process appears to have some undocumented gotchas:

http://csi-windows.com/blog/all/27-csi-news-general/245-find-out-why-your-external-manifest-is-being-ignored

From the perspective of debugging, deployment, and security, it would be nice to have the static compilation option.

@remkop
Copy link

remkop commented Oct 16, 2019

Are there any plans to include msvcr100.dll in the generated native image? I verified that with 19.2.1 this dll is still required as an external dependency to be able to execute the native image.

@anthonyvdotbe
Copy link

Please at least document the Visual C++ Redistributable deployment dependency in the getting started guide. Even the HelloWorld example doesn't run as-is on a vanilla Windows installation. For users new to GraalVM, who naively might think that it's "create a single executable and deploy anywhere", this is very surprising. This issue is 4.5 years old, yet the documentation still doesn't mention any deployment dependency. I created #7747 to do just this, only to have it closed after a very frustrating and time-consuming back and forth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants