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

Graal substitution for Windows #49

Closed
osmanrafiqss opened this issue Sep 18, 2019 · 5 comments
Closed

Graal substitution for Windows #49

osmanrafiqss opened this issue Sep 18, 2019 · 5 comments

Comments

@osmanrafiqss
Copy link
Contributor

Trying to create a native-image using Quarkus on Windows yields the following error:

Error: Error compiling query code (in C:\tmp\SVM-791803307606723357\NativeInfoDirectives.cpp). Compiler command CL C:\tmp\SVM-791803307606723357\NativeInfoDirectives.cpp /FeC:\tmp\SVM-791803307606723357\NativeInfoDirectives.exe output included error: [NativeInfoDirectives.cpp, C:\tmp\SVM-791803307606723357\NativeInfoDirectives.cpp(32) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory]

This seems to occur because the substitution provided in this class requires the POSIX header:
https://github.com/wildfly/wildfly-common/blob/master/src/main/java/org/wildfly/common/net/Substitutions.java

Would it make sense to identify the platform the substitution is being applied under and switch between either <unistd.h> or <winsock.h> as both header files define the gethostname method?
https://pubs.opengroup.org/onlinepubs/009695399/functions/gethostname.html
https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-gethostname

@dmlloyd
Copy link
Member

dmlloyd commented Sep 23, 2019

Could you please verify whether #51 fixes the issue for you?

@dmlloyd
Copy link
Member

dmlloyd commented Sep 23, 2019

I like the idea of including a substitution for winsock.h but I don't have any means of testing it unfortunately. We can try it once Windows builds cleanly :)

@osmanrafiqss
Copy link
Contributor Author

#51 fixes the issue to the extent that the code compiles, however I haven't been able to succesfully create and execute a Graal native-image build of Quarkus on Windows yet.

We should probably not merge this until we have verified the runtime behaviour is correct :)

@osmanrafiqss
Copy link
Contributor Author

Finally managed to get a native-image build of Quarkus working on Windows and the hostname is retrieved correctly using the winsock.h substitution :)

@ctomc
Copy link
Contributor

ctomc commented Mar 6, 2020

this is fixed in 1.5.4

@dmlloyd dmlloyd closed this as completed Oct 25, 2023
dmlloyd pushed a commit to osmanrafiqss/wildfly-common that referenced this issue Oct 25, 2023
dmlloyd added a commit that referenced this issue Oct 25, 2023
Fixes #49 - use winsock.h on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants