Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
emsdk_ver: "4.0.18"

steps:
- uses: actions/checkout@v5
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@ jobs:
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
emsdk_ver: "4.0.18"
- name: osx15-arm-clang-repl-20-emscripten
os: macos-15
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
emsdk_ver: "4.0.18"
- name: ubu24-x86-clang-repl-20-emscripten
os: ubuntu-24.04
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
emsdk_ver: "4.0.18"
- name: win2025-x86-clang-repl-20-emscripten
os: windows-2025
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
emsdk_ver: "4.0.18"

steps:
- uses: actions/checkout@v5
Expand Down Expand Up @@ -366,25 +366,25 @@ jobs:
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
emsdk_ver: "4.0.18"
- name: osx15-arm-clang-repl-20-emscripten_wasm
os: macos-15
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
emsdk_ver: "4.0.18"
- name: ubu24-arm-clang-repl-20-emscripten_wasm
os: ubuntu-24.04-arm
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
emsdk_ver: "4.0.18"
- name: win2025-x86-clang-repl-20-emscripten
os: windows-2025
clang-runtime: '20'
cling: Off
micromamba_shell_init: powershell
emsdk_ver: "3.1.73"
emsdk_ver: "4.0.18"

steps:
- uses: actions/checkout@v5
Expand Down Expand Up @@ -479,8 +479,10 @@ jobs:
-DSYSROOT_PATH=$SYSROOT_PATH \
../
fi

set +e
emmake make -j ${{ env.ncpus }} check-cppinterop
cat /home/runner/work/CppInterOp/CppInterOp/build/unittests/googletest-prefix/src/googletest-stamp/googletest-build-*.log
set -e
os="${{ matrix.os }}"
if [[ "${os}" != macos* ]] ; then
actual_size=$(stat -c%s "./lib/libclangCppInterOp.so")
Expand Down
8 changes: 4 additions & 4 deletions Emscripten-build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ cd ./CppInterOp-wasm
```

To create a wasm build of CppInterOp we make use of the emsdk toolchain. This can be installed by executing (we only currently
support version 3.1.73)
support version 4.0.18)
```bash
git clone https://github.com/emscripten-core/emsdk.git
./emsdk/emsdk install 3.1.73
./emsdk/emsdk install 4.0.18
```

and to activate the emsdk environment on Linux and osx execute (we are defining SYSROOT_PATH for use later)

```bash
./emsdk/emsdk activate 3.1.73
./emsdk/emsdk activate 4.0.18
source ./emsdk/emsdk_env.sh
export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot
```

and on Windows execute in Powershell

```powershell
.\emsdk\emsdk activate 3.1.73
.\emsdk\emsdk activate 4.0.18
.\emsdk\emsdk_env.ps1
$env:PWD_DIR= $PWD.Path
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
Expand Down
10 changes: 5 additions & 5 deletions docs/Emscripten-build-instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ Now move into this directory using the following command

To create a wasm build of CppInterOp we make use of the emsdk toolchain.
This can be installed by executing (we only currently support version
3.1.73)
4.0.18)

.. code:: bash

git clone https://github.com/emscripten-core/emsdk.git
./emsdk/emsdk install 3.1.73
./emsdk/emsdk install 4.0.18

and to activate the emsdk environment on Linux and osx execute
(we are defining SYSROOT_PATH for use later)

.. code:: bash

./emsdk/emsdk activate 3.1.73
./emsdk/emsdk activate 4.0.18
source ./emsdk/emsdk_env.sh
export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot

and on Windows execute in Powershell

.. code:: powershell

.\emsdk\emsdk activate 3.1.73
.\emsdk\emsdk activate 4.0.18
.\emsdk\emsdk_env.ps1
$env:PWD_DIR= $PWD.Path
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
Expand Down Expand Up @@ -429,4 +429,4 @@ and on Windows execute
--contents xeus-cpp/notebooks/images/marie.png `
--contents xeus-cpp/notebooks/audio/audio.wav `
--XeusAddon.mounts="$env:PREFIX/share/xeus-cpp/tagfiles:/share/xeus-cpp/tagfiles" `
--XeusAddon.mounts="$env:PREFIX/etc/xeus-cpp/tags.d:/etc/xeus-cpp/tags.d"
--XeusAddon.mounts="$env:PREFIX/etc/xeus-cpp/tags.d:/etc/xeus-cpp/tags.d"
4 changes: 2 additions & 2 deletions environment-wasm.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CppInterOp-wasm
channels:
- https://prefix.dev/emscripten-forge-dev
- https://prefix.dev/emscripten-forge-4x
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change has to be made until Emscripten forges emsdk 4x branch is merged into its main.

- https://prefix.dev/conda-forge
dependencies:
- emscripten-abi==3.1.73
- emscripten-abi==4.0.18
- nlohmann_json
- nlohmann_json-abi
- xeus-lite
Expand Down
2 changes: 1 addition & 1 deletion unittests/CppInterOp/FunctionReflectionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ TYPED_TEST(CppInterOpTest, FunctionReflectionTestGetFunctionAddress) {

std::vector<Decl*> Decls;
std::string code = "int f1(int i) { return i * i; }";
std::vector<const char*> interpreter_args = {"-include", "new"};
std::vector<const char*> interpreter_args = {"-include", "new", "-Xclang", "-iwithsysroot/include/compat"};
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Given these extra flags are only needed for the Emscripten case, it might be worth making the args dependent on what platform we are targeting. Same for the other test.


GetAllTopLevelDecls(code, Decls, /*filter_implicitGenerated=*/false,
interpreter_args);
Expand Down
2 changes: 1 addition & 1 deletion unittests/CppInterOp/InterpreterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ TYPED_TEST(CppInterOpTest, InterpreterTestProcess) {
GTEST_SKIP() << "Test fails for OOP JIT builds";
if (llvm::sys::RunningOnValgrind())
GTEST_SKIP() << "XFAIL due to Valgrind report";
std::vector<const char*> interpreter_args = { "-include", "new" };
std::vector<const char*> interpreter_args = { "-include", "new", "-Xclang", "-iwithsysroot/include/compat" };
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "std::vector" is directly included [misc-include-cleaner]

unittests/CppInterOp/InterpreterTest.cpp:2:

+ #include <vector>

auto* I = TestFixture::CreateInterpreter(interpreter_args);
EXPECT_TRUE(Cpp::Process("") == 0);
EXPECT_TRUE(Cpp::Process("int a = 12;") == 0);
Expand Down
2 changes: 1 addition & 1 deletion unittests/CppInterOp/ScopeReflectionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ TYPED_TEST(CppInterOpTest, ScopeReflectionTestIsBuiltin) {
// "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long",
// "float", "double", "long double", "void"}

std::vector<const char*> interpreter_args = { "-include", "new" };
std::vector<const char*> interpreter_args = { "-include", "new", "-Xclang", "-iwithsysroot/include/compat" };

TestFixture::CreateInterpreter(interpreter_args);
ASTContext &C = Interp->getCI()->getASTContext();
Expand Down
Loading