Skip to content

Error: Unable to Index Using mx-index - Issue Invoking Original Compiler #577

@bsdb0y

Description

@bsdb0y

I am encountering an issue when trying to use mx-index to index the c-ares project after generating a compile_commands.json file using either bear or cmake. The command I am running is:

/root/multi/bin/mx-index --db lib.db --target c-ares/build/compile_commands.json --workspace ./mx

However, I consistently receive errors indicating that the original compiler (/usr/sbin/clang) cannot be invoked to retrieve version information, with an "Invalid argument" error. Below is a sample of the error output:

Error:

E20250331 10:37:02.274544 35908 Importer.cpp:692] Error invoking original compiler to find version information: Invalid argument; original command was: /usr/sbin/clang -DCARES_NO_DEPRECATED -DHAVE_CONFIG_H=1 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -I/root/prjs/c-ares/build -I/root/prjs/c-ares -I/root/prjs/c-ares/src/lib -I/root/prjs/c-ares/src/lib/include -I/root/prjs/c-ares/include -I/root/prjs/c-ares/src/tools -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdouble-promotion -Wfloat-equal -Wformat-security -Winit-self -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpedantic -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow -Wstrict-prototypes -Wundef -Wunreachable-code -Wunused -Wvariadic-macros -Wvla -Wwrite-strings -Werror=implicit-int -Werror=implicit-function-declaration -Werror=partial-availability -Qunused-arguments -Wno-long-long -std=gnu90 -c -o CMakeFiles/adig.dir/adig.c.o /root/prjs/c-ares/src/tools/adig.c. Perhaps try --env /path/to/file to specify a file containing environment variables, to help me find the compiler executable
E20250331 10:37:02.275046 35906 Importer.cpp:692] Error invoking original compiler to find version information: Invalid argument; original command was: /usr/sbin/clang -DCARES_NO_DEPRECATED -DHAVE_CONFIG_H=1 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -I/root/prjs/c-ares/build -I/root/prjs/c-ares -I/root/prjs/c-ares/src/lib -I/root/prjs/c-ares/src/lib/include -I/root/prjs/c-ares/include -I/root/prjs/c-ares/src/tools -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdouble-promotion -Wfloat-equal -Wformat-security -Winit-self -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpedantic -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow -Wstrict-prototypes -Wundef -Wunreachable-code -Wunused -Wvariadic-macros -Wvla -Wwrite-strings -Werror=implicit-int -Werror=implicit-function-declaration -Werror=partial-availability -Qunused-arguments -Wno-long-long -std=gnu90 -c -o CMakeFiles/ahost.dir/ares_getopt.c.o /root/prjs/c-ares/src/tools/ares_getopt.c. Perhaps try --env /path/to/file to specify a file containing environment variables, to help me find the compiler executable
E20250331 10:37:02.279376 35890 Importer.cpp:692] Error invoking original compiler to find version information: Invalid argument; original command was: /usr/sbin/clang -DCARES_NO_DEPRECATED -DHAVE_CONFIG_H=1 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -I/root/prjs/c-ares/build -I/root/prjs/c-ares -I/root/prjs/c-ares/src/lib -I/root/prjs/c-ares/src/lib/include -I/root/prjs/c-ares/include -I/root/prjs/c-ares/src/tools -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdouble-promotion -Wfloat-equal -Wformat-security -Winit-self -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpedantic -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow -Wstrict-prototypes -Wundef -Wunreachable-code -Wunused -Wvariadic-macros -Wvla -Wwrite-strings -Werror=implicit-int -Werror=implicit-function-declaration -Werror=partial-availability -Qunused-arguments -Wno-long-long -std=gnu90 -c -o CMakeFiles/ahost.dir/ahost.c.o /root/prjs/c-ares/src/tools/ahost.c. Perhaps try --env /path/to/file to specify a file containing environment variables, to help me find the compiler executable
E20250331 10:37:02.378388 35928 Importer.cpp:692] Error invoking original compiler to find version information: Invalid argument; original command was: /usr/sbin/clang -DCARES_BUILDING_LIBRARY -DHAVE_CONFIG_H=1 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -I/root/prjs/c-ares/build -I/root/prjs/c-ares -I/root/prjs/c-ares/include -I/root/prjs/c-ares/src/lib -I/root/prjs/c-ares/src/lib/include -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdouble-promotion -Wfloat-equal -Wformat-security -Winit-self -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpedantic -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow -Wstrict-prototypes -Wundef -Wunreachable-code -Wunused -Wvariadic-macros -Wvla -Wwrite-strings -Werror=implicit-int -Werror=implicit-function-declaration -Werror=partial-availability -Qunused-arguments -Wno-long-long -std=gnu90 -c -o CMakeFiles/c-ares_static.dir/util/ares_rand.c.o /root/prjs/c-ares/src/lib/util/ares_rand.c. Perhaps try --env /path/to/file to specify a file containing environment variables, to help me find the compiler executable
E20250331 10:37:02.378611 35912 Importer.cpp:692] Error invoking original compiler to find version information: Invalid argument; original command was: /usr/sbin/clang -DCARES_BUILDING_LIBRARY -DHAVE_CONFIG_H=1 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -I/root/prjs/c-ares/build -I/root/prjs/c-ares -I/root/prjs/c-ares/include -I/root/prjs/c-ares/src/lib -I/root/prjs/c-ares/src/lib/include -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdouble-promotion -Wfloat-equal -Wformat-security -Winit-self -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpedantic -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow -Wstrict-prototypes -Wundef -Wunreachable-code -Wunused -Wvariadic-macros -Wvla -Wwrite-strings -Werror=implicit-int -Werror=implicit-function-declaration -Werror=partial-availability -Qunused-arguments -Wno-long-long -std=gnu90 -c -o CMakeFiles/c-ares_static.dir/util/ares_threads.c.o /root/prjs/c-ares/src/lib/util/ares_threads.c. Perhaps try --env /path/to/file to specify a file containing environment variables, to help me find the compiler executable
...
...
...

Environment:

I have already tried using the --env option as suggested in the error message, but it did not resolve the issue. I provided a file with environment variables (e.g., PATH, CC, CXX), but the error persists.

Any guidance on resolving this or suggestions for additional debugging steps would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions