Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anutosh491
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.67%. Comparing base (bf3a430) to head (176780f).

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           
Flag Coverage Δ
unittests 89.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_DOCS=OFF \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fPIC" \
Copy link
Contributor Author

@anutosh491 anutosh491 Feb 17, 2025

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.

Copy link
Contributor Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anutosh491
Copy link
Contributor Author

anutosh491 commented Feb 17, 2025

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

3 participants