big-r81 opened a new issue, #5322: URL: https://github.com/apache/couchdb/issues/5322
## Description Trying to compile CouchDB with SpiderMonkey 128 (102, 115) on Windows. I used the provided SM binaries from https://github.com/big-r81/couchdb-sm/releases/tag/v0.0.7 We get many compiler warnings from the Mozilla sources and some errors too (Full log: [mozjs128.txt](https://github.com/user-attachments/files/17502715/mozjs128.txt)). For example: ``` C:\tools\Windows-mozjs-128\include\jspubtd.h(88): error C2146: syntax error: missing '}' before identifier 'JSProto_LIMIT' C:\tools\Windows-mozjs-128\include\jspubtd.h(89): error C2143: syntax error: missing ';' before '}' C:\tools\Windows-mozjs-128\include\jspubtd.h(89): error C2059: syntax error: '}' ``` Opening `jspubtd.h` shows the following: ``` 83 /* Dense index into cached prototypes and class atoms for standard objects. */ 84 enum JSProtoKey { 85 #define PROTOKEY_AND_INITIALIZER(name, clasp) JSProto_##name, 86 JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER) 87 #undef PROTOKEY_AND_INITIALIZER 88 JSProto_LIMIT 89 }; ``` or ``` C:\tools\Windows-mozjs-128\include\js/Class.h(589): error C2131: expression did not evaluate to a constant C:\tools\Windows-mozjs-128\include\js/Class.h(589): note: failure was caused by non-constant arguments or reference to a non-constant symbol C:\tools\Windows-mozjs-128\include\js/Class.h(589): note: see usage of 'JSProto_LIMIT' ``` `Class.h`: ``` 589 static_assert(JSProto_LIMIT <= (JSCLASS_CACHED_PROTO_MASK + 1), 590 "JSProtoKey must not exceed the maximum cacheable proto-mask"); ``` or ``` C:\tools\Windows-mozjs-128\include\js/Symbol.h(74): error C2146: syntax error: missing '}' before identifier 'Limit' C:\tools\Windows-mozjs-128\include\js/Symbol.h(75): error C2440: 'initializing': cannot convert from 'const uint32_t' to 'JS::SymbolCode' C:\tools\Windows-mozjs-128\include\js/Symbol.h(75): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or parenthesized function-style cast) C:\tools\Windows-mozjs-128\include\js/Symbol.h(76): error C2440: 'initializing': cannot convert from 'unsigned int' to 'JS::SymbolCode' C:\tools\Windows-mozjs-128\include\js/Symbol.h(76): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or parenthesized function-style cast) C:\tools\Windows-mozjs-128\include\js/Symbol.h(77): error C2440: 'initializing': cannot convert from 'unsigned int' to 'JS::SymbolCode' C:\tools\Windows-mozjs-128\include\js/Symbol.h(77): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or parenthesized function-style cast) C:\tools\Windows-mozjs-128\include\js/Symbol.h(79): error C2440: 'initializing': cannot convert from 'unsigned int' to 'JS::SymbolCode' C:\tools\Windows-mozjs-128\include\js/Symbol.h(79): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or parenthesized function-style cast) C:\tools\Windows-mozjs-128\include\js/Symbol.h(80): error C2143: syntax error: missing ';' before '}' ``` `Symbol.h`: ``` 68 enum class SymbolCode : uint32_t { 69 // There is one SymbolCode for each well-known symbol. 70 #define JS_DEFINE_SYMBOL_ENUM(name) name, 71 JS_FOR_EACH_WELL_KNOWN_SYMBOL( 72 JS_DEFINE_SYMBOL_ENUM) // SymbolCode::iterator, etc. 73 #undef JS_DEFINE_SYMBOL_ENUM 74 Limit, 75 WellKnownAPILimit = JS::shadow::Symbol::WellKnownAPILimit, 76 PrivateNameSymbol = 0xfffffffd, // created by the #PrivateName syntax. 77 InSymbolRegistry = 78 0xfffffffe, // created by Symbol.for() or JS::GetSymbolFor() 79 UniqueSymbol = 0xffffffff // created by Symbol() or JS::NewSymbol() 80 }; ``` A complete list of warnings and errors are in the full log: [mozjs128.txt](https://github.com/user-attachments/files/17502715/mozjs128.txt) My first idea is, that it maybe has something to do with the Microsoft compiler `cl.exe` or maybe a C++ standard? Maybe the compiler switch get not recognized by rebar from the [script](https://github.com/apache/couchdb/pull/5321/files#diff-19178ad1040cc41a60b3efec4a61bebea2a293db779ba22b7d4e3a7e1115a502R233-R237)? ## Steps to Reproduce 0. All happens on Windows 1. Checkout `couchdb` with the branch `jenkins-simplify-spidermonkeys` 2. Checkout `couchdb-glazier` 3. Download `Windows-mozjs-128` 4. Add it to the `$env:{PATH,LIB,INCLUDE,LIBPATH}` environment variables in `couchdb-glazier/bin/shell.ps1` 5. Open Powershell and call `shell.ps1` 6. CD into the couchdb source directory 7. Run `.\configure.ps1 -SpiderMonkeyVersion 128 -DisableDocs -DisableFauxton` 8. Run `.\make.cmd` 9. See the errors from above A did a quick test for SpiderMonkey v102 too and the problems are similar! Maybe @nickva and @pgj can have a look and try to reproduce this? -- 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-unsubscr...@couchdb.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org