Bug 240378

Summary: Non-unified build broken in debug mode
Product: WebKit Reporter: Adrian Perez <aperez>
Component: Tools / TestsAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: dpino, lmoura, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

Description Adrian Perez 2022-05-13 04:48:42 PDT
/app/webkit/Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.cpp: In static member function ‘static void JSC::StructureMemoryManager::commitBlock(void*)’:
/app/webkit/Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.cpp:123:49: error: ‘PROT_READ’ was not declared in this scope
  123 |         mprotect(block, MarkedBlock::blockSize, PROT_READ | PROT_WRITE);
      |                                                 ^~~~~~~~~
/app/webkit/Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.cpp:123:61: error: ‘PROT_WRITE’ was not declared in this scope
  123 |         mprotect(block, MarkedBlock::blockSize, PROT_READ | PROT_WRITE);
      |                                                             ^~~~~~~~~~
/app/webkit/Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.cpp:123:9: error: ‘mprotect’ was not declared in this scope
  123 |         mprotect(block, MarkedBlock::blockSize, PROT_READ | PROT_WRITE);
      |         ^~~~~~~~
/app/webkit/Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.cpp: In static member function ‘static void JSC::StructureMemoryManager::decommitBlock(void*)’:
/app/webkit/Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.cpp:135:49: error: ‘PROT_NONE’ was not declared in this scope; did you mean ‘U_NT_NONE’?
  135 |         mprotect(block, MarkedBlock::blockSize, PROT_NONE);
      |                                                 ^~~~~~~~~
      |                                                 U_NT_NONE
/app/webkit/Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.cpp:135:9: error: ‘mprotect’ was not declared in this scope
  135 |         mprotect(block, MarkedBlock::blockSize, PROT_NONE);
      |         ^~~~~~~~
Comment 1 Adrian Perez 2022-05-13 04:49:33 PDT
We need to include <sys/mman.h> for OS(UNIX).
Comment 2 Adrian Perez 2022-05-13 04:57:51 PDT
Some more build issues with build-webkit --gtk --debug:

/app/webkit/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp: In function ‘std::error_code WebCore::ContentExtensions::compileRuleList(WebCore::ContentExtensions::ContentExtensionCompilationClient&, WTF::String&&, WTF::Vector<WebCore::ContentExtensions::ContentExtensionRule>&&)’:
/app/webkit/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:274:76: error: ‘crossThreadCopy’ was not declared in this scope
  274 |     callOnMainThread([ruleJSON = ruleJSON.isolatedCopy(), parsedRuleList = crossThreadCopy(parsedRuleList)] {
      |                                                                            ^~~~~~~~~~~~~~~
In file included from /app/webkit/WebKitBuild/Debug/WTF/Headers/wtf/StdLibExtras.h:33,
                 from /app/webkit/WebKitBuild/Debug/WTF/Headers/wtf/FastMalloc.h:26,
                 from /app/webkit/Source/WebCore/config.h:56,
                 from /app/webkit/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:26:
/app/webkit/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp: In lambda function:
/app/webkit/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:275:51: error: ‘parsedRuleList’ is not captured
  275 |         ASSERT(parseRuleList(ruleJSON).value() == parsedRuleList);
      |                                                   ^~~~~~~~~~~~~~
Comment 3 Adrian Perez 2022-05-13 05:51:13 PDT
One more issue:

In file included from /app/webkit/WebKitBuild/Debug/WTF/Headers/wtf/StdLibExtras.h:33,
                 from /app/webkit/WebKitBuild/Debug/WTF/Headers/wtf/FastMalloc.h:26,                         
                 from /app/webkit/Source/WebCore/config.h:56,                                                                                                  
                 from /app/webkit/Source/WebCore/workers/service/ServiceWorkerClients.cpp:26:
/app/webkit/Source/WebCore/workers/service/ServiceWorkerClients.cpp: In member function ‘void WebCore::ServiceWorkerClients::openWindow(WebCore::ScriptExecutio
nContext&, const WTF::String&, WTF::Ref<WebCore::DeferredPromise>&&)’:
/app/webkit/WebKitBuild/Debug/WTF/Headers/wtf/Assertions.h:174:56: error: ‘LOG_CHANNEL_PREFIXServiceWorker’ was not declared in this scope
  174 | #define LOG_CHANNEL(name) JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name)
      |                                                        ^~~~~~~~~~~~~~~~~~
Comment 4 Adrian Perez 2022-05-13 07:33:03 PDT
Pull request: https://github.com/WebKit/WebKit/pull/608
Comment 5 EWS 2022-05-13 15:03:31 PDT
Committed r294177 (250544@main): <https://commits.webkit.org/250544@main>

Reviewed commits have been landed. Closing PR #608 and removing active labels.
Comment 6 Radar WebKit Bug Importer 2022-05-13 15:04:14 PDT
<rdar://problem/93269326>