Hello! I'm on the stable docs page for 2.16 and I ...
# general
g
Hello! I'm on the stable docs page for 2.16 and I see there is experimental support for JavaScript and Rust, how do I get access to both of those? I need this in my life.
❤️ 1
f
hey there! You can use this example repo to explore how JS backend can be used: https://github.com/AlexTereshenkov/example-javascript. If you'd like to do this in your repo instead, you only need to enable a relevant backend, e.g.
Copy code
[GLOBAL]
pants_version = "2.17.0rc2"

backend_packages.add = [
  "pants.backend.experimental.javascript",
]
as for Rust, I don't think we have yet a dev release with the Rust backend support, with the latest release being 2.18.0.dev5. You can however run Pants from sources, please see https://www.pantsbuild.org/v2.17/docs/running-pants-from-sources if you are eager 🙂 with the
"pants.backend.experimental.rust"
enabled, you can do
rust_package(name="rust-package", sources=["<http://hello.rs|hello.rs>"])
but mind you this is all in the very early stages:
Copy code
❯ ./pants_from_sources peek helloworld:rust-package
[
  {
    "address": "helloworld:rust-package",
    "target_type": "rust_package",
    "dependencies": [],
    "description": null,
    "skip_rustfmt": false,
    "sources": [
      "helloworld/hello.rs"
    ],
    "sources_fingerprint": "bd34f5c3c05f1d3d6b823bdb2f499f34a4fbbe798d7481e95edbc8f7ed346f1a",
    "sources_raw": [
      "<http://hello.rs|hello.rs>"
    ],
    "tags": null
  }
]
you are also very welcome to explore the discussions around adding Rust support you can find at https://github.com/pantsbuild/pants/issues/15775 and https://github.com/pantsbuild/pants/discussions/17502