Re: [PATCH v5 0/9] Introduce Rust and announce that it will become mandatory
- From
Ezekiel Newren <ezekielnewren@gmail.com>
- Date
- Sep 16, 2025, 23:38 UTC
- Message-ID
- <CAH=ZcbA47pzMu9VsrTC2Ni9_RN6iPKmaaDNNxSvx1dtroza+Mg@mail.gmail.com>
- In-Reply-To
- <1feb8bd5-ef47-4cf4-b306-e38c5edac601@ramsayjones.plus.com>
On Tue, Sep 16, 2025 at 5:05 PM Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:
Show 13 quoted lines
> I meant to mention during the initial 'xdiff series' that running > the build_rust.sh script failed for me on Linux Mint 22.2, because: > > $ rustc --version > rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball) > $ cargo --version > cargo 1.75.0 > $ rustup --version > Command 'rustup' not found, but can be installed with: > sudo apt install rustup > $ > > [if you try to install rustup, it offers to remove rustc and cargo!]
The parts of my CI code that use rustup should not be interpreted as the right or wrong way to acquire rustc + cargo. So long as the distribution you're using has an appropriate rustc and cargo version then it doesn't matter. The reason why I used rustup in the github workflows is because rustup makes it easy to install different toolchains. rustc and cargo are released in lockstep so it's confusing when they're not both part of the same package in a distro.
Show 9 quoted lines
> Also: > > $ cbindgen --version > Command 'cbindgen' not found, but can be installed with: > sudo apt install cbindgen > $ > > [I haven't tried installing cbindgen, so I don't know if it would uninstall > rustc and cargo :) ]
Again this is confusing because cbindgen is a crate that can be
installed via 'cargo install cbindgen` and then run as `cbindgen`. I
think it would be worthwhile to go over some Rust terminology:
[rustc]: The rust compiler.
[cargo]: Canonical build system + package manager. Even rustc uses
cargo to build itself.
[rustup]: Rust toolchain manager. This provides rustc and cargo + other stuff.
[crate]: The unit of compilation. In C it's akin to a single library
file or executable. It follows the structure of
my_crate
├── Cargo.toml
└── src
├── do_that.rs
├── do_this.rs
└── lib.rs
Where src/lib.rs (the entry point) means it's a library crate and
main.rs (the entry point) would mean it's an executable crate (though
you can define both in the same crate).This means for each crate there will be lib<crate>.a and optionally interop/<crate>.h. So places like xdiff and reftable would be easy to fit into the concept of a crate. The rest of Git would take some doing to organize into crates.