From 400706ad018ae7ada73ecbb7febb6635ddb43b3d Mon Sep 17 00:00:00 2001 From: ethqnol Date: Thu, 3 Sep 2026 22:42:57 -0400 Subject: [PATCH 1/5] Add polars-mojo v0.1.0 --- recipes/polars-mojo/recipe.yaml | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 recipes/polars-mojo/recipe.yaml diff --git a/recipes/polars-mojo/recipe.yaml b/recipes/polars-mojo/recipe.yaml new file mode 100644 index 00000000..1c4a2255 --- /dev/null +++ b/recipes/polars-mojo/recipe.yaml @@ -0,0 +1,80 @@ +context: + name: polars-mojo + version: "0.1.0" + mojo_version: "=1.0.0" + +package: + name: ${{ name }} + version: ${{ version }} + +source: + - git: https://github.com/ethqnol/polars-mojo.git + rev: bd1d2a28d676f164930f9035ad1ccf18c626a04c + +build: + number: 0 + script: + - cargo build --release + - | + TARGET_DIR="target/${CARGO_BUILD_TARGET:-}/release" + if [ ! -f "$TARGET_DIR/libpolars_ffi.so" ]; then + TARGET_DIR="target/release" + fi + mkdir -p ${{ PREFIX }}/lib + cp "$TARGET_DIR/libpolars_ffi.so" ${{ PREFIX }}/lib/ + cp "$TARGET_DIR/libpolars_ffi.a" ${{ PREFIX }}/lib/ + + - mkdir -p ${{ PREFIX }}/lib/mojo + - mojo precompile molars -o ${{ PREFIX }}/lib/mojo/molars.mojoc + - cp -r molars ${{ PREFIX }}/lib/mojo/molars + + - mkdir -p ${{ PREFIX }}/etc/conda/activate.d ${{ PREFIX }}/etc/conda/deactivate.d + - | + cat << 'EOF' > ${{ PREFIX }}/etc/conda/activate.d/molars.sh + export _MOLARS_OLD_LIBRARY_PATH="${LIBRARY_PATH:-}" + export _MOLARS_OLD_LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}" + export LIBRARY_PATH="${CONDA_PREFIX}/lib${LIBRARY_PATH:+:${LIBRARY_PATH}}" + export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" + EOF + - | + cat << 'EOF' > ${{ PREFIX }}/etc/conda/deactivate.d/molars.sh + if [ -n "${_MOLARS_OLD_LIBRARY_PATH+x}" ]; then + export LIBRARY_PATH="${_MOLARS_OLD_LIBRARY_PATH}" + unset _MOLARS_OLD_LIBRARY_PATH + fi + if [ -n "${_MOLARS_OLD_LD_LIBRARY_PATH+x}" ]; then + export LD_LIBRARY_PATH="${_MOLARS_OLD_LD_LIBRARY_PATH}" + unset _MOLARS_OLD_LD_LIBRARY_PATH + fi + EOF + +requirements: + build: + - ${{ compiler('c') }} + - ${{ compiler('rust') }} + host: + - mojo-compiler ${{ mojo_version }} + run: + - ${{ pin_compatible('mojo-compiler') }} + +tests: + - package_contents: + files: + - lib/libpolars_ffi.so + - lib/libpolars_ffi.a + - lib/mojo/molars.mojoc + - files: + source: + - tests/ + script: + - mojo run -I $PREFIX/lib/mojo -Xlinker -L$PREFIX/lib -Xlinker -lpolars_ffi tests/test_arrow_abi.mojo + - mojo run -I $PREFIX/lib/mojo -Xlinker -L$PREFIX/lib -Xlinker -lpolars_ffi tests/test_dataframe.mojo + +about: + homepage: https://github.com/ethqnol/polars-mojo + license: MIT + license_file: LICENSE + summary: Polars DataFrame bindings for Mojo via Arrow C Data Interface + + + From 2ac7e4319ba343557ee20d9915b4e0f2bc8688a6 Mon Sep 17 00:00:00 2001 From: ethqnol Date: Thu, 3 Sep 2026 22:46:00 -0400 Subject: [PATCH 2/5] update recipe --- recipes/polars-mojo/recipe.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/polars-mojo/recipe.yaml b/recipes/polars-mojo/recipe.yaml index 1c4a2255..7ace0096 100644 --- a/recipes/polars-mojo/recipe.yaml +++ b/recipes/polars-mojo/recipe.yaml @@ -9,7 +9,7 @@ package: source: - git: https://github.com/ethqnol/polars-mojo.git - rev: bd1d2a28d676f164930f9035ad1ccf18c626a04c + rev: f767f7ba56f6805365af4a4915f2d61352e8a8f8 build: number: 0 @@ -72,6 +72,7 @@ tests: about: homepage: https://github.com/ethqnol/polars-mojo + author: ethqnol # Ethan Wu license: MIT license_file: LICENSE summary: Polars DataFrame bindings for Mojo via Arrow C Data Interface From b501391b866e78a24dd81b1f049e976fda38e7dd Mon Sep 17 00:00:00 2001 From: ethqnol Date: Sun, 6 Sep 2026 14:52:17 -0400 Subject: [PATCH 3/5] update --- recipes/polars-mojo/recipe.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/polars-mojo/recipe.yaml b/recipes/polars-mojo/recipe.yaml index 7ace0096..8c3bdff2 100644 --- a/recipes/polars-mojo/recipe.yaml +++ b/recipes/polars-mojo/recipe.yaml @@ -9,7 +9,7 @@ package: source: - git: https://github.com/ethqnol/polars-mojo.git - rev: f767f7ba56f6805365af4a4915f2d61352e8a8f8 + rev: b15b5032714bab441e0c001a96c86073e7f73b17 build: number: 0 @@ -72,7 +72,6 @@ tests: about: homepage: https://github.com/ethqnol/polars-mojo - author: ethqnol # Ethan Wu license: MIT license_file: LICENSE summary: Polars DataFrame bindings for Mojo via Arrow C Data Interface From efda763aa96ae763c1075713960d6ba2e9bc95a8 Mon Sep 17 00:00:00 2001 From: ethqnol Date: Tue, 8 Sep 2026 18:21:06 -0400 Subject: [PATCH 4/5] fix --- recipes/polars-mojo/recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/polars-mojo/recipe.yaml b/recipes/polars-mojo/recipe.yaml index 8c3bdff2..0bbd82ad 100644 --- a/recipes/polars-mojo/recipe.yaml +++ b/recipes/polars-mojo/recipe.yaml @@ -9,7 +9,7 @@ package: source: - git: https://github.com/ethqnol/polars-mojo.git - rev: b15b5032714bab441e0c001a96c86073e7f73b17 + rev: 191381da3c6a0cffba532c5581d38883489d72ea build: number: 0 From 5d0f74d9d9dbdc3d39f265c445a647cc78d973e1 Mon Sep 17 00:00:00 2001 From: ethqnol Date: Tue, 8 Sep 2026 22:25:11 -0400 Subject: [PATCH 5/5] update recipe to work for mac --- recipes/polars-mojo/recipe.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/recipes/polars-mojo/recipe.yaml b/recipes/polars-mojo/recipe.yaml index 0bbd82ad..44638d6e 100644 --- a/recipes/polars-mojo/recipe.yaml +++ b/recipes/polars-mojo/recipe.yaml @@ -17,11 +17,16 @@ build: - cargo build --release - | TARGET_DIR="target/${CARGO_BUILD_TARGET:-}/release" - if [ ! -f "$TARGET_DIR/libpolars_ffi.so" ]; then + if [ ! -d "$TARGET_DIR" ]; then TARGET_DIR="target/release" fi mkdir -p ${{ PREFIX }}/lib - cp "$TARGET_DIR/libpolars_ffi.so" ${{ PREFIX }}/lib/ + if [ -f "$TARGET_DIR/libpolars_ffi.dylib" ]; then + cp "$TARGET_DIR/libpolars_ffi.dylib" ${{ PREFIX }}/lib/ + fi + if [ -f "$TARGET_DIR/libpolars_ffi.so" ]; then + cp "$TARGET_DIR/libpolars_ffi.so" ${{ PREFIX }}/lib/ + fi cp "$TARGET_DIR/libpolars_ffi.a" ${{ PREFIX }}/lib/ - mkdir -p ${{ PREFIX }}/lib/mojo @@ -33,8 +38,10 @@ build: cat << 'EOF' > ${{ PREFIX }}/etc/conda/activate.d/molars.sh export _MOLARS_OLD_LIBRARY_PATH="${LIBRARY_PATH:-}" export _MOLARS_OLD_LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}" + export _MOLARS_OLD_DYLD_FALLBACK_LIBRARY_PATH="${DYLD_FALLBACK_LIBRARY_PATH:-}" export LIBRARY_PATH="${CONDA_PREFIX}/lib${LIBRARY_PATH:+:${LIBRARY_PATH}}" export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" + export DYLD_FALLBACK_LIBRARY_PATH="${CONDA_PREFIX}/lib${DYLD_FALLBACK_LIBRARY_PATH:+:${DYLD_FALLBACK_LIBRARY_PATH}}" EOF - | cat << 'EOF' > ${{ PREFIX }}/etc/conda/deactivate.d/molars.sh @@ -46,6 +53,10 @@ build: export LD_LIBRARY_PATH="${_MOLARS_OLD_LD_LIBRARY_PATH}" unset _MOLARS_OLD_LD_LIBRARY_PATH fi + if [ -n "${_MOLARS_OLD_DYLD_FALLBACK_LIBRARY_PATH+x}" ]; then + export DYLD_FALLBACK_LIBRARY_PATH="${_MOLARS_OLD_DYLD_FALLBACK_LIBRARY_PATH}" + unset _MOLARS_OLD_DYLD_FALLBACK_LIBRARY_PATH + fi EOF requirements: @@ -60,7 +71,7 @@ requirements: tests: - package_contents: files: - - lib/libpolars_ffi.so + - lib/libpolars_ffi.${{ "dylib" if osx else "so" }} - lib/libpolars_ffi.a - lib/mojo/molars.mojoc - files: