You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "wa0nder (via GitHub)" <gi...@apache.org> on 2025/11/14 01:23:43 UTC

[I] main.cpp error when building from source [couchdb]

wa0nder opened a new issue, #5747:
URL: https://github.com/apache/couchdb/issues/5747

   I'm attempting to build CouchDB from source because I want a couchdb installation that is self-contained in a single folder on linux as with test builds. I am following these two links:
   
   https://github.com/apache/couchdb/blob/main/INSTALL.Unix.md
   https://cwiki.apache.org/confluence/display/COUCHDB/Testing+a+Source+Release
   
   As a quick aside, Mozilla SpiderMonkey 60 no longer has all of the necessary .h files and I had to change the rebar.config.script file to directly use mozjs128 like so: "-I/usr/include/mozjs-128 -I/usr/local/include/mozjs-128" to get a successful ./configure run.
   
   I have all of the dependencies installed already, successfully ran ./configure.
   
   And then I ran 'make release' (also tried 'make check') and encountered these two errors:
   ```
   
   Compiling /run/media/veracrypt2/couchdb/dist/apache-couchdb-3.5.1/src/couch/priv/couch_js/86/main.cpp
   /run/media/veracrypt2/couchdb/dist/apache-couchdb-3.5.1/src/couch/priv/couch_js/86/main.cpp:51:1: error: too many initializers for â
      51 | };
         | ^
   /run/media/veracrypt2/couchdb/dist/apache-couchdb-3.5.1/src/couch/priv/couch_js/86/main.cpp:257:1: error: invalid conversion from â {aka â} to â {aka â} [-fpermissive]
     257 | };
         | ^
         | |
         | bool (*)(JSContext*, JS::HandleString) {aka bool (*)(JSContext*, JS::Handle<JSString*>)}
   ```
   
   line 51 is this:
   
   ```
   static JSClassOps global_ops = {
       nullptr,
       nullptr,
       nullptr,
       nullptr,
       nullptr,
       nullptr,
       nullptr,
       nullptr,
       nullptr,
       nullptr,
       JS_GlobalObjectTraceHook
   };
   ```
   
   Can someone far more knowledgeable in C++ explain what this is doing and what this error means? I tried looking up vectors, scalars, structs, and array initialization and experimented with running some alternate formats (e.g. adding []) in an online c++ compiler but I still don't know exactly what is being initialized here and why it is breaking.  Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] main.cpp error when building from source [couchdb]

Posted by "big-r81 (via GitHub)" <gi...@apache.org>.
big-r81 commented on issue #5747:
URL: https://github.com/apache/couchdb/issues/5747#issuecomment-3531752605

   Only for the record:
   
   You did only `./configure` that means, the the build script is using SpiderMonkey v91 per default.
   You used SpiderMonkey v128, which has different C++ apis as v91. Iirc with more entries in the `JSClassOps` object. Thats why you get the compiler errors.
   If you want to build against v128 then you have to use: `./configure --spidermonkey-version 128` or as Nick mentioned, use QuickJS.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] main.cpp error when building from source [couchdb]

Posted by "wa0nder (via GitHub)" <gi...@apache.org>.
wa0nder commented on issue #5747:
URL: https://github.com/apache/couchdb/issues/5747#issuecomment-3534189148

   @big-r81 - appreciate the response! My mind will now stop nagging me about the error message 😃 
   
   Also, if SpiderMonkey v91 is now the actual default, perhaps the INSTALL.Unix file's [dependencies](https://github.com/apache/couchdb/blob/main/INSTALL.Unix.md#dependencies) section should be updated to reflect this, it currently says 1.8.5 or 60 are the only two accepted versions; a quick link to the rebar.config.script showing all the supported versions would be helpful I think.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] main.cpp error when building from source [couchdb]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on issue #5747:
URL: https://github.com/apache/couchdb/issues/5747#issuecomment-3530871932

   Not sure why you can't build it, we support these Spidermonkey versions:
   
   https://github.com/apache/couchdb/blob/95fe2013a1205c4d6ae612be925153415e853b04/src/couch/rebar.config.script#L82-L107
   
   I see 60 in there and but it requires specifying the version in the `./configure` command explicitly and requires having the mozjs dev library package installed (the include files, etc). For instance I can still build it with 1.8.5 with `./configure --spidermonkey-version 1.8.5`
   
   If you can't install Spidermonkey, as we've struggled with it (due to C++ api changes, and then it got removed from some OS base package like RHEL 10), you can try using the built-in QuickJS view engine with `./configure --disable-spidermonkey`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] main.cpp error when building from source [couchdb]

Posted by "wa0nder (via GitHub)" <gi...@apache.org>.
wa0nder commented on issue #5747:
URL: https://github.com/apache/couchdb/issues/5747#issuecomment-3530973442

   @nickva that worked like a charm, thank you! For anyone else that arrives here weary from hours of troubleshooting spidermonkey versions here are the two steps
   
   1. ./configure --disable-spidermonkey
   2. make release
   done!
   
   Is there any reason couchdb doesn't release a standalone binary on the main download page? It already seems part of the build process and sure makes it easy to move and/or backup your DB to other partitions, storage devices, etc.
   
   Also, not expected but for pure curiosity sake, it would be nice to know what about that c++ file is causing errors. I have gcc 15.2.1 installed; maybe I needed to use an older version of the compiler that recognized that syntax for initializing that data structure?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] main.cpp error when building from source [couchdb]

Posted by "wa0nder (via GitHub)" <gi...@apache.org>.
wa0nder closed issue #5747: main.cpp error when building from source
URL: https://github.com/apache/couchdb/issues/5747


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] main.cpp error when building from source [couchdb]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on issue #5747:
URL: https://github.com/apache/couchdb/issues/5747#issuecomment-3531098463

   > Is there any reason couchdb doesn't release a standalone binary on the main download page? It already seems part of the build process and sure makes it easy to move and/or backup your DB to other partitions, storage devices, etc.
   
   We provide binary packages for some OS-es: https://docs.couchdb.org/en/stable/install/unix.html. For some OS we'll provide QuickJS only versions (RHEL 10 is planned) which won't have a SM dependency. Now that still not a single standalone binary, but it's a bit closer.
   
   > Also, not expected but for pure curiosity sake, it would be nice to know what about that c++ file is causing errors. I have gcc 15.2.1 installed; maybe I needed to use an older version of the compiler that recognized that syntax for initializing that data structure?
   
   A new GCC version would make sense, yeah. A newer SM version could work perhaps, but only up to version 128 (140 is not supported see https://github.com/apache/couchdb/pull/5677).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] main.cpp error when building from source [couchdb]

Posted by "wa0nder (via GitHub)" <gi...@apache.org>.
wa0nder commented on issue #5747:
URL: https://github.com/apache/couchdb/issues/5747#issuecomment-3531132731

   I did see that link before and unfortunately I'm not on any of those distros. I tried finding the couchdb .deb file since .deb files usually have a standalone folder that can be extracted from the .deb and run but I couldn't get access to the Debian repository through a browser. Perhaps there's a direct way to grab it using curl but I didn't find how to do it.
   
   In any case, I'll close this as solved, thanks again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org