error: ‘Proxy’ has no member named ‘include’ #44

issue dongcarl openend this issue on February 16, 2021
  1. dongcarl commented at 8:25 pm on February 16, 2021: none

    I’ve wiped away my libmultiprocess repo and tried to build and install it again, but am running into problems.

     0$ cmake ..
     1-- The CXX compiler identification is GNU 10.2.0
     2-- Detecting CXX compiler ABI info
     3-- Detecting CXX compiler ABI info - done
     4-- Check for working CXX compiler: /home/dongcarl/.local/bin/c++ - skipped
     5-- Detecting CXX compile features
     6-- Detecting CXX compile features - done
     7-- Looking for C++ include pthread.h
     8-- Looking for C++ include pthread.h - found
     9-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    10-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    11-- Looking for pthread_create in pthreads
    12-- Looking for pthread_create in pthreads - not found
    13-- Looking for pthread_create in pthread
    14-- Looking for pthread_create in pthread - found
    15-- Found Threads: TRUE
    16-- Looking for C++ include kj/filesystem.h
    17-- Looking for C++ include kj/filesystem.h - found
    18-- Performing Test HAVE_PTHREAD_GETNAME_NP
    19-- Performing Test HAVE_PTHREAD_GETNAME_NP - Success
    20-- Performing Test HAVE_PTHREAD_THREADID_NP
    21-- Performing Test HAVE_PTHREAD_THREADID_NP - Failed
    22-- Performing Test HAVE_PTHREAD_GETTHREADID_NP
    23-- Performing Test HAVE_PTHREAD_GETTHREADID_NP - Failed
    24-- Configuring done
    25-- Generating done
    26-- Build files have been written to: /home/dongcarl/src/libmultiprocess/build
    
     0$ make -j(nproc)
     1[ 14%] Compiling Cap'n Proto schema include/mp/proxy.capnp
     2Scanning dependencies of target multiprocess
     3[ 28%] Building CXX object CMakeFiles/multiprocess.dir/include/mp/proxy.capnp.c++.o
     4[ 42%] Building CXX object CMakeFiles/multiprocess.dir/src/mp/util.cpp.o
     5[ 57%] Building CXX object CMakeFiles/multiprocess.dir/src/mp/proxy.cpp.o
     6[ 71%] Linking CXX static library libmultiprocess.a
     7[ 71%] Built target multiprocess
     8Scanning dependencies of target mpgen
     9[ 85%] Building CXX object CMakeFiles/mpgen.dir/src/mp/gen.cpp.o
    10/home/dongcarl/src/libmultiprocess/src/mp/gen.cpp: In function void Generate(kj::StringPtr, kj::StringPtr, kj::StringPtr, kj::ArrayPtr<const kj::StringPtr>):
    11/home/dongcarl/src/libmultiprocess/src/mp/gen.cpp:166:77: warning: capnp::ParsedSchema capnp::SchemaParser::parseDiskFile(kj::StringPtr, kj::StringPtr, kj::ArrayPtr<const kj::StringPtr>) const is deprecated [-Wdeprecated-declarations]
    12  166 |     auto file_schema = parser.parseDiskFile(src_file, src_file, import_paths);
    13      |                                                                             ^
    14In file included from /home/dongcarl/src/libmultiprocess/src/mp/gen.cpp:9:
    15/usr/include/capnp/schema-parser.h:101:16: note: declared here
    16  101 |   ParsedSchema parseDiskFile(kj::StringPtr displayName, kj::StringPtr diskPath,
    17      |                ^~~~~~~~~~~~~
    18[100%] Linking CXX executable mpgen
    19[100%] Built target mpgen
    
     0$ make -j(nproc) check
     1[ 35%] Built target multiprocess
     2[ 50%] Built target mpgen
     3[ 57%] Generating src/mp/test/foo.capnp.h, src/mp/test/foo.capnp.c++, src/mp/test/foo.capnp.proxy.h, src/mp/test/foo.capnp.proxy-server.c++, src/mp/test/foo.capnp.proxy-client.c++, src/mp/test/foo.capnp.proxy-types.c++, src/mp/test/foo.capnp.proxy-types.h
     4/home/dongcarl/src/libmultiprocess/test/src/mp/test/foo.capnp:11:8-15: error: 'Proxy' has no member named 'include'
     5/home/dongcarl/src/libmultiprocess/test/src/mp/test/foo.capnp:12:8-20: error: 'Proxy' has no member named 'includeTypes'
     6terminate called after throwing an instance of 'std::runtime_error'
     7  what():  Invoking /usr/bin/capnp failed
     8make[3]: *** [test/CMakeFiles/mptest.dir/build.make:82: test/src/mp/test/foo.capnp.h] Aborted (core dumped)
     9make[2]: *** [CMakeFiles/Makefile2:578: test/CMakeFiles/mptest.dir/all] Error 2
    10make[1]: *** [CMakeFiles/Makefile2:207: test/CMakeFiles/check.dir/rule] Error 2
    11make: *** [Makefile:209: check] Error 2
    

    I get the same error when doing make -j1 check

    0$ git rev-parse HEAD
    1d576d975debdc9090bd2582f83f49c76c0061698
    
    0$ pacman -Qi capnproto | grep '^Version'
    1Version         : 0.8.0-1
    
    0$ pacman -Qi cmake | grep '^Version'
    1Version         : 3.19.2-1
    
  2. ryanofsky commented at 11:59 pm on February 16, 2021: collaborator

    Jonatack reported a similar problem https://github.com/bitcoin/bitcoin/pull/19160#issuecomment-771795995, but it was fixed by doing a clean build.

    I think this can only happen if you have a proxy.capnp that doesn’t have the new include and includeProxy directives https://github.com/chaincodelabs/libmultiprocess/blob/2ccc479f8666d680bd2c2b157554ec5a7ce39d33/include/mp/proxy.capnp#L10-L12 added in https://github.com/chaincodelabs/libmultiprocess/pull/43.

    I’m not sure why these would be missing if you have a clean checkout and build. Is it possible you ran make install previously and it is picking up a proxy.capnp installed somewhere else on your system? Hopefully it isn’t this since I would want the local proxy.capnp to take precedence over an external one, but it’s something to check.

  3. ryanofsky commented at 0:06 am on February 17, 2021: collaborator

    make VERBOSE=1 check output could be useful to see what the include order is. For me it does seem like local include directory is listed before the install include directory

    0[ 57%] Generating src/mp/test/foo.capnp.h, src/mp/test/foo.capnp.c++, src/mp/test/foo.capnp.proxy.h, src/mp/test/foo.capnp.proxy-server.c++, src/mp/test/foo.capnp.proxy-client.c++, src/mp/test/foo.capnp.proxy-types.c++, src/mp/test/foo.capnp.proxy-types.h
    1cd /home/russ/src/libmultiprocess/build/test && ../mpgen /home/russ/src/libmultiprocess/test /home/russ/src/libmultiprocess/test/src /home/russ/src/libmultiprocess/test/src/mp/test/foo.capnp /home/russ/src/libmultiprocess/include /home/russ/src/capnp/c++/prefix/include
    

    but I don’t recall exactly how these are processsed

  4. ryanofsky commented at 0:14 am on February 17, 2021: collaborator

    I see the code is actually hardcoding install paths before command line paths, so the following change might fix the problem without having to clear a previous install:

     0diff --git a/src/mp/gen.cpp b/src/mp/gen.cpp
     1index 4a0c1cc..36ba16a 100644
     2--- a/src/mp/gen.cpp
     3+++ b/src/mp/gen.cpp
     4@@ -598,6 +598,9 @@ int main(int argc, char** argv)
     5     auto fs = kj::newDiskFilesystem();
     6     auto cwd = fs->getCurrentPath();
     7 #endif
     8+    for (size_t i = 4; i < argc; ++i) {
     9+        import_paths.push_back(argv[i]);
    10+    }
    11     for (const char* path : {CMAKE_INSTALL_PREFIX "/include", capnp_PREFIX "/include"}) {
    12 #ifdef HAVE_KJ_FILESYSTEM
    13         KJ_IF_MAYBE(dir, fs->getRoot().tryOpenSubdir(cwd.evalNative(path))) { import_paths.emplace_back(path); }
    14@@ -605,9 +608,6 @@ int main(int argc, char** argv)
    15         import_paths.emplace_back(path);
    16 #endif
    17     }
    18-    for (size_t i = 4; i < argc; ++i) {
    19-        import_paths.push_back(argv[i]);
    20-    }
    21     Generate(argv[1], argv[2], argv[3], {import_paths.data(), import_paths.size()});
    22     return 0;
    23 }
    
  5. dongcarl commented at 9:52 pm on February 18, 2021: none

    I’m not sure why these would be missing if you have a clean checkout and build. Is it possible you ran make install previously and it is picking up a proxy.capnp installed somewhere else on your system? Hopefully it isn’t this since I would want the local proxy.capnp to take precedence over an external one, but it’s something to check.

    Yes I think that is the case! My /usr/local/include/mp/proxy.capnp does not have the 2 new lines:

     0--- /usr/local/include/mp/proxy.capnp	2020-12-09 11:56:57.000000000 -0500
     1+++ /home/dongcarl/src/libmultiprocess/include/mp/proxy.capnp	2021-02-16 15:19:23.480285524 -0500
     2@@ -7,6 +7,10 @@
     3 using Cxx = import "/capnp/c++.capnp";
     4 $Cxx.namespace("mp");
     5 
     6+annotation include(file): Text;
     7+annotation includeTypes(file): Text;
     8+# Extra include paths to add to generated files.
     9+
    10 annotation wrap(interface, struct): Text;
    11 # Wrap capnp interface generating ProxyClient / ProxyServer C++ classes that
    12 # forward calls to a C++ interface with same methods and parameters. Text
    

    I will try your diff to src/mp/gen.cpp and see if that works. It worked! make check passed and a subsequent make install made the aforementioned diff disappear. Probably a good idea to push it to master?

  6. dongcarl commented at 7:15 pm on March 3, 2021: none
    Friendly ping! ☺️
  7. ryanofsky referenced this in commit 1007bd7c2b on Mar 15, 2021
  8. ryanofsky referenced this in commit b648f2a13d on Mar 15, 2021
  9. ryanofsky commented at 6:48 pm on March 15, 2021: collaborator

    Friendly ping! ☺️

    Sorry for delay. Merged fix above in #47. Thanks for finding the issue and testing the fix!

  10. ryanofsky closed this on Mar 15, 2021

  11. bitcoin-core locked this on Jun 25, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-04 19:30 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me