Skip to content

Conversation

@olpaw
Copy link
Member

@olpaw olpaw commented May 25, 2020

No description provided.

Copy link
Member

@peter-hofer peter-hofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really annoying issue. Have you considered compiling a temporary C file that prints _MSC_VER or _MSC_FULL_VER, like some build configuration tools do? These macros give you an integer that is relatively easy to deal with: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019

@olpaw
Copy link
Member Author

olpaw commented May 25, 2020

This is a really annoying issue. Have you considered compiling a temporary C file that prints _MSC_VER or _MSC_FULL_VER, like some build configuration tools do? These macros give you an integer that is relatively easy to deal with: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019

@olpaw olpaw closed this May 25, 2020
@olpaw olpaw reopened this May 25, 2020
@olpaw
Copy link
Member Author

olpaw commented May 25, 2020

This is a really annoying issue. Have you considered compiling a temporary C file that prints _MSC_VER or _MSC_FULL_VER, like some build configuration tools do? These macros give you an integer that is relatively easy to deal with: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019

See #2480 (comment)

@Ferhatos
Copy link

Hello,
Thank you for this investigation and fixe. I can't compile project, but I've the same problem with French version and GRAAL 20.1.0 :
Compilateur d'optimisation Microsoft (R) C/C++ version 19.00.24245 pour x64

Thanks

Ferhatos added a commit to Ferhatos/graal that referenced this pull request May 28, 2020
Branch : https://github.com/olpaw/graal/tree/paw/GR-23688-2480-take2

PR : oracle#2499 has not fixe issue for Germany and French languages.
This fixe w'll be better for any language
@olpaw
Copy link
Member Author

olpaw commented May 28, 2020

@Ferhatos are you sure you are testing on latest master.
Running the following check

--- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/c/codegen/CCompilerInvoker.java
+++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/c/codegen/CCompilerInvoker.java
@@ -73,6 +73,7 @@ public abstract class CCompilerInvoker {
     }
 
     public static CCompilerInvoker create(Path tempDirectory) {
+        testWindowsCCompilerInvoker(tempDirectory);
         OS hostOS = OS.getCurrent();
         switch (hostOS) {
             case LINUX:
@@ -86,6 +87,11 @@ public abstract class CCompilerInvoker {
         }
     }
 
+    public static void testWindowsCCompilerInvoker(Path tempDirectory) {
+        CompilerInfo res = WindowsCCompilerInvoker.createCompilerInfoImpl(null, new Scanner("Compilateur d'optimisation Microsoft (R) C/C++ version 19.00.24245 pour x64"));
+        System.out.println(res);
+    }
+
     private static class WindowsCCompilerInvoker extends CCompilerInvoker {
 
         WindowsCCompilerInvoker(Path tempDirectory) {
@@ -122,7 +128,11 @@ public abstract class CCompilerInvoker {
         }
 
         @Override
-        protected CompilerInfo createCompilerInfo(Path compilerPath, Scanner outerScanner) {
+        protected CompilerInfo createCompilerInfo(Path compilerPath, Scanner scanner) {
+            return createCompilerInfoImpl(compilerPath, scanner);
+        }
+
+        private static CompilerInfo createCompilerInfoImpl(Path compilerPath, Scanner outerScanner) {
             try (Scanner scanner = new Scanner(outerScanner.nextLine())) {
                 String targetArch = null;
                 /* For cl.exe the first line holds all necessary information */

shows me that I can detect Compilateur d'optimisation Microsoft (R) C/C++ version 19.00.24245 pour x64 just fine.

@Ferhatos
Copy link

Ferhatos commented May 28, 2020

@olpaw ,
My proposal is to be more generic solution (no specific code for specific OS language), and to get informations in any OS language environment.

As I said, I've not tested. It was a proposal after reading code. Sorry for that.

So waiting for a snapshot or release so we can go into production with your fixe. Thanks.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

20.1.0 native-image-maven-plugin: Error: Unable to detect supported WINDOWS native software development toolchain.

4 participants