From c9c8061e88dd2c9ba768a56e6863a809159eae44 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:24:39 +0000 Subject: [PATCH 1/3] Update deploy-pages.yml to match https://github.com/compiler-research/xeus-cpp/pull/199/files --- .github/workflows/deploy-pages.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 31174ca2b..958a1b41d 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -165,6 +165,7 @@ jobs: pushd build export CMAKE_PREFIX_PATH=${{ env.PREFIX }} export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }} + export SYSROOT_PATH=$HOME/emsdk/upstream/emscripten/cache/sysroot emcmake cmake \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_PREFIX_PATH=${{ env.PREFIX }} \ @@ -172,6 +173,7 @@ jobs: -DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ -DCppInterOp_DIR="${{ env.CPPINTEROP_BUILD_DIR }}/lib/cmake/CppInterOp" \ + -DSYSROOT_PATH=$SYSROOT_PATH \ .. emmake make -j ${{ env.ncpus }} install @@ -183,6 +185,8 @@ jobs: micromamba activate xeus-lite-host python -m pip install jupyterlite-xeus jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }} --output-dir dist + cp xcpp.data dist/extensions/@jupyterlite/xeus/static + cp $PREFIX/lib/libclangCppInterOp.so dist/extensions/@jupyterlite/xeus/static - name: Upload artifact uses: actions/upload-pages-artifact@v3 From 55822b831494d33e2ae43224b9355b1dc5d3597e Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:28:40 +0000 Subject: [PATCH 2/3] Update emscripten.yml to match PR https://github.com/compiler-research/xeus-cpp/pull/199/files --- .github/workflows/emscripten.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index ae7e3ab4e..5b0ebf160 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -605,6 +605,7 @@ jobs: pushd build export CMAKE_PREFIX_PATH=${{ env.PREFIX }} export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }} + export SYSROOT_PATH=$HOME/emsdk/upstream/emscripten/cache/sysroot emcmake cmake \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_PREFIX_PATH=${{ env.PREFIX }} \ @@ -612,5 +613,6 @@ jobs: -DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ -DCppInterOp_DIR="${{ env.CPPINTEROP_BUILD_DIR }}/lib/cmake/CppInterOp" \ + -DSYSROOT_PATH=$SYSROOT_PATH \ .. emmake make -j ${{ env.ncpus }} From 3e2e020d4d63379d2fcd6e21aaaa0d2808655eaa Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Sun, 22 Dec 2024 20:16:00 +0000 Subject: [PATCH 3/3] Apply patch to shift temporary files to tmp directory --- ...ang19-2-shift-temporary-files-to-tmp-dir.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 patches/llvm/emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch diff --git a/patches/llvm/emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch b/patches/llvm/emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch new file mode 100644 index 000000000..32ac45c13 --- /dev/null +++ b/patches/llvm/emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch @@ -0,0 +1,15 @@ +diff --git a/clang/lib/Interpreter/Wasm.cpp b/clang/lib/Interpreter/Wasm.cpp +index aa10b160ccf8..184867e2b55f 100644 +--- a/clang/lib/Interpreter/Wasm.cpp ++++ b/clang/lib/Interpreter/Wasm.cpp +@@ -76,8 +76,8 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) { + llvm::TargetMachine *TargetMachine = Target->createTargetMachine( + PTU.TheModule->getTargetTriple(), "", "", TO, llvm::Reloc::Model::PIC_); + PTU.TheModule->setDataLayout(TargetMachine->createDataLayout()); +- std::string ObjectFileName = PTU.TheModule->getName().str() + ".o"; +- std::string BinaryFileName = PTU.TheModule->getName().str() + ".wasm"; ++ std::string ObjectFileName = "/tmp/" + PTU.TheModule->getName().str() + ".o"; ++ std::string BinaryFileName = "/tmp/" + PTU.TheModule->getName().str() + ".wasm"; + + std::error_code Error; + llvm::raw_fd_ostream ObjectFileOutput(llvm::StringRef(ObjectFileName), Error);