I'm trying to run pants from source and having a R...
# general
f
I'm trying to run pants from source and having a Rust-related issue. ๐Ÿงต
Copy code
Compiling engine v0.0.1 (/Users/acam/pants/pants/src/rust/engine)
error: unexpected `cfg` condition value: `gil-refs`
  --> src/externs/mod.rs:61:1
   |
61 | create_exception!(native_engine, EngineError, PyException);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default` and `extension-module`
   = help: consider adding `gil-refs` as a feature in `Cargo.toml`
   = note: see <<https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html>> for more information about checking conditional configuration
   = note: `-D unexpected-cfgs` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`
   = note: this error originates in the macro `$crate::impl_exception_boilerplate` which comes from the expansion of the macro `create_exception` (in Nightly builds, run with -Z macro-backtrace for more info)
Any ideas?
w
Do you have all the correct deps? https://www.pantsbuild.org/stable/docs/contributions/development/setting-up-pants#step-2-bootstrap-the-rust-engine Also, that might need to say python 3.11 now, rather than 3.9
f
So I tried this:
Copy code
--- a/src/rust/engine/Cargo.toml
+++ b/src/rust/engine/Cargo.toml
@@ -294,8 +294,8 @@ prodash = { git = "<https://github.com/stuhood/prodash>", rev = "stuhood/raw-messa
 prost = "0.13"
 prost-build = "0.13"
 prost-types = "0.13"
-pyo3 = "0.22"
-pyo3-build-config = "0.22"
+pyo3 = "0.23.4"
+pyo3-build-config = "0.23.4"
That took care of the "gil-refs" error but gave me all kinds of new ones ๐Ÿ˜ญ
Copy code
error: use of deprecated trait `pyo3::ToPyObject`: `ToPyObject` is going to be replaced by `IntoPyObject`. See the migration guide (<https://pyo3.rs/v0.23.0/migration>) for more information.
  --> src/externs/mod.rs:14:26
   |
14 | use pyo3::{FromPyObject, ToPyObject};
   |                          ^^^^^^^^^^
Also, that might need to say python 3.11 now, rather than 3.9
Oh, I had to do
brew install python@3.9
because I didn't have it installed.
w
Unless you're editing rust code, you shouldn't need to change anything. Did you pull from
main
? I built it an hour ago - works fine, which usually means a deps issue from what I've seen in the past
f
Let me review that link you provided though and make sure I have the right versions of everything.
I pulled from
main
but then checked out the 2.24.0 tag.
w
Ah, okay, so I think that's still python 3.9 - and an older Rust - but should still work
Unless the lock is auto-upgrading or something?
f
I have the latest Rust installed (1.84.1) -- should that be ok or do I need an older version?
w
It uses 1.82.0 - but if you run
pants --version
in the folder to kick off a build, I think it should download the correct rust-toolchain
๐Ÿ‘ 1
f
Ok, so I just checked
main
back out, that worked after I edited my pants version in the toml file to 2.25.0.dev5.
That should be fine. I'm trying to debug an issue with the ambiguity resolution of python dep infer.
w
Yeah, when in doubt, I recommend always building vanilla off main - changes can always be cherry picked back
f
Thanks!
๐Ÿ‘ 1
f
[Side note: PyO3 underwent several API changes from 0.22 -> 0.23. Merely upgrading 0.22 -> 0.23 will fail unless those source changes are made, which of course we made those changes on the
main
branch.]