-
Notifications
You must be signed in to change notification settings - Fork 18
Add Ci for an emscripten build #356
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #356 +/- ##
=======================================
Coverage 89.67% 89.67%
=======================================
Files 88 88
Lines 6622 6622
=======================================
Hits 5938 5938
Misses 684 684
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
-DBUILD_EXAMPLES=OFF \ | ||
-DBUILD_TESTS=OFF \ | ||
-DBUILD_DOCS=OFF \ | ||
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fPIC" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding adding the -fPIC flag here.
Sparrow would build perfectly without it too but if we try to put it to use with xeus-cpp-lite or simply with clang-repl in the browser ..... we would see this error at the linking step.
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol typeinfo for std::runtime_error; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_TABLE_INDEX_SLEB cannot be used against symbol std::runtime_error::~runtime_error(); recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol vtable for sparrow::array_wrapper_impl<sparrow::decimal_array<sparrow::decimal<int>>>; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.1; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol typeinfo for std::runtime_error; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_TABLE_INDEX_SLEB cannot be used against symbol std::runtime_error::~runtime_error(); recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.4; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.4; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.3; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol stderr; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.2; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol vtable for sparrow::array_wrapper_impl<sparrow::dictionary_encoded_array<signed char>>; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.4; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.4; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.3; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol stderr; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.2; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol vtable for sparrow::array_wrapper_impl<sparrow::dictionary_encoded_array<unsigned char>>; recompile with -fPIC
wasm-ld: error: /Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/lib/libsparrow.a(array_factory.cpp.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str.4; recompile with -fPIC
wasm-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
em++: error: '/Users/anutosh491/micromamba/envs/xeus-cpp-wasm-build/bin/wasm-ld @/var/folders/m1/cdn74f917994jd99d_2cpf440000gn/T/emscripten_oj9126u_.rsp.utf-8' failed (returned 1)
make[2]: *** [xcpp.js] Error 1
make[1]: *** [CMakeFiles/xcpp.dir/all] Error 2
make: *** [all] Error 2
emmake: error: 'make install' failed (returned 2)
I was guessing something like -fpic
would be taken care of by default but I think I was wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can play around with something like in the cmakelists.txt and address this too !
if (EMSCRIPTEN)
target_compile_options(sparrow PUBLIC -fPIC)
But yeah the above should be good enough too I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use https://cmake.org/cmake/help/latest/variable/CMAKE_POSITION_INDEPENDENT_CODE.html instead
Hmmm, not sure if introducing 2 new environment files was the way to go here but looked approachable and cleaner |
|
||
emmake make -j ${{ env.ncpus }} install | ||
|
||
# TODO: Implement a way to execute tests possibly through gtest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems we can use this
Shall look into it soon .
No description provided.