From: Patrick Steinhardt <ps@pks.im>
To: Toon Claes <toon@iotcl.com>
Cc: git@vger.kernel.org, Evan Martin <evan.martin@gmail.com>,
Eli Schwartz <eschwartz@gentoo.org>,
Junio C Hamano <gitster@pobox.com>,
M Hickford <mirth.hickford@gmail.com>
Subject: Re: [PATCH v2 06/11] meson: wire up generation of distribution archive
Date: Wed, 22 Jan 2025 13:05:03 +0100 [thread overview]
Message-ID: <Z5De75u-TpwmUpZ7@pks.im> (raw)
In-Reply-To: <87plkgibr0.fsf@iotcl.com>
On Tue, Jan 21, 2025 at 01:37:23PM +0100, Toon Claes wrote:
> Patrick Steinhardt <ps@pks.im> writes:
>
> > Meson knows to generate distribution archives via `meson dist`. In
> > addition to generating the archive itself, this target also knows to
> > compile and execute tests from that archive, which helps to ensure that
> > the result is an adequate drop-in replacement for the versioned project.
> >
> > While this already works as-is, one omission is that we don't propagate
> > the commit that this is built from into the resulting archive. This can
> > be fixed though by adding a distribution script that propagates the
> > version into the "version" file, which GIT-VERSION-GEN knows to read if
> > present.
> >
> > Use GIT-VERSION-GEN to populate that file. As the script is executed in
> > the build directory, not in the directory where we generate the archive,
> > we have adapt it to honor the "MESON_DIST_ROOT" environment variable.
>
> I failed to understand why you couldn't pass the absolute path of the
> output file to GIT-VERSION-GEN. So I looked at the previous version of
> this patch, and it seems you explain better over there.
>
> I was testing things locally and tried this line for the last argument
> to the script:
>
> run_command(shell, '-c', 'echo $MESON_DIST_ROOT', capture: true, check: true).stdout().strip() / 'version',
>
> And I think I understand it better now. Meson does not execute this when
> you run `meson dist`, but when it (re)generates it's build files. At
> that stage $MESON_DIST_ROOT is not set.
>
> It's unfortunate we have to learn GIT-VERSION-GEN about the
> $MESON_DIST_ROOT environment variable, but I don't see any other way.
Hm. Thinking about it a bit more there is an alternative:
meson.add_dist_script(
shell,
'-c',
'"$1" "$2" "$3" --format="@GIT_VERSION@" "$MESON_DIST_ROOT/version"',
'GIT-VERSION-GEN',
shell,
meson.current_source_dir() / 'GIT-VERSION-GEN',
meson.current_source_dir(),
)
I think this is a much better solution as it doesn't require us to teach
the script about `MESON_DIST_ROOT`.
Patrick
next prev parent reply other threads:[~2025-01-22 12:05 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 8:33 [PATCH 0/9] meson: a couple of additions Patrick Steinhardt
2025-01-13 8:33 ` [PATCH 1/9] GIT-VERSION-GEN: simplify computing the dirty marker Patrick Steinhardt
2025-01-13 8:33 ` [PATCH 2/9] GIT-VERSION-GEN: move default version into a separate file Patrick Steinhardt
2025-01-13 17:42 ` Junio C Hamano
2025-01-13 17:51 ` Eli Schwartz
2025-01-14 9:13 ` Patrick Steinhardt
2025-01-13 8:33 ` [PATCH 3/9] meson: fix dependencies for generated headers Patrick Steinhardt
2025-01-13 8:33 ` [PATCH 4/9] meson: wire up development environments Patrick Steinhardt
2025-01-13 8:33 ` [PATCH 5/9] meson: wire up generation of distribution archive Patrick Steinhardt
2025-01-13 17:55 ` Junio C Hamano
2025-01-14 9:14 ` Patrick Steinhardt
2025-01-13 8:33 ` [PATCH 6/9] meson: wire up fuzzers Patrick Steinhardt
2025-01-13 17:48 ` Junio C Hamano
2025-01-14 10:31 ` Patrick Steinhardt
2025-01-13 8:33 ` [PATCH 7/9] meson: make the CSPRNG backend configurable Patrick Steinhardt
2025-01-13 9:25 ` Patrick Steinhardt
2025-01-13 17:59 ` Junio C Hamano
2025-01-14 9:13 ` Patrick Steinhardt
2025-01-14 19:13 ` Junio C Hamano
2025-01-13 8:33 ` [PATCH 8/9] meson: fix compilation with Visual Studio Patrick Steinhardt
2025-01-13 21:12 ` M Hickford
2025-01-13 8:33 ` [PATCH 9/9] ci: wire up Visual Studio build with Meson Patrick Steinhardt
2025-01-14 11:56 ` [PATCH v2 00/11] meson: a couple of additions Patrick Steinhardt
2025-01-14 11:56 ` [PATCH v2 01/11] GIT-VERSION-GEN: simplify computing the dirty marker Patrick Steinhardt
2025-01-14 11:56 ` [PATCH v2 02/11] GIT-VERSION-GEN: allow running without input and output files Patrick Steinhardt
2025-01-21 13:16 ` Toon Claes
2025-01-14 11:56 ` [PATCH v2 03/11] meson: populate project version via GIT-VERSION-GEN Patrick Steinhardt
2025-01-21 13:13 ` Toon Claes
2025-01-14 11:56 ` [PATCH v2 04/11] meson: fix dependencies for generated headers Patrick Steinhardt
2025-01-14 11:56 ` [PATCH v2 05/11] meson: wire up development environments Patrick Steinhardt
2025-01-14 11:56 ` [PATCH v2 06/11] meson: wire up generation of distribution archive Patrick Steinhardt
2025-01-21 12:37 ` Toon Claes
2025-01-22 12:05 ` Patrick Steinhardt [this message]
2025-01-14 11:56 ` [PATCH v2 07/11] meson: wire up fuzzers Patrick Steinhardt
2025-01-14 11:56 ` [PATCH v2 08/11] meson: make the CSPRNG backend configurable Patrick Steinhardt
2025-01-14 11:56 ` [PATCH v2 09/11] meson: fix compilation with Visual Studio Patrick Steinhardt
2025-01-14 11:56 ` [PATCH v2 10/11] ci: raise error when Meson generates warnings Patrick Steinhardt
2025-01-21 12:59 ` Toon Claes
2025-01-14 11:56 ` [PATCH v2 11/11] ci: wire up Visual Studio build with Meson Patrick Steinhardt
2025-01-14 17:46 ` [PATCH v2 00/11] meson: a couple of additions Junio C Hamano
2025-01-22 12:05 ` [PATCH v3 " Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 01/11] GIT-VERSION-GEN: simplify computing the dirty marker Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 02/11] GIT-VERSION-GEN: allow running without input and output files Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 03/11] meson: populate project version via GIT-VERSION-GEN Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 04/11] meson: fix dependencies for generated headers Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 05/11] meson: wire up development environments Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 06/11] meson: wire up generation of distribution archive Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 07/11] meson: wire up fuzzers Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 08/11] meson: make the CSPRNG backend configurable Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 09/11] meson: fix compilation with Visual Studio Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 10/11] ci: raise error when Meson generates warnings Patrick Steinhardt
2025-01-22 12:05 ` [PATCH v3 11/11] ci: wire up Visual Studio build with Meson Patrick Steinhardt
2025-01-22 21:42 ` [PATCH v3 00/11] meson: a couple of additions Junio C Hamano
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=Z5De75u-TpwmUpZ7@pks.im \
--to=ps@pks.im \
--cc=eschwartz@gentoo.org \
--cc=evan.martin@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mirth.hickford@gmail.com \
--cc=toon@iotcl.com \
/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).