-
Notifications
You must be signed in to change notification settings - Fork 332
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
refactor!: drop RustPython support #3749
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com> Co-authored-by: Jeong YunWon <jeong@youknowone.org>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3749 +/- ##
==========================================
- Coverage 85.63% 85.25% -0.38%
==========================================
Files 944 937 -7
Lines 158776 156542 -2234
==========================================
- Hits 135966 133464 -2502
- Misses 22810 23078 +268 |
Signed-off-by: tison <wander4096@gmail.com>
3bc1c5b
to
1249c4f
Compare
@@ -149,6 +149,10 @@ jobs: | |||
run: | | |||
sudo apt update && sudo apt install -y libfuzzer-14-dev | |||
cargo install cargo-fuzz | |||
- uses: actions/setup-python@v5 | |||
with: | |||
python-version: '3.8' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are trying to ship the Python script function with PyO3 primarily here. And since statically link to libpython can be complicated, I'm investigating the way to dynamically link to libpython.
So far, it works well and we can see the CI all passed. But this requires a libpython3.8.so
can be linked in the system.
Thus, I have two questions:
- How can I make this binary work well with all the libpython >= 3.8?
- How can I disable the related functionalities if libpython3.so is not found?
This refers to:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @discord9 any thoughts here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @discord9 any thoughts here?
Maybe we can use bindgen
to create a shared library(call it libpython_finder
maybe?) with the same symbols as limited python abi, and forward those calls to actual libpython3.*
at runtime with libloading
, we would also need to export extra functions to check if libpython
is found, and config pyo3 to use our shared library, the shared library would not need much effect to mantain after we are done developing it as limited api doesn't change that much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
"backend" => { | ||
let value = py_str_to_string(&kw.node.value)?; | ||
let value = py_str_to_string(&kw.value)?; | ||
match value.as_str() { | ||
// although this is default option to use RustPython for interpreter | ||
// but that could change in the future |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this comment?
@@ -73,6 +58,8 @@ pub(crate) fn arrow_rtruediv(arr: &dyn Datum, val: &dyn Datum) -> Result<ArrayRe | |||
} | |||
|
|||
/// Performs `val / arr`, but cast to i64. | |||
/// TODO: figure out whether pyo3 backend can support this | |||
#[allow(dead_code)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pyo3 support rich cmp, see more in this link, and the interface is quite similiar:
https://pyo3.rs/v0.14.5/class/protocols.html?highlight=compare#comparison-operators
Edit: maybe change this todo to TODO(discord9): impl SequenceProtocol and rich cmp
?
Closed as undetermined yet. This patch can be picked up since it touches only the Python script code path. Before we make the decision to lift PyO3 as the default backend and distribute it in every artifact, we should resolve the issue described in #3777, namely how to support multiple Python versions, or at least disable when Python environment not found, instead of panic. |
Sorry for the late reply, I am somewhat behind on OSS so please expect some delay from me at the moment.
In principle you can link to Probably you are safer to avoid depending on the system Python and distribute the Python version you want to link with. This means either you:
|
@davidhewitt Thanks a lot! According to your comment, here are my two questions:
How does it work? We currently add the
You can see the commits above to fight with this issue.
It still has two challenges:
|
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
This supersedes and thus closes #3723.
This closes #3063.
Drop RustPython backend for scripting and always build with PyO3. This is an attempt to simplify our scripting functions.
This should involve a lot of docs changes, but we haven't decided yet. Open this patch as a preview.
Checklist