browser icon indicating copy to clipboard operation
browser copied to clipboard

Build failure in easy_lock.h (V8 build)

Open kiefernforst opened this issue 5 months ago • 1 comments

When build lightpanda from source:

RUN zig build -Doptimize=ReleaseFast \
    -Dprebuilt_v8_path=v8/libc_v8.a \
    snapshot_creator -- src/snapshot.bin

it fails at a part of curl, probably https://github.com/curl/curl/blob/master/lib/easy_lock.h :

/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:63:47: error: unknown type name 'atomic_int'
static CURL_INLINE void curl_simple_lock_lock(curl_simple_lock *lock)
                                              ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:44:31: note: expanded from macro 'curl_simple_lock'
#define curl_simple_lock      atomic_int
                              ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:66:9: error: call to undeclared function 'atomic_exchange_explicit'; ISO C99 and later do not support implicit function declarations
    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
        ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:66:46: error: use of undeclared identifier 'memory_order_acquire'
    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
                                             ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:69:11: error: call to undeclared function 'atomic_load_explicit'; ISO C99 and later do not support implicit function declarations
    while(atomic_load_explicit(lock, memory_order_relaxed)) {
          ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:69:38: error: use of undeclared identifier 'memory_order_relaxed'
    while(atomic_load_explicit(lock, memory_order_relaxed)) {
                                     ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:84:49: error: unknown type name 'atomic_int'
static CURL_INLINE void curl_simple_lock_unlock(curl_simple_lock *lock)
                                                ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:44:31: note: expanded from macro 'curl_simple_lock'
#define curl_simple_lock      atomic_int
                              ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:86:3: error: call to undeclared function 'atomic_store_explicit'; ISO C99 and later do not support implicit function declarations
  atomic_store_explicit(lock, false, memory_order_release);
  ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:86:38: error: use of undeclared identifier 'memory_order_release'
  atomic_store_explicit(lock, false, memory_order_release);
                                     ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/version.c:35:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:63:47: error: unknown type name 'atomic_int'
static CURL_INLINE void curl_simple_lock_lock(curl_simple_lock *lock)
                                              ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:44:31: note: expanded from macro 'curl_simple_lock'
#define curl_simple_lock      atomic_int
                              ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:66:9: error: call to undeclared function 'atomic_exchange_explicit'; ISO C99 and later do not support implicit function declarations
    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
        ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:66:46: error: use of undeclared identifier 'memory_order_acquire'
    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
                                             ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:69:11: error: call to undeclared function 'atomic_load_explicit'; ISO C99 and later do not support implicit function declarations
    while(atomic_load_explicit(lock, memory_order_relaxed)) {
          ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:69:38: error: use of undeclared identifier 'memory_order_relaxed'
    while(atomic_load_explicit(lock, memory_order_relaxed)) {
                                     ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:84:49: error: unknown type name 'atomic_int'
static CURL_INLINE void curl_simple_lock_unlock(curl_simple_lock *lock)
                                                ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:44:31: note: expanded from macro 'curl_simple_lock'
#define curl_simple_lock      atomic_int
                              ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:86:3: error: call to undeclared function 'atomic_store_explicit'; ISO C99 and later do not support implicit function declarations
  atomic_store_explicit(lock, false, memory_order_release);
  ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:86:38: error: use of undeclared identifier 'memory_order_release'
  atomic_store_explicit(lock, false, memory_order_release);
                                     ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/hostip.c:61:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:63:47: error: unknown type name 'atomic_int'
static CURL_INLINE void curl_simple_lock_lock(curl_simple_lock *lock)
                                              ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:44:31: note: expanded from macro 'curl_simple_lock'
#define curl_simple_lock      atomic_int
                              ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:66:9: error: call to undeclared function 'atomic_exchange_explicit'; ISO C99 and later do not support implicit function declarations
    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
        ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:66:46: error: use of undeclared identifier 'memory_order_acquire'
    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
                                             ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:69:11: error: call to undeclared function 'atomic_load_explicit'; ISO C99 and later do not support implicit function declarations
    while(atomic_load_explicit(lock, memory_order_relaxed)) {
          ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:69:38: error: use of undeclared identifier 'memory_order_relaxed'
    while(atomic_load_explicit(lock, memory_order_relaxed)) {
                                     ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:84:49: error: unknown type name 'atomic_int'
static CURL_INLINE void curl_simple_lock_unlock(curl_simple_lock *lock)
                                                ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:44:31: note: expanded from macro 'curl_simple_lock'
#define curl_simple_lock      atomic_int
                              ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:86:3: error: call to undeclared function 'atomic_store_explicit'; ISO C99 and later do not support implicit function declarations
  atomic_store_explicit(lock, false, memory_order_release);
  ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:86:38: error: use of undeclared identifier 'memory_order_release'
  atomic_store_explicit(lock, false, memory_order_release);
                                     ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:10: note: in file included from /.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:78:
#include "easy_lock.h"
         ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy.c:86:8: error: unknown type name 'atomic_int'
static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT;
       ^
/.cache/zig/p/N-V-__8AALp9QAGn6CCHZ6fK_FfMyGtG824LSHYHHasM3w-y/lib/easy_lock.h:44:31: note: expanded from macro 'curl_simple_lock'
#define curl_simple_lock      atomic_int
                              ^

IMHO lightpanda uses curl 8.18.0. Where can I find the build flags zig uses?

kiefernforst avatar Jun 09 '26 12:06 kiefernforst

Here is how we build curl: https://github.com/lightpanda-io/browser/blob/main/build.zig#L468-L799

krichprollsch avatar Jun 09 '26 13:06 krichprollsch