zenywallet / caprese

A front-end web server specialized for real-time message exchange
MIT License
52 stars 1 forks source link

nimble install fails on macos #2

Open meoyawn opened 13 hours ago

meoyawn commented 13 hours ago

I'm new to nim, it's a bit confusing if I need to built caprese from source or I can just nimble install

Apple M1 Pro macOS 15.1 nim 2.2.0 from homebrew

I ran:

mkdir nimserver
cd nimserver
nimble install https://github.com/zenywallet/caprese

lots of output, at the end:

CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/system/exceptions.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/std/private/threadtypes.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/std/private/digitsutils.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/std/assertions.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/system/dollars.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/std/typedthreads.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/std/syncio.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/system.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/parseutils.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/math.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/strutils.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/pathnorm.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/std/oserrors.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/posix/posix.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/std/private/oscommon.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/std/private/ospaths2.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/times.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/std/cmdline.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/hashes.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/concurrency/cpuinfo.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/osproc.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/collections/tables.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/mimetypes.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/base64.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/md5.nim
CC: ../../../../../../../../../../Users/adelnizamutdinov/.nimble/pkgs2/nimcrypto-0.6.2-8e3e42530f54c8c312942a89640b7e0f687f33a5/nimcrypto/utils.nim
CC: ../../../../../../../../../../Users/adelnizamutdinov/.nimble/pkgs2/nimcrypto-0.6.2-8e3e42530f54c8c312942a89640b7e0f687f33a5/nimcrypto/hash.nim
CC: ../../../../../../../../../../Users/adelnizamutdinov/.nimble/pkgs2/nimcrypto-0.6.2-8e3e42530f54c8c312942a89640b7e0f687f33a5/nimcrypto/sha2.nim
CC: zopfli_native.nim
CC: zopfli.nim
CC: brotli.nim
CC: queue.nim
CC: ../../../../../../../../../../opt/homebrew/Cellar/nim/2.2.0/nim/lib/pure/collections/sequtils.nim
CC: bytes.nim
CC: files_helper.nim
Hint:  [Link]
Hint: mm: orc; threads: on; opt: speed; options: -d:release
72475 lines; 3.752s; 141.102MiB peakmem; proj: /private/var/folders/21/4wlt1pmj2wq7rp1tn92x3mlc0000gn/T/nimble_95380/githubcom_zenywalletcaprese/src/caprese/files_helper.nim; out: /private/var/folders/21/4wlt1pmj2wq7rp1tn92x3mlc0000gn/T/nimble_95380/githubcom_zenywalletcaprese/src/bin/files_helper [SuccessX]
/private/var/folders/21/4wlt1pmj2wq7rp1tn92x3mlc0000gn/T/nimble_95380/githubcom_zenywalletcaprese/src/caprese.nim(420, 16) template/generic instantiation of `serverStart` from here
/private/var/folders/21/4wlt1pmj2wq7rp1tn92x3mlc0000gn/T/nimble_95380/githubcom_zenywalletcaprese/src/caprese/server.nim(5398, 14) template/generic instantiation of `serverLib` from here
/private/var/folders/21/4wlt1pmj2wq7rp1tn92x3mlc0000gn/T/nimble_95380/githubcom_zenywalletcaprese/src/caprese/server.nim(2985, 66) template/generic instantiation of `appListenBase` from here
/private/var/folders/21/4wlt1pmj2wq7rp1tn92x3mlc0000gn/T/nimble_95380/githubcom_zenywalletcaprese/src/caprese/server.nim(2981, 39) Error: attempting to call undeclared routine: 'accept4'
       Tip: 18 messages have been suppressed, use --verbose to show them.
nimble.nim(304)          buildFromDir

    Error:  Build failed for the package: caprese
meoyawn commented 12 hours ago

ah apparently accept4 is a linux-only feature and you have to define it for macos https://github.com/lpereira/lwan/blob/3b32adea27e92ece5cea72d6590d8f25a19e0dff/src/lib/missing.c#L85-L118

and there's a bunch of other missing things https://github.com/lpereira/lwan/blob/master/src/lib/missing-epoll.c