git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: "brian m. carlson" <sandals@crustytoothpaste.net>,
	git@vger.kernel.org,
	"Haelwenn (lanodan) Monnier" <contact@hacktivis.me>,
	Ben Knoble <ben.knoble@gmail.com>,
	Christian Brabandt <cb@256bit.org>,
	Collin Funk <collin.funk1@gmail.com>,
	Eli Schwartz <eschwartz@gentoo.org>,
	Elijah Newren <newren@gmail.com>,
	Ezekiel Newren <ezekielnewren@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <gitster@pobox.com>,
	Phillip Wood <phillip.wood123@gmail.com>,
	Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>,
	Sam James <sam@gentoo.org>, Taylor Blau <me@ttaylorr.com>
Subject: Re: [PATCH RFC v3 1/8] meson: add infrastructure to build internal Rust library
Date: Wed, 10 Sep 2025 10:22:11 +0200	[thread overview]
Message-ID: <aME1M4YsMsrmu2Vg@pks.im> (raw)
In-Reply-To: <aL9UIeyUqmwwPt2c@fruit.crustytoothpaste.net>

On Mon, Sep 08, 2025 at 10:09:37PM +0000, brian m. carlson wrote:
> On 2025-09-08 at 14:13:08, Patrick Steinhardt wrote:
> > diff --git a/Cargo.lock b/Cargo.lock
> > new file mode 100644
> > index 00000000000..2b80a01e22a
> > --- /dev/null
> > +++ b/Cargo.lock
> > @@ -0,0 +1,22 @@
> > +# This file is automatically @generated by Cargo.
> > +# It is not intended for manual editing.
> > +# Fix this to version 3. This is required so that older toolchains can still
> > +# read the lock file. Furthermore, while an argument could be made that we
> > +# should not even commit the "Cargo.lock" file in the first place, there's two
> > +# reasons to still do so:
> > +#
> > +#   - It thwarts supply-chain attacks by committing checksums into the
> > +#     repository.
> > +#
> > +#   - It is required by Meson so that it can extract Cargo dependencies.
> 
> If we check this in, then we basically cannot use any dependencies.  As
> I mentioned elsewhere, the problem is that invariably, if we're going to
> pin to an older version of Rust, we're going to be faced with the
> problem that some crate is going to require a security update that is
> also going to break older versions of Rust, and we will then have users
> aggressively demanding on the list that we update it immediately and
> ship a new release, breaking those older compilers.  (And yes, I've seen
> this happen with Go dependencies on Git LFS, even when the vulnerable
> code is not used.)

Hm. This one just feels weird to me. Doesn't it break reproducible
builds and create new attack vectors for supply-chain attacks?

> This is made worse by the fact that you want to support Rust 1.49
> instead of Rust 1.63, as I proposed.  Absent some compelling proposal on
> how we're going to deal with this situation, I think we need to omit
> `Cargo.lock`.

Just to clarify: this is only initially, until we have a good reason to
pick a later version of Rust. Right now, to the best of my knowledge
(and please correct me if I'm wrong), we don't have any reason to use
Rust 1.63 yet.

I'd like to pick the minimum version with a certain intent, where the
current intent is that 1.49 may ease the pressure on downstream users of
Git via gcc-rs at one point in time. Once there are reasons for why we
want a newer version of Rust though we should definitely discuss whether
it makes sense for us to bump the requirements.

Does that make sense?

> I think the better approach is to leave it out and use Cargo to build
> the Rust code instead of having Meson do it directly.
> 
> > +# Starting with Meson 1.5, it knows to parse the "Cargo.lock" file and extract
> > +# dependencies from it. So from hereon we don't need Cargo anymore to build
> > +# Git.
> 
> Ah, yes, I've already broken this in my branch (early this morning, in
> fact).  I've added a `build.rs` file (used by Cargo) which is necessary
> to properly link the tests against `libgit.a`.  (I'm using the hashing
> code in some of my tests.) Meson fails to honour that and so the
> compilation breaks.

Too bad.

> I don't think it's going to be viable to try to maintain two separate
> build systems that build the Rust code.  Everyone who uses rust-analyzer
> (the Rust LSP) will use Cargo because that's the build system it uses,
> and everyone uses Cargo anyway, so as a practical matter we need to
> support it.  Trying to have Meson do its own thing is unlikely to work
> here, and it demands that we use the `Cargo.lock` file, which we'd like
> to avoid.

Unfortunate, but probably fair. Let's take the simple route for now and
potentially iterate down the road.

> > +  cargo_command = [
> > +    cargo,
> > +    'build',
> > +    '--lib',
> > +    '--quiet',
> > +    '--manifest-path',
> > +    meson.project_source_root() / 'Cargo.toml',
> > +    '--target-dir',
> > +    meson.current_build_dir() / 'target',
> > +    # `--out-dir` is unstable, but supported since 2018. It's been recently
> > +    # renamed to `--artifact-dir`, but for now both options are supported.
> > +    '-Z',
> > +    'unstable-options',
> 
> `-Z` is only accepted in nightly versions of the compiler.  This won't
> work with stable Rust and it definitely won't work with either 1.63 or
> 1.49.  It didn't work for me using Rust 1.89.0 when I removed the other
> branch.

Huh, weird. No idea why it works on my system with Rust 1.89.0 then.

It's kind of puzzling that something as simple as specifying where Cargo
puts the build artifacts is a nightly feature. All I really want is to
say `cargo build -o $PATH`. Oh, well...

Patrick

  parent reply	other threads:[~2025-09-10  8:22 UTC|newest]

Thread overview: 207+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 14:26 [PATCH RFC 0/3] Introduce Rust and announce that it will become mandatorty Patrick Steinhardt
2025-09-04 14:26 ` [PATCH RFC 1/3] meson: add infrastructure to build internal Rust library Patrick Steinhardt
2025-09-04 18:50   ` Junio C Hamano
2025-09-05  7:53     ` Patrick Steinhardt
2025-09-04 22:06   ` brian m. carlson
2025-09-04 22:46     ` Junio C Hamano
2025-09-05  7:49       ` Patrick Steinhardt
2025-09-05  1:16     ` Eli Schwartz
2025-09-05  7:50       ` Patrick Steinhardt
2025-09-05 13:20         ` Eli Schwartz
2025-09-04 14:26 ` [PATCH RFC 2/3] rust: implement a test balloon via the "varint" subsystem Patrick Steinhardt
2025-09-04 22:37   ` brian m. carlson
2025-09-05  7:54     ` Patrick Steinhardt
2025-09-04 23:39   ` Ezekiel Newren
2025-09-05  2:00     ` Eli Schwartz
2025-09-05  7:54       ` Patrick Steinhardt
2025-09-05 13:39         ` Eli Schwartz
2025-09-07 20:07   ` Ben Knoble
2025-09-08  4:39     ` Junio C Hamano
2025-09-08 11:39       ` Patrick Steinhardt
2025-09-09  0:49       ` Ben Knoble
2025-09-09 15:27         ` Junio C Hamano
2025-09-08  6:44     ` Patrick Steinhardt
2025-09-04 14:26 ` [PATCH RFC 3/3] BreakingChanges: announce Rust becoming mandatory Patrick Steinhardt
2025-09-04 17:38   ` Eric Sunshine
2025-09-05  7:54     ` Patrick Steinhardt
2025-09-05 11:50 ` [PATCH RFC v2 0/7] Introduce Rust and announce that it will become mandatorty Patrick Steinhardt
2025-09-05 11:50   ` [PATCH RFC v2 1/7] meson: add infrastructure to build internal Rust library Patrick Steinhardt
2025-09-05 17:47     ` Justin Tobler
2025-09-08  6:42       ` Patrick Steinhardt
2025-09-07  4:54     ` Elijah Newren
2025-09-08  6:42       ` Patrick Steinhardt
2025-09-05 11:50   ` [PATCH RFC v2 2/7] Makefile: introduce " Patrick Steinhardt
2025-09-05 20:21     ` brian m. carlson
2025-09-08  6:40       ` Patrick Steinhardt
2025-09-07  4:58     ` Elijah Newren
2025-09-08  6:41       ` Patrick Steinhardt
2025-09-07 15:26     ` SZEDER Gábor
2025-09-08  6:41       ` Patrick Steinhardt
2025-09-05 11:50   ` [PATCH RFC v2 3/7] help: report on whether or not Rust is enabled Patrick Steinhardt
2025-09-05 19:51     ` brian m. carlson
2025-09-07  5:00       ` Elijah Newren
2025-09-05 11:51   ` [PATCH RFC v2 4/7] rust: implement a test balloon via the "varint" subsystem Patrick Steinhardt
2025-09-05 21:46     ` Junio C Hamano
2025-09-05 22:39       ` Junio C Hamano
2025-09-05 23:04         ` brian m. carlson
2025-09-05 11:51   ` [PATCH RFC v2 5/7] BreakingChanges: announce Rust becoming mandatory Patrick Steinhardt
2025-09-05 12:45     ` Matthias Aßhauer
2025-09-05 13:38       ` Patrick Steinhardt
2025-09-05 14:38         ` Eli Schwartz
2025-09-08  6:42           ` Patrick Steinhardt
2025-09-07  5:31         ` Elijah Newren
2025-09-08  6:42           ` Patrick Steinhardt
2025-09-05 14:22       ` Phillip Wood
2025-09-05 14:32       ` Eli Schwartz
2025-09-05 19:34         ` brian m. carlson
2025-09-07  5:25     ` Elijah Newren
2025-09-05 11:51   ` [PATCH RFC v2 6/7] ci: convert "pedantic" job into full build with breaking changes Patrick Steinhardt
2025-09-07  0:21     ` Junio C Hamano
2025-09-08  6:41       ` Patrick Steinhardt
2025-09-05 11:51   ` [PATCH RFC v2 7/7] ci: enable Rust for breaking-changes jobs Patrick Steinhardt
2025-09-05 19:56     ` brian m. carlson
2025-09-08  6:40       ` Patrick Steinhardt
2025-09-05 21:00     ` Junio C Hamano
2025-09-08  6:40       ` Patrick Steinhardt
2025-09-05 14:14   ` [PATCH RFC v2 0/7] Introduce Rust and announce that it will become mandatorty Phillip Wood
2025-09-05 14:28     ` Patrick Steinhardt
2025-09-07  4:31       ` Elijah Newren
2025-09-08  6:44         ` Patrick Steinhardt
2025-09-08 23:00           ` brian m. carlson
2025-09-10  8:21             ` Patrick Steinhardt
2025-09-09  6:33           ` Elijah Newren
2025-09-10  8:21             ` Patrick Steinhardt
2025-09-09  9:12       ` Phillip Wood
2025-09-10  8:21         ` Patrick Steinhardt
2025-09-10  9:32           ` Phillip Wood
2025-09-10 10:49             ` Patrick Steinhardt
2025-09-08 14:13 ` [PATCH RFC v3 0/8] " Patrick Steinhardt
2025-09-08 14:13   ` [PATCH RFC v3 1/8] meson: add infrastructure to build internal Rust library Patrick Steinhardt
2025-09-08 22:09     ` brian m. carlson
2025-09-09  1:03       ` brian m. carlson
2025-09-10  8:22       ` Patrick Steinhardt [this message]
2025-09-08 14:13   ` [PATCH RFC v3 2/8] Makefile: reorder sources after includes Patrick Steinhardt
2025-09-08 14:13   ` [PATCH RFC v3 3/8] Makefile: introduce infrastructure to build internal Rust library Patrick Steinhardt
2025-09-08 14:13   ` [PATCH RFC v3 4/8] help: report on whether or not Rust is enabled Patrick Steinhardt
2025-09-08 14:13   ` [PATCH RFC v3 5/8] rust: implement a test balloon via the "varint" subsystem Patrick Steinhardt
2025-09-08 17:19     ` Ezekiel Newren
2025-09-08 22:22       ` brian m. carlson
2025-09-10  8:22         ` Patrick Steinhardt
2025-09-08 14:13   ` [PATCH RFC v3 6/8] BreakingChanges: announce Rust becoming mandatory Patrick Steinhardt
2025-09-08 14:13   ` [PATCH RFC v3 7/8] ci: convert "pedantic" job into full build with breaking changes Patrick Steinhardt
2025-09-08 14:13   ` [PATCH RFC v3 8/8] ci: enable Rust for breaking-changes jobs Patrick Steinhardt
2025-09-08 14:20   ` [PATCH RFC v3 0/8] Introduce Rust and announce that it will become mandatorty Kristoffer Haugsbakk
2025-09-10 15:35 ` [PATCH RFC v4 0/9] Introduce Rust and announce that it will become mandatory Patrick Steinhardt
2025-09-10 15:35   ` [PATCH RFC v4 1/9] meson: add infrastructure to build internal Rust library Patrick Steinhardt
2025-09-11 21:33     ` brian m. carlson
2025-09-10 15:35   ` [PATCH RFC v4 2/9] Makefile: reorder sources after includes Patrick Steinhardt
2025-09-10 15:35   ` [PATCH RFC v4 3/9] Makefile: introduce infrastructure to build internal Rust library Patrick Steinhardt
2025-09-10 15:35   ` [PATCH RFC v4 4/9] help: report on whether or not Rust is enabled Patrick Steinhardt
2025-09-10 15:35   ` [PATCH RFC v4 5/9] varint: use explicit width for integers Patrick Steinhardt
2025-09-10 21:04     ` Junio C Hamano
2025-09-10 15:35   ` [PATCH RFC v4 6/9] varint: reimplement as test balloon for Rust Patrick Steinhardt
2025-09-10 15:35   ` [PATCH RFC v4 7/9] BreakingChanges: announce Rust becoming mandatory Patrick Steinhardt
2025-09-10 21:20     ` Junio C Hamano
2025-09-15 10:53       ` Patrick Steinhardt
2025-09-22 16:24         ` Junio C Hamano
2025-09-23  5:32           ` Patrick Steinhardt
2025-09-23  8:53             ` LTS "lieutenant", was " Johannes Schindelin
2025-09-24 13:47               ` Patrick Steinhardt
2025-09-23 14:31             ` Junio C Hamano
2025-09-24 12:53               ` Patrick Steinhardt
2025-09-24 17:43                 ` Junio C Hamano
2025-09-10 21:42     ` Kristoffer Haugsbakk
2025-09-15 10:53       ` Patrick Steinhardt
2025-09-10 15:35   ` [PATCH RFC v4 8/9] ci: convert "pedantic" job into full build with breaking changes Patrick Steinhardt
2025-09-10 15:35   ` [PATCH RFC v4 9/9] ci: enable Rust for breaking-changes jobs Patrick Steinhardt
2025-09-11 21:55   ` [PATCH RFC v4 0/9] Introduce Rust and announce that it will become mandatory brian m. carlson
2025-09-15 10:53     ` Patrick Steinhardt
2025-09-12 15:45   ` SZEDER Gábor
2025-09-12 16:32     ` Junio C Hamano
2025-09-15 10:50       ` Patrick Steinhardt
2025-09-15 11:22 ` [PATCH v5 " Patrick Steinhardt
2025-09-15 11:22   ` [PATCH v5 1/9] meson: add infrastructure to build internal Rust library Patrick Steinhardt
2025-09-15 11:22   ` [PATCH v5 2/9] Makefile: reorder sources after includes Patrick Steinhardt
2025-09-15 11:22   ` [PATCH v5 3/9] Makefile: introduce infrastructure to build internal Rust library Patrick Steinhardt
2025-09-15 11:22   ` [PATCH v5 4/9] help: report on whether or not Rust is enabled Patrick Steinhardt
2025-09-15 11:22   ` [PATCH v5 5/9] varint: use explicit width for integers Patrick Steinhardt
2025-09-15 11:22   ` [PATCH v5 6/9] varint: reimplement as test balloon for Rust Patrick Steinhardt
2025-09-15 11:22   ` [PATCH v5 7/9] BreakingChanges: announce Rust becoming mandatory Patrick Steinhardt
2025-09-17 22:09     ` SZEDER Gábor
2025-09-18  1:19       ` brian m. carlson
2025-09-22 19:34         ` SZEDER Gábor
2025-09-22 20:59           ` Junio C Hamano
2025-09-22 22:15             ` brian m. carlson
2025-09-22 22:56               ` Junio C Hamano
2025-09-23  1:59                 ` Elijah Newren
2025-09-23  4:54                 ` Patrick Steinhardt
2025-09-23 14:17                   ` Junio C Hamano
2025-09-23  0:43             ` Ezekiel Newren
2025-09-19 13:59     ` Phillip Wood
2025-09-22 13:01       ` Patrick Steinhardt
2025-09-22 14:07         ` Phillip Wood
2025-09-22 14:38           ` Patrick Steinhardt
2025-09-15 11:22   ` [PATCH v5 8/9] ci: convert "pedantic" job into full build with breaking changes Patrick Steinhardt
2025-09-15 11:22   ` [PATCH v5 9/9] ci: enable Rust for breaking-changes jobs Patrick Steinhardt
2025-09-15 17:12   ` [PATCH v5 0/9] Introduce Rust and announce that it will become mandatory Junio C Hamano
2025-09-16  2:03   ` Ezekiel Newren
2025-09-16 10:06     ` Patrick Steinhardt
2025-09-17 12:07       ` Sam James
2025-09-17 17:30         ` Ezekiel Newren
2025-09-16 22:25     ` Ramsay Jones
2025-09-16 23:38       ` Ezekiel Newren
2025-09-17 18:32         ` Ramsay Jones
2025-09-18  3:47   ` Elijah Newren
2025-09-25  1:10   ` what's missing from newer C? [was: [PATCH v5 0/9] Introduce Rust ....] Eric Wong
2025-09-26 22:17     ` Ezekiel Newren
2025-10-04  1:02       ` Eric Wong
2025-10-06  9:13         ` Pierre-Emmanuel Patry
2025-09-19 18:41 ` [PATCH RFC 0/3] Introduce Rust and announce that it will become mandatorty John Paul Adrian Glaubitz
2025-09-22 13:01   ` Patrick Steinhardt
2025-09-23  9:45 ` [PATCH v6 0/9] Introduce Rust and announce that it will become mandatory Patrick Steinhardt
2025-09-23  9:45   ` [PATCH v6 1/9] meson: add infrastructure to build internal Rust library Patrick Steinhardt
2025-09-23  9:45   ` [PATCH v6 2/9] Makefile: reorder sources after includes Patrick Steinhardt
2025-09-23  9:45   ` [PATCH v6 3/9] Makefile: introduce infrastructure to build internal Rust library Patrick Steinhardt
2025-09-23  9:45   ` [PATCH v6 4/9] help: report on whether or not Rust is enabled Patrick Steinhardt
2025-09-23  9:45   ` [PATCH v6 5/9] varint: use explicit width for integers Patrick Steinhardt
2025-09-23  9:45   ` [PATCH v6 6/9] varint: reimplement as test balloon for Rust Patrick Steinhardt
2025-09-23  9:45   ` [PATCH v6 7/9] BreakingChanges: announce Rust becoming mandatory Patrick Steinhardt
2025-09-23 15:29     ` Phillip Wood
2025-09-23 17:29       ` Junio C Hamano
2025-09-24  5:03         ` Patrick Steinhardt
2025-09-23  9:45   ` [PATCH v6 8/9] ci: convert "pedantic" job into full build with breaking changes Patrick Steinhardt
2025-09-23  9:45   ` [PATCH v6 9/9] ci: enable Rust for breaking-changes jobs Patrick Steinhardt
2025-09-23 20:15   ` [PATCH v6 0/9] Introduce Rust and announce that it will become mandatory Ezekiel Newren
2025-09-24  5:02     ` Patrick Steinhardt
2025-09-24 14:34       ` Ezekiel Newren
2025-09-25  6:30 ` [PATCH v7 " Patrick Steinhardt
2025-09-25  6:30   ` [PATCH v7 1/9] meson: add infrastructure to build internal Rust library Patrick Steinhardt
2025-09-25  6:30   ` [PATCH v7 2/9] Makefile: reorder sources after includes Patrick Steinhardt
2025-09-25 21:33     ` Ramsay Jones
2025-09-25  6:30   ` [PATCH v7 3/9] Makefile: introduce infrastructure to build internal Rust library Patrick Steinhardt
2025-09-25  6:30   ` [PATCH v7 4/9] help: report on whether or not Rust is enabled Patrick Steinhardt
2025-09-25  6:30   ` [PATCH v7 5/9] varint: use explicit width for integers Patrick Steinhardt
2025-09-30 13:34     ` Kristoffer Haugsbakk
2025-10-01 17:22       ` Ezekiel Newren
2025-10-02  7:30         ` Patrick Steinhardt
2025-09-25  6:30   ` [PATCH v7 6/9] varint: reimplement as test balloon for Rust Patrick Steinhardt
2025-10-01 17:21     ` Ezekiel Newren
2025-10-01 19:44       ` Junio C Hamano
2025-09-25  6:30   ` [PATCH v7 7/9] BreakingChanges: announce Rust becoming mandatory Patrick Steinhardt
2025-09-25  6:30   ` [PATCH v7 8/9] ci: convert "pedantic" job into full build with breaking changes Patrick Steinhardt
2025-09-25  6:30   ` [PATCH v7 9/9] ci: enable Rust for breaking-changes jobs Patrick Steinhardt
2025-09-25 16:35   ` [PATCH v7 0/9] Introduce Rust and announce that it will become mandatory Junio C Hamano
2025-10-01 18:43     ` Ezekiel Newren
2025-10-02  7:29 ` [PATCH v8 " Patrick Steinhardt
2025-10-02  7:29   ` [PATCH v8 1/9] meson: add infrastructure to build internal Rust library Patrick Steinhardt
2025-10-02  7:29   ` [PATCH v8 2/9] Makefile: reorder sources after includes Patrick Steinhardt
2025-10-02  7:29   ` [PATCH v8 3/9] Makefile: introduce infrastructure to build internal Rust library Patrick Steinhardt
2025-10-02  7:29   ` [PATCH v8 4/9] help: report on whether or not Rust is enabled Patrick Steinhardt
2025-10-02  7:29   ` [PATCH v8 5/9] varint: use explicit width for integers Patrick Steinhardt
2025-10-02  7:29   ` [PATCH v8 6/9] varint: reimplement as test balloon for Rust Patrick Steinhardt
2025-10-02  7:29   ` [PATCH v8 7/9] BreakingChanges: announce Rust becoming mandatory Patrick Steinhardt
2025-10-02  7:29   ` [PATCH v8 8/9] ci: convert "pedantic" job into full build with breaking changes Patrick Steinhardt
2025-10-02  7:29   ` [PATCH v8 9/9] ci: enable Rust for breaking-changes jobs Patrick Steinhardt
2025-10-02 16:38   ` [PATCH v8 0/9] Introduce Rust and announce that it will become mandatory Junio C Hamano
2025-10-07  9:59     ` Patrick Steinhardt
2025-10-02 23:35   ` Ezekiel Newren

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=aME1M4YsMsrmu2Vg@pks.im \
    --to=ps@pks.im \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ben.knoble@gmail.com \
    --cc=cb@256bit.org \
    --cc=collin.funk1@gmail.com \
    --cc=contact@hacktivis.me \
    --cc=eschwartz@gentoo.org \
    --cc=ezekielnewren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=newren@gmail.com \
    --cc=phillip.wood123@gmail.com \
    --cc=pierre-emmanuel.patry@embecosm.com \
    --cc=sam@gentoo.org \
    --cc=sandals@crustytoothpaste.net \
    /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;
as well as URLs for NNTP newsgroup(s).