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
NixOS compatibility #469
Comments
Hi, irony-server needs the Clang builtin headers to be available at runtime.
You can look up the value for the CMake cache:
Irony expects to find I'm not familiar with nix, but in the nix file, there is this: buildInputs = [ llvmPackages.libclang ]; I'm wondering, if you shouldn't also put a runtime dependency on libclang. Does |
A simple solution (that would be extremely useful to me, at least :) would be to provide a way to execute the |
Regarding C (and probably C++) headers: the solution I found is to use |
@thblt hi, I'm on NixOS too. My problem is that something like #include fails (array: file not found) while other things (like function argument completition) are working. I'm using meson+ninja to compile my projects. It creates the compile_commands.json file, do you know if there's a way to get the complete paths with it? Do you have an example json file? (Maybe I can programmatically fix mine). Thanks, Nicolò |
@nico202 I know neither meson nor ninja, sorry.
Sure, here you are: (expand)[
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-Ddylib_EXPORTS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-fPIC",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/dylib.dir/src/eval.c.o",
"../src/eval.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../src/eval.c"
},
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-Ddylib_EXPORTS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-fPIC",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/dylib.dir/src/stack.c.o",
"../src/stack.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../src/stack.c"
},
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-Ddylib_EXPORTS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-fPIC",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/dylib.dir/src/print.c.o",
"../src/print.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../src/print.c"
},
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-Ddylib_EXPORTS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-fPIC",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/dylib.dir/src/stbl.c.o",
"../src/stbl.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../src/stbl.c"
},
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/tests.dir/tests/main.c.o",
"../tests/main.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../tests/main.c"
},
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/tests.dir/tests/object_test.c.o",
"../tests/object_test.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../tests/object_test.c"
},
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-Ddylib_EXPORTS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-fPIC",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/dylib.dir/src/read.c.o",
"../src/read.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../src/read.c"
},
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-Ddylib_EXPORTS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-fPIC",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/dylib.dir/src/heap.c.o",
"../src/heap.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../src/heap.c"
},
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-Ddylib_EXPORTS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-fPIC",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/dylib.dir/src/object.c.o",
"../src/object.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../src/object.c"
},
{
"arguments": [
"cc",
"-c",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector-strong",
"--param",
"ssp-buffer-size=4",
"-fno-strict-overflow",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
"-fPIC",
"-DUBW_EXPOSE_INTERNALS",
"-I/home/thblt/Documents/Code/uberwald",
"-I/home/thblt/Documents/Code/uberwald/build",
"-I/home/thblt/Documents/Code/uberwald/src",
"-Wall",
"-std=c11",
"-pedantic",
"-B/nix/store/zikcg4s36w5k6fvlba2h4p4riw1qc7fp-gcc-7.3.0-lib/lib",
"-B/nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/",
"-idirafter",
"/nix/store/lyd89mv72m8a0aw1a4idfimyi0rb2b13-glibc-2.27-dev/include",
"-idirafter",
"/nix/store/imfm3gk3qchmyv7684pjpm8irvkdrrkk-gcc-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed",
"-B/nix/store/yz6kinf4ia19r1c14yirl6x4ciwgzk67-gcc-wrapper-7.3.0/bin/",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-isystem",
"/nix/store/05n22pf74svp88cd6yzip3wyglfdsxra-readline-6.3p08-dev/include",
"-isystem",
"/nix/store/8f9y0q8js3iys67j1rv4jvgj9ziwswzw-ncurses-6.1-dev/include",
"-isystem",
"/nix/store/bivzcgz9yakgzhvq7pcqjny6aw4mvwf7-clang-5.0.2/include",
"-isystem",
"/nix/store/v9f9s9wr2b86jyvchcilv9raxn4yvk6z-check-0.12.0/include",
"-isystem",
"/nix/store/pz8nl4cnppd3p1cykshcb40mqxjd5yvy-python3-3.6.5/include",
"-isystem",
"/nix/store/p2mffbw6fbx0jy1iyzxha5kqw58kirab-libffi-3.2.1-dev/include",
"-isystem",
"/nix/store/l2zz648qylzhlpm41vvb76nv25yhfzaq-lldb-5.0.2/include",
"-o",
"CMakeFiles/tests.dir/tests/stack_test.c.o",
"../tests/stack_test.c"
],
"directory": "/home/thblt/Documents/Code/uberwald/build",
"file": "../tests/stack_test.c"
}
] |
Firstly, thanks for this great tool!
So I intend this issue to cover all NixOS related issues, which I've spent some time on now. I've managed to solve some of them, but would still write them here for the future.
There may be many things intersecting with non-NixOS issues, or may have solutions which do not require knowledge of Nix, and that's where I'd really appreciate your help (I've already spent a lot of time to get a basic setup working).
Really sorry for the super long post coming up now 😄 I've spent wayy too long on this, and think I need some expert help now.
TLDR;
std::xyz
do not work, even though imports work fine. C headers work after hardcoding paths in.clang_complete
, why is this not automatic?Issues:
libclang is not found when
irony-install-server
is run. (Done, Finicky)This is because Nix believes libraries should not be globally available. That means that there cannot be a globally available libclang (except in a buildFHSUserEnv nix-shell, still trying to make this build inside a nix-shell). So
irony-install-server
is rendered useless. I instead use theirony-server-1.2.0
binary built bynixpkgs
(compatible with current melpa version).Here is the nix recipe for irony-server.
For some reason, I sometimes found the
irony-server-1.1.0
installed on my system, which threw errors. I have no idea why that happened, it isn't happening now and I'm happy. Although, this may be of relevance. If someone can explain, it'll be great:How would irony find the include paths for standard C headers? (Done, Not ideal)
I presume irony does not use some paths determined at compile time, to find those headers. Because, well, the above recipe compiles and builds the binary, but that binary does not seem to find these headers during runtime (without a clang_complete). Ideally, this should've worked automatically. Please correct me if I am wrong somewhere.
I am not familiar with RPATH, can it have something to do with this? Can we modify the above nix-recipe to fix this? Update: I built irony-server with the RPATH flags as well, did not help.
Currently, I ran this command
echo | g++ -E -Wp,-v -
which showed the following (I have removed the irrelevant package-identifying hashes):I copied the above listed 4 paths (
<...> search starts here
ones), prepended them with a-I
each, and placed them into a.clang_complete
file in my project root. Voila! I could get completions for C functions. Definitely not ideal, I wish irony could've done this automatically. Hardcoding paths is not really Nix-y.Can we automate C-header search? (Enhancement)
The above should've been automatic though 😞 I already get completions for C headers using the
company-c-headers
plugin (I think). Although once flycheck runs (irony checker), it marks those headers with errors like:'stdio.h' not found
.C++ headers? (Not ideal)
No completions for these. Flycheck also shows errors. Could not get even
std
to work. Then, I got them to work for my project by adding the following to my.clang_complete
(made it the last entry):No idea why this did not appear in the output of
echo | g++ -E -Wp,-v -
. Explanations for this are welcome.Why do C++ headers work fine, but I cannot refer to anything inside
std::
? (Not working)If I place
-I/nix/store/...-gcc-6.4.0/include/c++/6.4.0
as my first include,using namespace std;
does not show an error. Writing#include <iostream>
also works fine. But if I try to accessstd::cout
orcout
, that errors saying it is an unidentified identifier.Outside-project support (Not ideal)
I cannot get anything to work outside a project (which means, without a
.clang_complete
file). I sometimes write simple short C++ files, and would like irony to detect C/C++ headers in that case, rather than show me a dozen errors, starting frommemory.h
to C++ ones likeiostream
.Update: I put a global
.clang_complete
file with those headers and this works.Support information:
NixOS 17.09
Emacs 25.3.1
Irony config:
The text was updated successfully, but these errors were encountered: