From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Mike Hommey <mh@glandium.org>
Cc: git@vger.kernel.org, gitster@pobox.com, ps@pks.im
Subject: Re: [RFC PATCH] Move rust gitcore crate to a different subdirectory
Date: Thu, 5 Feb 2026 00:10:28 +0000 [thread overview]
Message-ID: <aYPf9CnNLjJtinqw@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <20260204232208.1615320-1-mh@glandium.org>
[-- Attachment #1: Type: text/plain, Size: 2259 bytes --]
On 2026-02-04 at 23:22:08, Mike Hommey wrote:
> While `src/` is the default directory convention for Rust projects, it
> is too generic in the context of a multi-language project that is barely
> starting to (optionally) use Rust code.
>
> Additionally, having `Cargo.toml` at the top-level of the repository
> implies that one can run `cargo build` directly, but this doesn't
> produce anything useful on its own.
>
> Moving all Rust-specific files into a dedicated `rust/` subdirectory
> makes things clearer.
If we're going to do this, we should place the `src` directory under the
`rust` subdirectory to maintain the normal layout. There are many tools
that depend on this repository layout and we want to make it as easy as
possible for people to use native, standard tooling to build things.
Note that I don't have strong opinions for or against placing the Rust
code in a subdirectory, but I do very much want the standard layout to
be honoured.
> The above is a post hoc justification. I do think it makes sense to do,
> but I should mention my real immediate motivation.
>
> git-cinnabar, a git remote helper used to talk to Mercurial servers, is
> a project based on libgit (the C parts). As such, its repository
> includes the git codebase as a submodule.
>
> As of about 3 years ago, most code that is not libgit in git-cinnabar is
> written in Rust, and is published on crates.io.
>
> Part of publishing on crates.io involves running `cargo publish`, which
> does `cargo package` under the hood. `cargo package` has the feature
> of... not including directories that contain a Cargo.toml, so upgrading
> libgit to 2.52.0 breaks the publishing process because all of the git
> source code is skipped, and git-cinnabar can't be built as a result.
>
> Of course, what this means is that this change is merely kicking the can
> down the road, because the problem will reappear when the rust code
> becomes non-optional in Git, thus why I'm making this RFC at the moment.
Perhaps you could ask Cargo upstream to add a feature to override that
in the meantime (or add such a feature yourself). I can imagine other
uses for such a feature.
--
brian m. carlson (they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2026-02-05 0:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 23:22 [RFC PATCH] Move rust gitcore crate to a different subdirectory Mike Hommey
2026-02-05 0:10 ` brian m. carlson [this message]
2026-02-05 1:45 ` Mike Hommey
2026-02-05 2:06 ` brian m. carlson
2026-02-05 4:55 ` Mike Hommey
2026-02-09 22:48 ` [PATCH v2] " Mike Hommey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYPf9CnNLjJtinqw@fruit.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mh@glandium.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox