hhstore / blog

My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
292 stars 24 forks source link

Mojo FFI: Build and Publish a mojo package based on the Rust library #434

Open hhstore opened 1 week ago

hhstore commented 1 week ago

📖 Abstract:

💯 Related:

hhstore commented 1 week ago

构建+发布一个 Mojo 包(基于 rust 库 + FFI binding 实现)

目标:

工具:

conda-build


pixi add conda-build

参考:

pixi + rattler-build

参考:

hhstore commented 1 week ago

magic 打包 mojo 包目录格式:


# support
src/xxx_package/__init__.mojo

# support
xxx_package/__init__.mojo

# not support
src/__init__.mojo
hhstore commented 1 week ago

mojo 包安装路径:

image
hhstore commented 1 week ago

Mojo 打包示例项目

jojo-core

jojo-cli

hhstore commented 1 week ago

使用 conda-build 构建 rust lib

docs:

rust lib 构建示例:

hhstore commented 1 week ago

1

hhstore commented 1 week ago

1

hhstore commented 1 week ago

1

hhstore commented 1 week ago

1

hhstore commented 1 week ago

1

hhstore commented 1 week ago

1

hhstore commented 1 week ago

1

hhstore commented 1 week ago

1

hhstore commented 1 week ago

1