koreader / koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
http://koreader.rocks/
GNU Affero General Public License v3.0
16.31k stars 1.24k forks source link

unable to build v2024.07-71-g5daff2579 on macos sonoma 14.6.1 (Macbook Air M2) #12314

Closed truatpasteurdotfr closed 1 month ago

truatpasteurdotfr commented 1 month ago

Issue

Unable to complete the ./kodev build stage

Steps to reproduce

env gcc -Iglib/libglib-2.0.a.p -Iglib -I../source/glib -I. -I../source -I/Users/tru/github/koreader/base/build/arm64-apple-darwin23.6.0-debug/staging/include -fdiagnostics-color=always -Wall -Winvalid-pch -std=gnu89 -O0 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -Wall -Wmisleading-indentation -Wstrict-prototypes -Wunused -Wno-bad-function-cast -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-include-dirs -Werror=missing-prototypes -Werror=pointer-arith -Og -g -pipe -fno-omit-frame-pointer -ffile-prefix-map=/Users/tru/github/koreader/base/= -mcpu=apple-m1 -fPIC '-DG_LOG_DOMAIN="GLib"' -DGLIB_COMPILATION -MD -MQ glib/libglib-2.0.a.p/gdataset.c.o -MF glib/libglib-2.0.a.p/gdataset.c.o.d -o glib/libglib-2.0.a.p/gdataset.c.o -c ../source/glib/gdataset.c
../source/glib/gdataset.c:1198:3: error: incompatible integer to pointer conversion passing 'gsize' (aka 'unsigned long') to parameter of type 'GData *' (aka 'struct _GData *') [-Wint-conversion]
  g_atomic_pointer_or (datalist, (gsize)flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source/glib/gatomic.h:243:44: note: expanded from macro 'g_atomic_pointer_or'
    (gsize) __sync_fetch_and_or ((atomic), (val));                           \
                                           ^~~~~
../source/glib/gdataset.c:1221:3: error: incompatible integer to pointer conversion passing 'gsize' (aka 'unsigned long') to parameter of type 'GData *' (aka 'struct _GData *') [-Wint-conversion]
  g_atomic_pointer_and (datalist, ~(gsize)flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source/glib/gatomic.h:236:45: note: expanded from macro 'g_atomic_pointer_and'
    (gsize) __sync_fetch_and_and ((atomic), (val));                          \
                                            ^~~~~
2 errors generated.
      | [glib   3%] Compiling C object glib/libglib-2.0.a.p/gconvert.c.o
      | [glib   5%] Compiling C object glib/libglib-2.0.a.p/gdate.c.o
      | [glib   6%] Compiling C object glib/libglib-2.0.a.p/gdatetime.c.o
      | [glib   7%] Compiling C object glib/libglib-2.0.a.p/gchecksum.c.o
ninja: build stopped: subcommand failed.
FAILED: /Users/tru/github/koreader/base/build/arm64-apple-darwin23.6.0-debug/thirdparty/glib/stamp/build
cd /Users/tru/github/koreader/base/build/arm64-apple-darwin23.6.0-debug/thirdparty/glib/build && : "" && set -- glib "Building 'glib'" 0 /Users/tru/github/koreader/base/build/arm64-apple-darwin23.6.0-debug/thirdparty/glib/stamp/build && . /Users/tru/github/koreader/base/build/arm64-apple-darwin23.6.0-debug/cmake/koenv.sh && run ninja glib/libglib-2.0.a && /opt/homebrew/Cellar/cmake/3.30.2/bin/cmake -E cmake_transform_depfile Ninja gccdepfile /Users/tru/github/koreader/base/cmake /Users/tru/github/koreader/base/thirdparty/glib /Users/tru/github/koreader/base/build/arm64-apple-darwin23.6.0-debug/cmake /Users/tru/github/koreader/base/build/arm64-apple-darwin23.6.0-debug/thirdparty/glib /Users/tru/github/koreader/base/build/arm64-apple-darwin23.6.0-debug/thirdparty/glib/build.d /Users/tru/github/koreader/base/build/arm64-apple-darwin23.6.0-debug/cmake/CMakeFiles/d/67708e3725be1e397816ace4d1a977c7d96f17fa1c1a85fef6df44fcad20512d.d
ninja: build stopped: subcommand failed.
make: *** [base/Makefile:89: base-all] Error 1
Failed to build emulator! Try run with -v for more information.
truatpasteurdotfr commented 1 month ago
tru@bisadms-Air koreader % sw_vers
ProductName:        macOS
ProductVersion:     14.6.1
BuildVersion:       23G93
tru@bisadms-Air koreader % git describe --tag
v2024.07-71-g5daff2579
tru@bisadms-Air koreader % cat koreader-buildenv-setup.sh
export PATH="$(brew --prefix)/opt/findutils/libexec/gnubin:$(brew --prefix)/opt/gnu-getopt/bin:$(brew --prefix)/opt/make/libexec/gnubin:$(brew --prefix)/opt/util-linux/bin:${PATH}"
export PATH="/usr/local/bin:/usr/local/sbin:${PATH/:\/usr\/local\/bin/}"
export MACOSX_DEPLOYMENT_TARGET=10.09

From a new shell where koreader was checkout:

git clone https://github.com/koreader/koreader.git
cd koreader && ./kodev fetch-thirdparty
source koreader-buildenv-setup.sh
./kodev build
benoit-pierre commented 1 month ago

Are you sure sure your submodules are synchronized (particularly base)? Your error message does not match the current glib version.

truatpasteurdotfr commented 1 month ago

Hi,

indeed something is not quite right:

tru@bisadms-MacBook-Air koreader % git describe --tag
v2024.07-71-g5daff2579
tru@bisadms-MacBook-Air koreader % cd base
tru@bisadms-MacBook-Air base % git describe --tag
v2013.03-3235-gdd03e472
truatpasteurdotfr commented 1 month ago
tru@bisadms-MacBook-Air base % cd ..
tru@bisadms-MacBook-Air koreader % ./kodev fetch-thirdparty
Synchronizing submodule url for 'base'
Synchronizing submodule url for 'l10n'
Synchronizing submodule url for 'platform/android/luajit-launcher'
Synchronizing submodule url for 'platform/ubuntu-touch/ubuntu-touch-sdl'
Synchronizing submodule url for 'resources/fonts'
Synchronizing submodule url for 'test'
remote: Enumerating objects: 184, done.
remote: Counting objects: 100% (184/184), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 106 (delta 52), reused 103 (delta 49), pack-reused 0
Receiving objects: 100% (106/106), 1.54 MiB | 7.25 MiB/s, done.
Resolving deltas: 100% (52/52), completed with 31 local objects.
From https://github.com/koreader/koreader-translations
 + 5b994e7...1a97a1e master     -> origin/master  (forced update)
remote: Enumerating objects: 262, done.
remote: Counting objects: 100% (262/262), done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 106 (delta 52), reused 61 (delta 8), pack-reused 0
Receiving objects: 100% (106/106), 1.55 MiB | 3.93 MiB/s, done.
Resolving deltas: 100% (52/52), completed with 30 local objects.
From https://github.com/koreader/koreader-translations
 * branch            7bddf3c87472b152b18d0f7bbc04b43b9e4d0dd1 -> FETCH_HEAD
Submodule path 'l10n': checked out '7bddf3c87472b152b18d0f7bbc04b43b9e4d0dd1'
Submodule path 'base': checked out '720df9dfc497bc1599c293a3149ce82359253c0c'
make[1]: Entering directory '/Users/tru/github/koreader/base'
Synchronizing submodule url for 'luafilesystem'
Synchronizing submodule url for 'thirdparty/kpvcrlib/crengine'
Submodule path 'thirdparty/kpvcrlib/crengine': checked out '07171e788f9e26d240326e2da18b9e8fdbda6f17'
make[1]: Leaving directory '/Users/tru/github/koreader/base'

Let me re-run the build stage!

Thanks

Tru

benoit-pierre commented 1 month ago

Note: you can't rely on base's tags, to check if it's synchronized: there's only the one, it's not tagged when a new version of koreader is released.

truatpasteurdotfr commented 1 month ago

thanks for your help, ./kodev build has completed :D

tru@bisadms-MacBook-Air koreader % ./kodev run
[*] Building KOReader…
▸  0% | Building 'crengine'
ninja: no work to do.
▸ 50% | Building 'koreader'
ninja: no work to do.
▸100% | Installing 'koreader'
[*] install front spec only for the emulator
[*] Install update once marker
[*] Install plugins
[*] Install resources
[*] Install data files
[*] Running KOReader with arguments:  ...
~/github/koreader/koreader-emulator-arm64-apple-darwin23.6.0-debug/koreader ~/github/koreader
---------------------------------------------
                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 08/09/24-22:23:54
 [*] Version: v2024.07-71-g5daff2579_2024-08-07
 ....

./kodev release macos minor documentation fix:

tru@bisadms-MacBook-Air koreader % ./kodev release macos
▸  0% | Building 'crengine'
ninja: no work to do.
▸ 50% | Building 'koreader'
ninja: no work to do.
▸100% | Installing 'koreader'
[*] install front spec only for the emulator
[*] Install update once marker
[*] Install plugins
[*] Install resources
[*] Install data files
[*] Clean up, remove unused files for releases
▸  0% | Building 'crengine'
ninja: no work to do.
▸ 50% | Building 'koreader'
ninja: no work to do.
▸100% | Installing 'koreader'
[*] install front spec only for the emulator
[*] Install update once marker
[*] Install plugins
[*] Install resources
[*] Install data files
[*] Clean up, remove unused files for releases
platform/mac/koreader.icns -> koreader-macos-arm64-apple-darwin23.6.0/bundle/Contents/Resources/icon.icns
platform/mac/menu.xml -> koreader-macos-arm64-apple-darwin23.6.0/bundle/Contents/MainMenu.xib
xcode-select: error: tool 'ibtool' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
make: *** [make/macos.mk:8: update] Error 1

That last error can be fixed by:

tru@bisadms-MacBook-Air koreader % sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

And the 7z archive is now generated:

tru@bisadms-MacBook-Air koreader % ls -lh KOReader-arm64-2024.07-71.7z
-rw-r--r--@ 1 tru  staff    28M  9 aoû 22:29 KOReader-arm64-2024.07-71.7z