<#17502 Rust backend> New discussion created by <r...
# github-notifications
q
#17502 Rust backend New discussion created by rbuckland Preamble This is a discussion thread to gather the requirements, ideas and wisdom for creating a development backend workflow for Rust. This is intended to be a bit of a brain dump and request for ideas/opinions/thoughts on creating a compilation and packaging workflow for the C and C++ backend(s). Currently only "firing" shell command is supported, no rust. • ...src/python/pants/backend This discussion thread is to flesh out the themes we would need, such that we can incrementally build out a Rust backend. Base principle is to no reinvent any wheel, but let a rust project, live within in a wider polyglot monorepo (thing a Rust lib that generates Python, C and npm (webpack) libs) Required Features • Resource/Dependency Generation (bin or lib is output) • Compilers/Toolchains • Package Management • Linting and Formatting • Testing • Compilation (inc multi-arch support) • Caching • Build Generators Resource/Dependency Generation • w.r.t. Dependency Inference: • Is reading the
cargo.toml
enough to determine what will be "spat out" - need to know the architectures being generated of course. Compiler and Toolchain The assumption would be that we can hook straight into cargo execution Do we run rustc ? Package Management cargo.lock file exists, - need to look how it is handled With Python/pip,poetry and Java/maven today. This should be similar same, which has the best example ? Linting and Formatting run cargo fmt :-) ? Testing run cargo test :-) ? Compilation • same , run cargo. • What about debug output formats etc • multi architecture generation Caching need to know how the caching architecture works and how we seed it from a rust point of view. Build Generators • w.r.t. Dependency Inference: • In theory this may just be, have extension points to that a call to "shell" can declare what will be output. An example (personally used) is auto generation of json-schema files, from the rust struct external data types. Then used in APIs. Actions • collate the above list into a clear set of requirements • call out any dependencies or "solved by one action" between them • identify any known gaps in Pants today that blocks us for beginning this work pantsbuild/pants