-
Notifications
You must be signed in to change notification settings - Fork 28
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
Skip computing resource dir and include paths for xeus-cpp-lite #183
base: main
Are you sure you want to change the base?
Conversation
The preloaded file would end up in |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
=======================================
Coverage 80.80% 80.80%
=======================================
Files 19 19
Lines 974 974
Branches 93 93
=======================================
Hits 787 787
Misses 187 187
|
clang-tidy review says "All clean, LGTM! 👍" |
46ffb83
to
96e61bc
Compare
clang-tidy review says "All clean, LGTM! 👍" |
@@ -357,7 +359,9 @@ __get_cxx_version () | |||
|
|||
void interpreter::init_includes() | |||
{ | |||
#ifndef EMSCRIPTEN | |||
Cpp::AddIncludePath((xeus::prefix_path() + "/include/").c_str()); |
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.
Does that hurt on emscripten? I'd think it's just some random non-existing folder?
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.
Yeah random non existing folder that won't contribute to our solution :)
If you look at Anubhab's solution (https://wasmdemo.argentite.me/) or any other solutions that interest us (https://binji.github.io/wasm-clang/) we are only interested in two folders is what I can see
- include ( for
/include/c++/v1
) - include/wasm32-emscripten (for
/include/wasm32-emscripten/c++/v1
)
// 1st link
"" -cc1 -triple wasm32-unknown-emscripten -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -main-file-name "<<< inputs >>>" -mrelocation-model static -mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu generic -fvisibility=hidden -debugger-tuning=gdb -v -fcoverage-compilation-dir=/ -resource-dir lib/clang/17 -internal-isystem /include/wasm32-emscripten/c++/v1 -internal-isystem /include/c++/v1 -internal-isystem lib/clang/17/include -internal-isystem /include/wasm32-emscripten -internal-isystem /include -std=c++17 -fdeprecated-macro -fdebug-compilation-dir=/ -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fincremental-extensions -o "<<< inputs >>>.o" -x c++ "<<< inputs >>>"
clang -cc1 version 17.0.0 based upon LLVM 17.0.0git default target wasm32-unknown-emscripten
ignoring nonexistent directory "/include/wasm32-emscripten/c++/v1"
ignoring nonexistent directory "lib/clang/17/include"
ignoring nonexistent directory "/include/wasm32-emscripten"
#include "..." search starts here:
#include <...> search starts here:
/include/c++/v1
/include
// 2nd link
clang -cc1 -emit-obj -disable-free -isysroot / -internal-isystem /include/c++/v1 -internal-isystem /include -internal-isystem /lib/clang/8.0.1/include -ferror-limit 19 -fmessage-length 80 -fcolor-diagnostics -O2 -o test.o -x c++ test.cc
We eventually need to fetch anything we are interested in from one of the two folders and that is what --preload-file would do for us !
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.
Anyways the emscripten Ci would fail for now cause I am playing around with how the shared build for clangCppInteroP would work on emscripten-forge. As I mentioned on discord I wrote my thought on what should be done for cppinterop's emscripten build but I haven't heard anything back on it. Obviously we need to decide on a static build vs a shared build.
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.
The question is does not having ifdefs around that code cause a failure on emscripten?
96e61bc
to
15cfff9
Compare
clang-tidy review says "All clean, LGTM! 👍" |
15cfff9
to
b3b51d9
Compare
clang-tidy review says "All clean, LGTM! 👍" |
Should be superseded by #199 |
While using xeus-cpp-lite ( or rather running clang-repl in the browser) , local paths to system includes or resource dirs don't make sense.
What should happen here is content out of
Should be collected in one location and then we need to load it using emscripten's
--preload-file
( we can use this flag only once as it creates a .data file which comprises of all the headers/file we need)So
Using
DetectResourceDir
andDetectSystemCompilerIncludePaths
can't be done as both depend onexec
(marked as won't fix on emscripten)Init_includes()
adds/Users/anutosh491/micromamba/envs/xeus-cpp-wasm-host/include
to the cc1 command but this doesn't make sense either.