From 90f98d3d0b23d1ff2769ffd4fbda015bee35c649 Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Thu, 27 Nov 2025 09:33:00 +0100 Subject: [PATCH 1/9] Try released sysroot --- recipes/recipes/rust-nightly/build.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/recipes/recipes/rust-nightly/build.sh b/recipes/recipes/rust-nightly/build.sh index a0ce6cd3546..f4a06c1816d 100644 --- a/recipes/recipes/rust-nightly/build.sh +++ b/recipes/recipes/rust-nightly/build.sh @@ -6,6 +6,8 @@ do cp "${RECIPE_DIR}/${TASK}.sh" "${PREFIX}/etc/conda/${TASK}.d/${TASK}_${PKG_NAME}.sh" done +set -eux + export RUSTUP_HOME=$PREFIX/.rustup_emscripten_forge export CARGO_HOME=$PREFIX/.cargo_emscripten_forge @@ -16,3 +18,14 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --profile minimal \ --target wasm32-unknown-emscripten \ -y + +# Need to install and then remove the target so that it is recognized as active +RUST_TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') +rm -r $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/wasm32-unknown-emscripten + +RUST_EH_SYSROOT_PKG="emcc-4.0.19_nightly-2025-06-27.tar.bz2" +RUST_EMSCRIPTEN_TARGET_URL="https://github.com/pyodide/rust-emscripten-wasm-eh-sysroot/releases/download/emcc-4.0.19_nightly-2025-06-27/${RUST_EH_SYSROOT_PKG}" + +wget --quiet $RUST_EMSCRIPTEN_TARGET_URL +tar -xvf ./$RUST_EH_SYSROOT_PKG +mv ./wasm32-unknown-emscripten $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/ From a8f060e7d0ec35efbac8de94a71fa8ee58c51d12 Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Thu, 27 Nov 2025 12:46:56 +0100 Subject: [PATCH 2/9] Try patching source directly --- recipes/recipes/rust-nightly/build.sh | 31 ++++++++++++++++++------ recipes/recipes/rust-nightly/config.toml | 8 ++++++ recipes/recipes/rust-nightly/recipe.yaml | 10 ++++---- 3 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 recipes/recipes/rust-nightly/config.toml diff --git a/recipes/recipes/rust-nightly/build.sh b/recipes/recipes/rust-nightly/build.sh index f4a06c1816d..43b1eab3c54 100644 --- a/recipes/recipes/rust-nightly/build.sh +++ b/recipes/recipes/rust-nightly/build.sh @@ -19,13 +19,28 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --target wasm32-unknown-emscripten \ -y -# Need to install and then remove the target so that it is recognized as active -RUST_TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') -rm -r $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/wasm32-unknown-emscripten +RUSTC_DATE=$(rustc --version | cut -d' ' -f4 | tr -d '()') +wget --quiet https://static.rust-lang.org/dist/${RUSTC_DATE}/channel-rust-nightly.toml + +# Get the git_commit_hash for pkg.rust +COMMIT_HASH=$(grep -A 2 "\[pkg.rust\]" channel-rust-nightly.toml | grep git_commit_hash | cut -d'"' -f2) + +git clone https://github.com/rust-lang/rust.git --shallow-since=2025-01-01 +cd rust +git reset --hard +git checkout $COMMIT_HASH -RUST_EH_SYSROOT_PKG="emcc-4.0.19_nightly-2025-06-27.tar.bz2" -RUST_EMSCRIPTEN_TARGET_URL="https://github.com/pyodide/rust-emscripten-wasm-eh-sysroot/releases/download/emcc-4.0.19_nightly-2025-06-27/${RUST_EH_SYSROOT_PKG}" +# https://github.com/pyodide/rust-emscripten-wasm-eh-sysroot/blob/main/turn-on-emscripten-wasm-eh.patch +sed -i 's/emscripten_wasm_eh: bool = (false, parse_bool, \[TRACKED\],/\ + emscripten_wasm_eh: bool = (true, parse_bool, [TRACKED],/' \ + compiler/rustc_session/src/options.rs -wget --quiet $RUST_EMSCRIPTEN_TARGET_URL -tar -xvf ./$RUST_EH_SYSROOT_PKG -mv ./wasm32-unknown-emscripten $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/ +cp $RECIPE_DIR/config.toml . + +./x build library --stage 1 --target wasm32-unknown-emscripten + +# # Need to install and then remove the target so that it is recognized as active +RUST_TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') +rm -r $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/wasm32-unknown-emscripten +mv build/host/stage1/lib/rustlib/wasm32-unknown-emscripten \ + $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/ diff --git a/recipes/recipes/rust-nightly/config.toml b/recipes/recipes/rust-nightly/config.toml new file mode 100644 index 00000000000..b9c92326399 --- /dev/null +++ b/recipes/recipes/rust-nightly/config.toml @@ -0,0 +1,8 @@ +profile = "compiler" +change-id = 134650 + +[build] +target = ["wasm32-unknown-emscripten"] + +[rust] +channel = "nightly" \ No newline at end of file diff --git a/recipes/recipes/rust-nightly/recipe.yaml b/recipes/recipes/rust-nightly/recipe.yaml index d689357a807..048d5daf36a 100644 --- a/recipes/recipes/rust-nightly/recipe.yaml +++ b/recipes/recipes/rust-nightly/recipe.yaml @@ -7,7 +7,7 @@ package: version: ${{ version }} build: - number: 2 + number: 3 requirements: build: @@ -23,8 +23,8 @@ about: homepage: https://www.rust-lang.org license: MIT license_file: - - LICENSE-APACHE - - LICENSE-MIT + - LICENSE-APACHE + - LICENSE-MIT summary: | Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. This package provides the compiler @@ -34,5 +34,5 @@ about: extra: recipe-maintainers: - - DerThorsten - - IsabelParedes + - DerThorsten + - IsabelParedes From 1a2f7bdc1eec504d77067ebf2ea0981771c07c67 Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Thu, 27 Nov 2025 12:48:33 +0100 Subject: [PATCH 3/9] Test pycrdt --- recipes/recipes_emscripten/pycrdt/build.sh | 7 ------- recipes/recipes_emscripten/pycrdt/recipe.yaml | 10 +++++----- 2 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 recipes/recipes_emscripten/pycrdt/build.sh diff --git a/recipes/recipes_emscripten/pycrdt/build.sh b/recipes/recipes_emscripten/pycrdt/build.sh deleted file mode 100644 index 3104d221fb9..00000000000 --- a/recipes/recipes_emscripten/pycrdt/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - - -export MATURIN_PYTHON_SYSCONFIGDATA_DIR=${PREFIX}/etc/conda/_sysconfigdata__emscripten_wasm32-emscripten.py -export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 -${PYTHON} -m pip install . -vvv - diff --git a/recipes/recipes_emscripten/pycrdt/recipe.yaml b/recipes/recipes_emscripten/pycrdt/recipe.yaml index 5542c4abfe6..990a1effb10 100644 --- a/recipes/recipes_emscripten/pycrdt/recipe.yaml +++ b/recipes/recipes_emscripten/pycrdt/recipe.yaml @@ -3,24 +3,24 @@ context: version: 0.12.32 package: - name: ${{name}} + name: ${{ name }} version: ${{ version }} source: -- url: https://github.com/jupyter-server/pycrdt/archive/refs/tags/${{version}}.tar.gz +- url: https://github.com/jupyter-server/pycrdt/archive/refs/tags/${{ version }}.tar.gz sha256: 39177cf5b515875f345a2a1460b44e1b11d30273263f6569d0bed5b8c953205f build: number: 0 + script: $PYTHON -m pip install . $PIP_ARGS requirements: build: - - cross-python_${{target_platform}} + - cross-python_${{ target_platform }} - cffi - setuptools-rust - - rust + - rust-nightly - maturin - host: - python - openssl From 038549b890e4222967af91d5cd0c9f641f5f1182 Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Fri, 28 Nov 2025 14:06:22 +0100 Subject: [PATCH 4/9] WIP --- recipes/recipes_emscripten/cramjam/build.sh | 27 +++++++++++- ...-Remove-blosc2-from-default-features.patch | 23 ++++++++++ .../recipes_emscripten/cramjam/recipe.yaml | 42 ++++++++++++++++++- recipes/recipes_emscripten/tiktoken/build.sh | 4 +- .../recipes_emscripten/tiktoken/recipe.yaml | 7 ++-- 5 files changed, 94 insertions(+), 9 deletions(-) create mode 100644 recipes/recipes_emscripten/cramjam/patches/0001-Remove-blosc2-from-default-features.patch diff --git a/recipes/recipes_emscripten/cramjam/build.sh b/recipes/recipes_emscripten/cramjam/build.sh index 40251a01b6c..61183ddb64d 100644 --- a/recipes/recipes_emscripten/cramjam/build.sh +++ b/recipes/recipes_emscripten/cramjam/build.sh @@ -1,4 +1,27 @@ #!/bin/bash -export MATURIN_PYTHON_SYSCONFIGDATA_DIR=${PREFIX}/etc/conda/_sysconfigdata__emscripten_wasm32-emscripten.py -${PYTHON} -m pip install . -vv +set -eux + +# # emcc: error: DISABLE_EXCEPTION_CATCHING=0 is not compatible with -fwasm-exceptions +# unset EMCC_CFLAGS + +# # rustup toolchain install nightly +# # rustup target add wasm32-unknown-emscripten --toolchain nightly +# # rustup override set nightly +# # rustup default nightly + +# # export CARGO_BUILD_TARGET=wasm32-unknown-emscripten +# # export PYTHON_SYS_EXECUTABLE=$BUILD_PREFIX/bin/python3.13 +# # export RUSTUP_TOOLCHAIN=nightly +# # export PYO3_CROSS_LIB_DIR=$BUILD_PREFIX/lib +# # export PYO3_CROSS_INCLUDE_DIR=$BUILD_PREFIX/include +# # export CARGO_FEATURE_NO_DEFAULT_FEATURES=1 +# # export CARGO_NO_DEFAULT_FEATURES=1 +# # export MATURIN_NO_DEFAULT_FEATURES=1 + +# # python -m pip install . --config-settings="maturin-args=--no-default-features" --no-build-isolation --prefix $PREFIX -vvv +# # # Use maturin with all cross-compilation variables +# RUSTUP_TOOLCHAIN=nightly maturin build --release --target wasm32-unknown-emscripten -i python3.13 --no-default-features --out dist +# python -m pip install dist/*.whl --prefix $PREFIX -vvv +export RUSTFLAGS="-Z emscripten-wasm-eh" +$PYTHON -m pip install . $PIP_ARGS \ No newline at end of file diff --git a/recipes/recipes_emscripten/cramjam/patches/0001-Remove-blosc2-from-default-features.patch b/recipes/recipes_emscripten/cramjam/patches/0001-Remove-blosc2-from-default-features.patch new file mode 100644 index 00000000000..b355809229e --- /dev/null +++ b/recipes/recipes_emscripten/cramjam/patches/0001-Remove-blosc2-from-default-features.patch @@ -0,0 +1,23 @@ +From 02c04db7feecbcc9d70baf3135a66045b5631073 Mon Sep 17 00:00:00 2001 +From: Isabel Paredes +Date: Tue, 25 Nov 2025 11:02:28 +0100 +Subject: [PATCH] Remove blosc2 from default features + +blosc2 tries to build an internal zlib and fails. +--- + Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index 0c11a83..066ef00 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -14,7 +14,7 @@ name = "cramjam" + crate-type = ["cdylib"] + + [features] +-default = ["extension-module", "snappy", "lz4", "bzip2", "brotli", "xz", "zstd", "gzip", "deflate", "blosc2", "igzip"] ++default = ["extension-module", "snappy", "lz4", "bzip2", "brotli", "xz", "zstd", "gzip", "deflate", "igzip"] + extension-module = ["pyo3/extension-module"] + generate-import-lib = ["pyo3/generate-import-lib"] # needed for Windows PyPy builds + diff --git a/recipes/recipes_emscripten/cramjam/recipe.yaml b/recipes/recipes_emscripten/cramjam/recipe.yaml index 98218727deb..ec6c062ef7e 100644 --- a/recipes/recipes_emscripten/cramjam/recipe.yaml +++ b/recipes/recipes_emscripten/cramjam/recipe.yaml @@ -1,20 +1,39 @@ context: name: cramjam +<<<<<<< Updated upstream version: 2.8.3 +======= +<<<<<<< Updated upstream + version: 2.8.4 +======= + version: 2.11.0 +>>>>>>> Stashed changes +>>>>>>> Stashed changes package: - name: ${{ name|lower }} + name: ${{ name }} version: ${{ version }} source: url: https://pypi.io/packages/source/${{ name[0] }}/${{ name }}/${{ name }}-${{ version }}.tar.gz +<<<<<<< Updated upstream sha256: 6b1fa0a6ea8183831d04572597c182bd6cece62d583a36cde1e6a86e72ce2389 +======= +<<<<<<< Updated upstream + sha256: ad8bec85b46283330214f4367805e6f56e04ce25a030a2c6a4b127437d006fcf +======= + sha256: 5c82500ed91605c2d9781380b378397012e25127e89d64f460fea6aeac4389b4 + patches: + - patches/0001-Remove-blosc2-from-default-features.patch +>>>>>>> Stashed changes +>>>>>>> Stashed changes build: number: 0 requirements: build: +<<<<<<< Updated upstream - python - cross-python_${{ target_platform }} - maturin @@ -24,6 +43,25 @@ requirements: host: - python - pip +======= + - python + - cross-python_${{ target_platform }} + - maturin + - toml +<<<<<<< Updated upstream + - rust +======= + - rust-nightly +>>>>>>> Stashed changes + - ${{ compiler('cxx') }} + host: + - python + - pip +<<<<<<< Updated upstream +======= + - zlib +>>>>>>> Stashed changes +>>>>>>> Stashed changes run: - python @@ -45,7 +83,7 @@ about: license_file: LICENSE summary: python bindings to rust-implemented compression description: | - Extremely thin Python bindings to de/compression algorithms in Rust. + Extremely thin Python bindings to de/compression algorithms in Rust. documentation: https://docs.rs/cramjam extra: diff --git a/recipes/recipes_emscripten/tiktoken/build.sh b/recipes/recipes_emscripten/tiktoken/build.sh index 8677adb1825..46aa6c604fd 100644 --- a/recipes/recipes_emscripten/tiktoken/build.sh +++ b/recipes/recipes_emscripten/tiktoken/build.sh @@ -1,6 +1,8 @@ #!/bin/bash cargo-bundle-licenses --format yaml --output THIRDPARTY.yml -export MATURIN_PYTHON_SYSCONFIGDATA_DIR=${PREFIX}/etc/conda/_sysconfigdata__emscripten_wasm32-emscripten.py +# export CFLAGS_wasm32-unknown-emscripten="-fwasm-exceptions" + +export RUSTFLAGS="-Z emscripten-wasm-eh -Cpanic=abort. -fwasm-exceptions" ${PYTHON} -m pip install . -vvv diff --git a/recipes/recipes_emscripten/tiktoken/recipe.yaml b/recipes/recipes_emscripten/tiktoken/recipe.yaml index 3bfd15a0bfc..55ae5d25bae 100644 --- a/recipes/recipes_emscripten/tiktoken/recipe.yaml +++ b/recipes/recipes_emscripten/tiktoken/recipe.yaml @@ -3,11 +3,11 @@ context: version: 0.11.0 package: - name: ${{name}} + name: ${{ name }} version: ${{ version }} source: -- url: https://pypi.io/packages/source/t/${{ name }}/tiktoken-${{ version }}.tar.gz +- url: https://pypi.io/packages/source/${{ name[0] }}/${{ name }}/${{ name }}-${{ version }}.tar.gz sha256: 3c518641aee1c52247c2b97e74d8d07d780092af79d5911a6ab5e79359d9b06a build: @@ -17,14 +17,13 @@ requirements: build: - cross-python_${{target_platform}} - setuptools-rust - - rust + - rust-nightly - cargo-bundle-licenses host: - python run: - regex - tests: - script: pytester requirements: From 46cc16e5f3ddfc2913844a807009505e0877342e Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Wed, 3 Dec 2025 15:00:52 +0100 Subject: [PATCH 5/9] Not working --- recipes/recipes/rust-nightly/build.sh | 40 +++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/recipes/recipes/rust-nightly/build.sh b/recipes/recipes/rust-nightly/build.sh index 43b1eab3c54..ede800b3b94 100644 --- a/recipes/recipes/rust-nightly/build.sh +++ b/recipes/recipes/rust-nightly/build.sh @@ -20,6 +20,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ -y RUSTC_DATE=$(rustc --version | cut -d' ' -f4 | tr -d '()') +# RUSTC_DATE="2025-12-01" wget --quiet https://static.rust-lang.org/dist/${RUSTC_DATE}/channel-rust-nightly.toml # Get the git_commit_hash for pkg.rust @@ -35,12 +36,39 @@ sed -i 's/emscripten_wasm_eh: bool = (false, parse_bool, \[TRACKED\],/\ emscripten_wasm_eh: bool = (true, parse_bool, [TRACKED],/' \ compiler/rustc_session/src/options.rs -cp $RECIPE_DIR/config.toml . +# Use nightly rustc and cargo +export PATH=$CARGO_HOME/bin:$PATH +export RUSTC_BIN=$(which rustc) +export CARGO_BIN=$(which cargo) -./x build library --stage 1 --target wasm32-unknown-emscripten +envsubst < $RECIPE_DIR/config.toml > ./config.toml +envsubst '$PREFIX' < $RECIPE_DIR/bootstrap.toml > ./bootstrap.toml + +cat config.toml + +./x build --stage 2 --target wasm32-unknown-emscripten +./x build library --stage 2 --target wasm32-unknown-emscripten +./x build library --stage 2 --target x86_64-unknown-linux-gnu + +CUSTOM_TOOLCHAIN="${RUSTUP_HOME}/rust-toolchain-wasm-eh" +mkdir -p $CUSTOM_TOOLCHAIN +cp -r build/host/stage2/* $CUSTOM_TOOLCHAIN/ +rustup toolchain link rust-toolchain-wasm-eh $CUSTOM_TOOLCHAIN +rustup default rust-toolchain-wasm-eh # # Need to install and then remove the target so that it is recognized as active -RUST_TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') -rm -r $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/wasm32-unknown-emscripten -mv build/host/stage1/lib/rustlib/wasm32-unknown-emscripten \ - $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/ +# RUST_TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') + +# rm -r $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/wasm32-unknown-emscripten +# cp -r build/host/stage1/lib/rustlib/wasm32-unknown-emscripten \ +# $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/ +rustup toolchain list +rustc --version +rustup --version + +# # Copy everything +# rm $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/bin/rustc +# cp build/host/stage1/bin/rustc $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/bin/ +# cp build/host/stage1/lib/librustc_driver-*.so $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/ +# cp -r build/host/stage0/lib/rustlib/x86_64-unknown-linux-gnu \ +# $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/ From 67e1f283dcb54a7bfb1c29269d8bcbcdc2984802 Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Thu, 4 Dec 2025 11:15:14 +0100 Subject: [PATCH 6/9] Std builds but rustc panics later --- recipes/recipes/rust-nightly/activate.sh | 2 + recipes/recipes/rust-nightly/bootstrap.toml | 16 ++++++ recipes/recipes/rust-nightly/build.sh | 61 ++++++++++++--------- recipes/recipes/rust-nightly/config.toml | 5 +- recipes/recipes/rust-nightly/recipe.yaml | 2 +- 5 files changed, 58 insertions(+), 28 deletions(-) create mode 100644 recipes/recipes/rust-nightly/bootstrap.toml diff --git a/recipes/recipes/rust-nightly/activate.sh b/recipes/recipes/rust-nightly/activate.sh index 624664e8001..b2fa83390d5 100644 --- a/recipes/recipes/rust-nightly/activate.sh +++ b/recipes/recipes/rust-nightly/activate.sh @@ -2,6 +2,8 @@ echo "[rust-nightly] Activating..." +set +u + [ -z "${BUILD_PREFIX}" ] && export BUILD_PREFIX="${PREFIX}" export RUSTUP_HOME=$BUILD_PREFIX/.rustup_emscripten_forge diff --git a/recipes/recipes/rust-nightly/bootstrap.toml b/recipes/recipes/rust-nightly/bootstrap.toml new file mode 100644 index 00000000000..8777a343eff --- /dev/null +++ b/recipes/recipes/rust-nightly/bootstrap.toml @@ -0,0 +1,16 @@ +change-id = "ignore" +build.verbose = 0 + +rust.channel = "nightly" + +build.target = ["wasm32-unknown-emscripten"] +build.docs = false + +build.cargo = "$CARGO_BIN" +build.rustc = "$RUSTC_BIN" +build.rustfmt = "$RUSTFMT_BIN" +build.cargo-clippy = "$CLIPPY_BIN" + +install.prefix = "$PREFIX" +install.sysconfdir = "$PREFIX/etc" + diff --git a/recipes/recipes/rust-nightly/build.sh b/recipes/recipes/rust-nightly/build.sh index ede800b3b94..0886967d490 100644 --- a/recipes/recipes/rust-nightly/build.sh +++ b/recipes/recipes/rust-nightly/build.sh @@ -19,12 +19,17 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --target wasm32-unknown-emscripten \ -y -RUSTC_DATE=$(rustc --version | cut -d' ' -f4 | tr -d '()') -# RUSTC_DATE="2025-12-01" -wget --quiet https://static.rust-lang.org/dist/${RUSTC_DATE}/channel-rust-nightly.toml -# Get the git_commit_hash for pkg.rust -COMMIT_HASH=$(grep -A 2 "\[pkg.rust\]" channel-rust-nightly.toml | grep git_commit_hash | cut -d'"' -f2) +# RUSTC_DATE=$(rustc --version | cut -d' ' -f4 | tr -d '()') +# # RUSTC_DATE="2025-12-01" +# wget --quiet https://static.rust-lang.org/dist/${RUSTC_DATE}/channel-rust-nightly.toml + +# Get the git_commit_hash for pkg.rustc [don't forget the C!] +# COMMIT_HASH=$(grep -A 2 "\[pkg.rustc\]" channel-rust-nightly.toml | grep git_commit_hash | cut -d'"' -f2) + +rustc -vV +COMMIT_HASH=$(rustc -vV | grep commit-hash | cut -d' ' -f2) +echo "♥️♥️♥️ COMMIT_HASH: $COMMIT_HASH" git clone https://github.com/rust-lang/rust.git --shallow-since=2025-01-01 cd rust @@ -38,37 +43,43 @@ sed -i 's/emscripten_wasm_eh: bool = (false, parse_bool, \[TRACKED\],/\ # Use nightly rustc and cargo export PATH=$CARGO_HOME/bin:$PATH +rustup default nightly +rustup override set nightly +rustup component add rustfmt +rustup component add clippy export RUSTC_BIN=$(which rustc) export CARGO_BIN=$(which cargo) +export RUSTFMT_BIN=$(which rustfmt) +export CLIPPY_BIN=$(which cargo-clippy) envsubst < $RECIPE_DIR/config.toml > ./config.toml -envsubst '$PREFIX' < $RECIPE_DIR/bootstrap.toml > ./bootstrap.toml +envsubst < $RECIPE_DIR/bootstrap.toml > ./bootstrap.toml -cat config.toml +cat bootstrap.toml -./x build --stage 2 --target wasm32-unknown-emscripten -./x build library --stage 2 --target wasm32-unknown-emscripten -./x build library --stage 2 --target x86_64-unknown-linux-gnu +./x build library --stage 1 --target wasm32-unknown-emscripten --config bootstrap.toml +# ./x build library --stage 2 --target wasm32-unknown-emscripten +# ./x build library --stage 2 --target x86_64-unknown-linux-gnu -CUSTOM_TOOLCHAIN="${RUSTUP_HOME}/rust-toolchain-wasm-eh" -mkdir -p $CUSTOM_TOOLCHAIN -cp -r build/host/stage2/* $CUSTOM_TOOLCHAIN/ -rustup toolchain link rust-toolchain-wasm-eh $CUSTOM_TOOLCHAIN -rustup default rust-toolchain-wasm-eh +# CUSTOM_TOOLCHAIN="${RUSTUP_HOME}/rust-toolchain-wasm-eh" +# mkdir -p $CUSTOM_TOOLCHAIN +# cp -r build/host/stage2/* $CUSTOM_TOOLCHAIN/ +# rustup toolchain link rust-toolchain-wasm-eh $CUSTOM_TOOLCHAIN +# rustup default rust-toolchain-wasm-eh # # Need to install and then remove the target so that it is recognized as active -# RUST_TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') +RUST_TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') +echo "🧿🧿🧿 LOOK" +ls -al $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/wasm32-unknown-emscripten/lib +rm -r $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/wasm32-unknown-emscripten +cp -r build/host/stage1/lib/rustlib/wasm32-unknown-emscripten \ + $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/ + +echo "👁️‍🗨️👁️‍🗨️👁️‍🗨️ LOOK AGAIN" +ls -al $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/wasm32-unknown-emscripten/lib -# rm -r $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/wasm32-unknown-emscripten -# cp -r build/host/stage1/lib/rustlib/wasm32-unknown-emscripten \ -# $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/ rustup toolchain list rustc --version rustup --version -# # Copy everything -# rm $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/bin/rustc -# cp build/host/stage1/bin/rustc $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/bin/ -# cp build/host/stage1/lib/librustc_driver-*.so $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/ -# cp -r build/host/stage0/lib/rustlib/x86_64-unknown-linux-gnu \ -# $RUSTUP_HOME/toolchains/$RUST_TOOLCHAIN/lib/rustlib/ + diff --git a/recipes/recipes/rust-nightly/config.toml b/recipes/recipes/rust-nightly/config.toml index b9c92326399..31fb24c1b11 100644 --- a/recipes/recipes/rust-nightly/config.toml +++ b/recipes/recipes/rust-nightly/config.toml @@ -1,8 +1,9 @@ profile = "compiler" -change-id = 134650 +change-id = "ignore" [build] target = ["wasm32-unknown-emscripten"] +docs = false [rust] -channel = "nightly" \ No newline at end of file +channel = "nightly" diff --git a/recipes/recipes/rust-nightly/recipe.yaml b/recipes/recipes/rust-nightly/recipe.yaml index 048d5daf36a..a790171cb83 100644 --- a/recipes/recipes/rust-nightly/recipe.yaml +++ b/recipes/recipes/rust-nightly/recipe.yaml @@ -7,7 +7,7 @@ package: version: ${{ version }} build: - number: 3 + number: 9 requirements: build: From 615ff2964846ff968bd96f9f8228189c5a1e999b Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Thu, 4 Dec 2025 11:15:35 +0100 Subject: [PATCH 7/9] Fix cramjam recipe --- .../recipes_emscripten/cramjam/recipe.yaml | 37 +------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/recipes/recipes_emscripten/cramjam/recipe.yaml b/recipes/recipes_emscripten/cramjam/recipe.yaml index ec6c062ef7e..7cdf0b2a764 100644 --- a/recipes/recipes_emscripten/cramjam/recipe.yaml +++ b/recipes/recipes_emscripten/cramjam/recipe.yaml @@ -1,14 +1,6 @@ context: name: cramjam -<<<<<<< Updated upstream - version: 2.8.3 -======= -<<<<<<< Updated upstream - version: 2.8.4 -======= version: 2.11.0 ->>>>>>> Stashed changes ->>>>>>> Stashed changes package: name: ${{ name }} @@ -16,54 +8,27 @@ package: source: url: https://pypi.io/packages/source/${{ name[0] }}/${{ name }}/${{ name }}-${{ version }}.tar.gz -<<<<<<< Updated upstream - sha256: 6b1fa0a6ea8183831d04572597c182bd6cece62d583a36cde1e6a86e72ce2389 -======= -<<<<<<< Updated upstream - sha256: ad8bec85b46283330214f4367805e6f56e04ce25a030a2c6a4b127437d006fcf -======= sha256: 5c82500ed91605c2d9781380b378397012e25127e89d64f460fea6aeac4389b4 patches: - patches/0001-Remove-blosc2-from-default-features.patch ->>>>>>> Stashed changes ->>>>>>> Stashed changes build: number: 0 requirements: build: -<<<<<<< Updated upstream - - python - - cross-python_${{ target_platform }} - - maturin - - toml - - rust - - ${{ compiler('cxx') }} - host: - - python - - pip -======= - python - cross-python_${{ target_platform }} - maturin - toml -<<<<<<< Updated upstream - - rust -======= - rust-nightly ->>>>>>> Stashed changes - ${{ compiler('cxx') }} host: - python - pip -<<<<<<< Updated upstream -======= - zlib ->>>>>>> Stashed changes ->>>>>>> Stashed changes run: - - python + - python tests: - script: pytester From 35ab7e41596aefd1af59c37b44ba5483e7188fce Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Thu, 4 Dec 2025 11:16:21 +0100 Subject: [PATCH 8/9] Test pycrdt --- recipes/recipes_emscripten/pycrdt/recipe.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/recipes_emscripten/pycrdt/recipe.yaml b/recipes/recipes_emscripten/pycrdt/recipe.yaml index 990a1effb10..ab5c68ff6e8 100644 --- a/recipes/recipes_emscripten/pycrdt/recipe.yaml +++ b/recipes/recipes_emscripten/pycrdt/recipe.yaml @@ -12,7 +12,9 @@ source: build: number: 0 - script: $PYTHON -m pip install . $PIP_ARGS + script: + - export RUSTFLAGS="-Z emscripten-wasm-eh -Z link-native-libraries=yes -C link-args=-fwasm-exceptions" + - $PYTHON -m pip install . $PIP_ARGS requirements: build: From 81799cd656267bcd5d8bb298d459596f8c7fa9d1 Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Thu, 4 Dec 2025 11:50:44 +0100 Subject: [PATCH 9/9] Fix tiktoken flags --- recipes/recipes_emscripten/tiktoken/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/recipes_emscripten/tiktoken/build.sh b/recipes/recipes_emscripten/tiktoken/build.sh index 46aa6c604fd..b3532ddde61 100644 --- a/recipes/recipes_emscripten/tiktoken/build.sh +++ b/recipes/recipes_emscripten/tiktoken/build.sh @@ -3,6 +3,6 @@ cargo-bundle-licenses --format yaml --output THIRDPARTY.yml # export CFLAGS_wasm32-unknown-emscripten="-fwasm-exceptions" -export RUSTFLAGS="-Z emscripten-wasm-eh -Cpanic=abort. -fwasm-exceptions" +# export RUSTFLAGS="-Z emscripten-wasm-eh -Cpanic=abort. -fwasm-exceptions" ${PYTHON} -m pip install . -vvv