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

Tebako does not build when running inside qemu #177

Closed
d4rky-pl opened this issue Jul 29, 2024 · 9 comments
Closed

Tebako does not build when running inside qemu #177

d4rky-pl opened this issue Jul 29, 2024 · 9 comments
Assignees

Comments

@d4rky-pl
Copy link
Contributor

d4rky-pl commented Jul 29, 2024

Semaphore CI runs Mac OS instances inside qemu:

semaphores-mac:~ semaphore$ ioreg -l | grep QEMU
    | |   |   |     |   "Model" = "QEMU HARDDISK                           "
# etc.

This causes jemalloc/jemalloc#1997 to surface, causing LG_VADDR to be 0:

checking number of significant virtual address bits... [  2%] Building C object lib/CMakeFiles/libzstd_shared.dir/Users/semaphore/.tebako/deps/src/_dwarfs_wr/deps/src/_zstd/lib/common/entropy_common.c.o
0

and therefore breaking the build:

/Users/semaphore/.tebako/deps/src/_dwarfs_wr/deps/src/_jemalloc/include/jemalloc/internal/rtree.h:98:3: error: constant expression evaluates to -12 which cannot be narrowed to type 'unsigned int' [-Wc++11-narrowing]
        {RTREE_NSB, RTREE_NHIB + RTREE_NSB}
         ^~~~~~~~~

It's a bug in jemalloc/qemu but it's been open for 3.5 years now with no resolution in sight so probably applying the same patch as other projects in the linked GH issues would be the best option.

@maxirmx
Copy link
Member

maxirmx commented Jul 30, 2024

I am not sure that it is a bug in jemalloc/qemu
Any emulated environment would require explicit --with-lg-vaddr setting to build jemalloc.
I will try not to build jemalloc and use brew version that is built with correct lg-vaddr

ref https://stackoverflow.com/questions/37038472/osx-how-to-statically-link-a-library-and-dynamically-link-the-standard-library

@maxirmx
Copy link
Member

maxirmx commented Aug 6, 2024

A solution with environment variable LG_VADDR is implemeted in gem version 0.8.1
More details here: #178

I do not have QEMU environment to test it, so I have to ask for help for testsing

@d4rky-pl
Copy link
Contributor Author

d4rky-pl commented Aug 7, 2024

@maxirmx on 0.8.1 it crashes on Semaphore CI M2 machine with:

/Users/semaphore/.tebako/deps/src/_dwarfs_wr/deps/src/_dwarfs/folly/folly/json/json.cpp:122:19: error: no member named 'double_mode' in 'folly::json::serialization_opts'
            opts_.double_mode,
            ~~~~~ ^
/Users/semaphore/.tebako/deps/src/_dwarfs_wr/deps/src/_dwarfs/folly/folly/json/json.cpp:124:19: error: no member named 'double_flags' in 'folly::json::serialization_opts'
 
            ~~~~~ ^
2 errors generated.
make[9]: *** [folly/CMakeFiles/folly_base.dir/folly/json/json.cpp.o] Error 1
make[9]: *** Waiting for unfinished jobs....
make[8]: *** [folly/CMakeFiles/folly_base.dir/all] Error 2
make[7]: *** [all] Error 2
make[6]: *** [/Users/semaphore/.tebako/deps/src/_dwarfs_wr/deps/src/_dwarfs-stamp/_dwarfs-build] Error 2
make[5]: *** [CMakeFiles/_dwarfs.dir/all] Error 2
make[4]: *** [all] Error 2
make[3]: *** [/Users/semaphore/.tebako/deps/src/_dwarfs_wr-stamp/_dwarfs_wr-build] Error 2
make[2]: *** [CMakeFiles/_dwarfs_wr.dir/all] Error 2
make[1]: *** [CMakeFiles/setup.dir/rule] Error 2
make: *** [setup] Error 2
Tebako script failed: 'tebako setup' build step failed [102]

It failed on both M2 and Intel on Semaphore (but did work fine on Linux). Tested twice on M2, once on Intel, no Homebrew optimization tricks enabled, no cache. Worked locally on M2.

@d4rky-pl
Copy link
Contributor Author

d4rky-pl commented Aug 7, 2024

I've upgraded folly locally:

==> Upgrading folly
  2024.07.15.00 -> 2024.08.05.00

Now it also fails on my machine 👍

@maxirmx
Copy link
Member

maxirmx commented Aug 7, 2024

So, it built jemalloc, I guess
It is another issue, now. folly 2024.08.05.00 uses C++ concepts that are not supported by XCode 13 and we are trying to be XCode 13 compatible

@d4rky-pl
Copy link
Contributor Author

d4rky-pl commented Aug 8, 2024

@maxirmx I've created a separate issue #183, I'll force install previous version of folly on CI and confirm if this one is solved

@maxirmx
Copy link
Member

maxirmx commented Aug 8, 2024

It is a bug
I will deploy dwarfs patch today.
Thank you for your patience )

@maxirmx
Copy link
Member

maxirmx commented Aug 9, 2024

(presumably) fixed by #178

@maxirmx maxirmx closed this as completed Aug 9, 2024
@maxirmx maxirmx removed the help wanted Extra attention is needed label Aug 9, 2024
@d4rky-pl
Copy link
Contributor Author

d4rky-pl commented Aug 9, 2024

@maxirmx I can confirm tebako setup worked correctly. I was not able to test the entire flow just yet due to another issue with Semaphore (this time on their end) but it worked on 2 out of 3 environments including M2 one so I think we're good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants