Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fail on macOS Ventura #1489

Closed
vjpr opened this issue Nov 11, 2022 · 4 comments
Closed

Build fail on macOS Ventura #1489

vjpr opened this issue Nov 11, 2022 · 4 comments
Labels
bug Something isn't working build An issue related to building or compiling

Comments

@vjpr
Copy link
Contributor

vjpr commented Nov 11, 2022

usockets error

See: https://discord.com/channels/876711213126520882/888839314056839309/1040680371282513921

rm -rf /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/*.o /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/**/*.o /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/*.a /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/*.bc
cd /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/ && /usr/local/opt/llvm@13/bin/clang -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -emit-llvm -flto="full"  -mmacosx-version-min=11.0 -fPIC -mmacosx-version-min=11.0 -fembed-bitcode -O3 -mtune=native -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -mtune=native -pthread  -DLIBUS_USE_OPENSSL=1 -DUWS_HTTPRESPONSE_NO_WRITEMARK=1  -DLIBUS_USE_BORINGSSL=1 -DWITH_BORINGSSL=1 -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion  -DUWS_WITH_PROXY -save-temps -I/Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src -I/Users/Vaughan/dev/fork/+bun/bun/src/deps/boringssl/include -I/Users/Vaughan/dev/fork/+bun/bun/src/deps/zlib -g   -DDU_DISABLE_RENAMING=1 -lstdc++ -fno-keep-static-consts -O3 -mtune=native -g -c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//bsd.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//context.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//loop.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//quic.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//socket.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//udp.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//crypto/openssl.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//crypto/wolfssl.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//eventing/epoll_kqueue.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//eventing/gcd.c /Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//eventing/libuv.c

/Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//eventing/epoll_kqueue.c:419:212: error: incompatible pointer to integer conversion assigning to 'uint64_t' (aka 'unsigned long long') from 'struct us_internal_callback_t *' [-Wint-conversion]
    do { struct kevent64_s *__kevp__ = (&event); __kevp__->ident = ((uintptr_t) internal_cb); __kevp__->filter = ((-7)); __kevp__->flags = (0x0002); __kevp__->fflags = (0); __kevp__->data = (0); __kevp__->udata = (internal_cb); __kevp__->ext[0] = (0); __kevp__->ext[1] = (0); } while(0);
                                                                                                                                                                                                                   ^ ~~~~~~~~~~~~~
/Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//eventing/epoll_kqueue.c:433:240: error: incompatible pointer to integer conversion assigning to 'uint64_t' (aka 'unsigned long long') from 'struct us_internal_callback_t *' [-Wint-conversion]
    do { struct kevent64_s *__kevp__ = (&event); __kevp__->ident = ((uintptr_t) internal_cb); __kevp__->filter = ((-7)); __kevp__->flags = (0x0001 | (repeat_ms ? 0 : 0x0010)); __kevp__->fflags = (0); __kevp__->data = (ms); __kevp__->udata = (internal_cb); __kevp__->ext[0] = (0); __kevp__->ext[1] = (0); } while(0);
                                                                                                                                                                                                                                               ^ ~~~~~~~~~~~~~

``/Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//eventing/epoll_kqueue.c:143:34: error: incompatible pointer to integer conversion passing 'struct us_poll_t *' to parameter of type 'long' [-Wint-conversion]
            if (__builtin_expect(poll, 1)) {
                                 ^~~~
/Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//eventing/epoll_kqueue.c:194:30: error: incompatible pointer to integer conversion passing 'struct us_poll_t *' to parameter of type 'long' [-Wint-conversion]
        if (__builtin_expect(poll, 1)) {
                             ^~~~
/Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//eventing/epoll_kqueue.c:186:21: warning: unused variable 'ts' [-Wunused-variable]
    struct timespec ts = {0, 0};
                    ^
/Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src//eventing/epoll_kqueue.c:238:40: error: incompatible pointer to integer conversion assigning to 'uint64_t' (aka 'unsigned long long') from 'struct us_poll_t *' [-Wint-conversion]
            loop->ready_polls[i].udata = new_poll;

Workaround

Used fix from: https://discord.com/channels/876711213126520882/1035092776901152778/1035097388941049926

make vendor identifier-cache bindings jsc dev CFLAGS="-Wno-int-conversion"

@vjpr
Copy link
Contributor Author

vjpr commented Nov 11, 2022

make identifier-cache task is failing:

/Users/Vaughan/.bun-tools/zig/zig run src/js_lexer/identifier_data.zig
thread 50504284 panic: Darwin is handled separately via std.zig.system.darwin module
Unable to dump stack trace: debug info stripped
make: *** [identifier-cache] Abort trap: 6

make bindings failing too:

/usr/local/opt/llvm@13/bin/clang++ -I/Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/uSockets/src -I/Users/Vaughan/dev/fork/+bun/bun/src/deps/uws/src -I/Users/Vaughan/dev/fork/+bun/bun/src/deps -I/Users/Vaughan/dev/fork/+bun/bun/src/deps/mimalloc/include -Isrc/napi -I/Users/Vaughan/dev/fork/+bun/bun/src/deps/boringssl/include -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/Headers -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/WebKitBuild/Release/ -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/WebKitBuild/Release/include -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/PrivateHeaders -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/WebKitBuild/Release/WTF/PrivateHeaders -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/bindings/ -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/builtins -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/bindings -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/bindings/webcore -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/bindings/webcrypto -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/bindings/sqlite -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/builtins/cpp -I -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/modules -I/Users/Vaughan/webkit-build/include -I/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/Source  -std=c++2a -DSTATICALLY_LINKED_WITH_JavaScriptCore=1 -DSTATICALLY_LINKED_WITH_WTF=1 -DSTATICALLY_LINKED_WITH_BMALLOC=1 -DBUILDING_WITH_CMAKE=1 -DBUN_SINGLE_THREADED_PER_VM_ENTRY_SCOPE=1 -DNDEBUG=1 -DNOMINMAX -DIS_BUILD -DBUILDING_JSCONLY__ -DASSERT_ENABLED=0 -fvisibility=hidden -fvisibility-inlines-hidden  \
		-mmacosx-version-min=11.0 \
		-O1 -mtune=native \
		-fno-exceptions \
		-fno-rtti \
		-ferror-limit=1000 \
		 \
		-g3 -c -o src/bun.js/debug-bindings-obj/BunJSCModule.o src/bun.js/bindings/BunJSCModule.cpp
src/bun.js/bindings/BunJSCModule.cpp:73:19: error: no member named 'setInspectable' in 'JSC::JSGlobalObject'
    globalObject->setInspectable(true);
    ~~~~~~~~~~~~  ^
1 error generated.

Was a Zig issue. The fork Bun uses for Zig doesn't work on macOS.

Workaround

brew install zig

ZIG=/usr/local/Cellar/zig/0.10.0/bin/zig make identifier-cache

Issue created: #1490

@vjpr vjpr changed the title Build fail: error: incompatible pointer to integer conversion passing 'struct us_poll_t *' to parameter of type 'long' [-Wint-conversion] Build fail on macOS Ventura Nov 11, 2022
@vjpr
Copy link
Contributor Author

vjpr commented Nov 11, 2022

Failed to build jsc

Command failing:

'/opt/homebrew/bin/ninja' '-C' '/Users/Vaughan/dev/fork/+bun/bun/src/bun.js/WebKit/WebKitBuild/Release' '-t' 'recompact'

Workaround

Just re-ran it make jsc...

@Electroid Electroid added the bug Something isn't working label Nov 11, 2022
@vjpr
Copy link
Contributor Author

vjpr commented Nov 11, 2022

errors with make identifier-cache jsc dev

Probably due to wrong zig version...

ZIG=/usr/local/Cellar/zig/0.10.0/bin/zig make identifier-cache jsc dev
/usr/local/Cellar/zig/0.10.0/bin/zig build headers-obj
/Users/Vaughan/dev/fork/+bun/bun/src/resolver/resolve_path.zig:43:22: error: invalid builtin function: '@minimum'
        min_length = @minimum(str.len, min_length);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Vaughan/dev/fork/+bun/bun/src/resolver/resolve_path.zig:195:22: error: invalid builtin function: '@minimum'
    const shortest = @minimum(normalized_from.len, normalized_to.len);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Vaughan/dev/fork/+bun/bun/src/resolver/resolve_path.zig:1260:6: error: empty test name must be omitted
test "" {
     ^~
/Users/Vaughan/dev/fork/+bun/bun/build.zig:596:70: error: no field named 'iterate' in struct 'fs.Dir.OpenDirOptions'
        var deps_dir = std.fs.cwd().openDir(deps_path, .{ .iterate = true }) catch continue;
                                                                     ^~~~
/usr/local/Cellar/zig/0.10.0/lib/zig/std/fs.zig:1640:32: note: struct declared here
    pub const OpenDirOptions = struct {
                               ^~~~~~
referenced by:
    build: /Users/Vaughan/dev/fork/+bun/bun/build.zig:515:13
    runBuild: /usr/local/Cellar/zig/0.10.0/lib/zig/build_runner.zig:231:32
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

/usr/local/Cellar/zig/0.10.0/lib/zig/std/build.zig:2314:31: error: deprecated; use addIncludePath
    pub const addIncludeDir = @compileError("deprecated; use addIncludePath");

@Electroid Electroid added the build An issue related to building or compiling label Nov 14, 2022
@Jarred-Sumner
Copy link
Collaborator

No longer failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build An issue related to building or compiling
Projects
None yet
Development

No branches or pull requests

3 participants