Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust crate libsimple. #148

Open
xuxiaocheng0201 opened this issue Apr 15, 2024 · 6 comments
Open

Rust crate libsimple. #148

xuxiaocheng0201 opened this issue Apr 15, 2024 · 6 comments

Comments

@xuxiaocheng0201
Copy link

我用 Rust 创建了一个 crate,可以简化在 Rust 中的构建和使用,
希望可以添加到本项目的 Readme 中,也希望有大佬能帮忙完善交叉编译的处理

crate:https://crates.io/crates/libsimple
项目:https://github.com/xuxiaocheng0201/libsimple/

wangfenjin added a commit that referenced this issue Apr 16, 2024
@wangfenjin
Copy link
Owner

很好的项目,不知道 Rust 的最佳实践是什么,感觉可以改下 build.rs 支持网络下载 github/release 的文件,这样用户使用可能更方便

@wangfenjin
Copy link
Owner

或者支持用户自己配置对应的 binary 文件路径,这样用户可以自己去下载,可以参考 https://github.com/duckdb/duckdb-rs/blob/main/libduckdb-sys/build.rs#L191 这个项目

wangfenjin added a commit that referenced this issue Apr 16, 2024
@xuxiaocheng0201
Copy link
Author

感谢大佬!!

不知道 Rust 的最佳实践是什么,感觉可以改下 build.rs 支持网络下载 github/release 的文件

Rust 生态里面似乎基本都是本地构建的库,而不是从网络下载。
另外有没有办法不临时clone cppjieba,和 simple 一样留在本地构建(保留 jieba_query)?
我想这种设计应该是便于脱机构建

或者支持用户自己配置对应的 binary 文件路径,这样用户可以自己去下载,可以参考 https://github.com/duckdb/duckdb-rs/blob/main/libduckdb-sys/build.rs#L191 这个项目

好的,我去研究一下😄

@wangfenjin
Copy link
Owner

另外有没有办法不临时clone cppjieba

是可以的,可以把他的代码直接加到代码库里,比如像这样打个包
https://github.com/duckdb/duckdb-rs/blob/main/libduckdb-sys/build.rs#L78

你有兴趣可以给这个仓库提交 PR,需要改 cmake 的编译脚本

@wangfenjin
Copy link
Owner

我当时 clone 只是为了省事

@xuxiaocheng0201
Copy link
Author

需要改 cmake 的编译脚本

已经用 cc 基本重写了编译脚本,发了 v0.2,不过我只写了静态链接的,动态链接没研究明白,虽然但是这个库应该也基本不需要动态链接吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants