Re: [PATCH v2 13/18] build-helper: link against libgit.a and any other required C libraries
- From
D. Ben Knoble <ben.knoble@gmail.com>
- Date
- Sep 17, 2025, 23:07 UTC
- Message-ID
- <CALnO6CAmNTAOj0wkkPoEMOhHB1bgM4xBKa1=4zuS1Cs=UAq_BA@mail.gmail.com>
- In-Reply-To
- <CAPig+cTZch_pvfurtjBTNphMeRQL6jSBSjNY-4mffjoXZ4eqcw@mail.gmail.com>
On Wed, Sep 17, 2025 at 4:52 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 31 quoted lines
>
> On Tue, Sep 16, 2025 at 9:18 PM Ezekiel Newren via GitGitGadget
> > +impl BuildHelper {
> > + pub fn build(self) {
> > + let use_linking = parse_bool_from_option(self.crate_env.get("USE_LINKING"), self.crate_env.get("CARGO_TARGET_DIR").is_none());
> > + ...
> > + println!("cargo:warning={} is not linking against C objects, `USE_LINKING=true cargo test`", self.crate_env["CARGO_PKG_NAME"]);
>
> There are more than a few developers on this project (including
> myself) who still use 80-column editors and terminals. As a general
> style guideline, this project does recommend wrapping code to fit
> within 80 columns (except in cases when doing so would severely hurt
> readability). I imagine that the same sort of guideline would be
> appreciated in Rust code, as well, by those who still stick with 80
> columns.
>
> I bring this up because, although it hasn't been such a big deal with
> the existing C code, assuming that developers run `rustfmt` on the
> code before sending a patch series, then this may become an issue if
> different developers have `rustfmt` configured to enforce different
> maximum column width, especially since `rustfmt` is likely to reformat
> the entire file rather than just the region that has just been edited.
> So, if this code gets checked in as-is with these very wide lines, and
> then someone else, who has `rustfmt` configured for 80-columns edits
> the file, then it becomes a problem.
>
> As such, can we also add a project-wide `rustfmt.toml` which, at
> minimum, sets the maximum line width to 80? For instance:
>
> max_width = 80
>I believe rustfmt and Rust generally uses a 100 column limit.
See - https://github.com/rust-lang/rust/pull/5340 - https://rust-lang.github.io/rustfmt/?version=v1.8.0&search=#max_width
Perhaps you knew this, and are really suggesting we break with Rust style for our own style?
For handling personal configs, we could try to maintain a config here that repeats all the defaults, but that seems like more maintenance headache than noticing unnecessary reformatting and reminding folks we use the defaults (except where we have config that specifies otherwise). Although the docs site doesn’t suggest the configs are layered like for Git, so perhaps a blank config is sufficient to enforce « we use the defaults »?
-- D. Ben Knoble