compiler-research / xeus-cpp

Jupyter kernel for the C++ programming language
BSD 3-Clause "New" or "Revised" License
22 stars 26 forks source link

Fix kernel configuration for xeus-cpp-lite #185

Open anutosh491 opened 2 days ago

anutosh491 commented 2 days ago

This is the kernel.json file I see while building xeus-cpp-lite

{
  "display_name": "C++20",
  "env": {
      "PATH":"/Users/anutosh491/micromamba/envs/xeus-cpp/bin:/Users/anutosh491/.pixi/bin:/Users/anutosh491/miniconda3/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/anutosh491/micromamba/condabin:/Users/anutosh491/.pixi/bin:/Users/anutosh491/miniconda3/bin",
      "LD_LIBRARY_PATH":""
  },
  "argv": [
      "/Users/anutosh491/micromamba/envs/xeus-cpp/bin/xcpp",
      "-f",
      "{connection_file}",
      "-resource-dir", "/Users/anutosh491/micromamba/envs/xeus-cpp/lib/clang/19",
      "-I", "/Users/anutosh491/micromamba/envs/xeus-cpp/include",
      "-std=c++20"
  ],
  "language": "cpp",
  "metadata": {"debugger": false
  }
}

Most things are redundant (or can't be used in a wasm context) except 1) kernel display name 2) c++ version based on kernel name 3) language (cpp or c I guess) 4) debugger info

Things like env, resource dir and other include paths if any can't be put to use. There is no xcpp exectuable either (a wasm build would give us xcpp.js, xcpp.wasm, xcpp.data) and we just have an empty placeholder there.

anutosh491 commented 2 days ago

Related https://github.com/compiler-research/xeus-cpp/pull/183

anutosh491 commented 2 days ago

We should be able to fetch the c++ version out of kernel.json and pass it here https://github.com/compiler-research/xeus-cpp/blob/859a1b956b8ebf137ed97b73af825063319d44eb/src/main_emscripten_kernel.cpp#L18-L23

anutosh491 commented 2 days ago

https://discord.com/channels/1235591463472074924/1239452863587942440/1308669884539863101