git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] meson: ensure correct version-def.h is used

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 14, 2025, 06:52 UTC
Message-ID
<Z4YJkUg_DB0yyARs@pks.im>
In-Reply-To
<87bjwak4p7.fsf@iotcl.com>
On Mon, Jan 13, 2025 at 06:24:04PM +0100, Toon Claes wrote:
Show 16 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > What happens if we use <version-def.h> to include (which is how C
> > standard tells us to do), with an explicit include path specified
> > with -I<directory>?  If it solves the issue, that may be a better
> > approach.
> 
> I don't have a good source, but for example Wikipedia[1] says:
> 
>     Some preprocessors locate the include file differently based on the
>     enclosing delimiters; treating a path in double-quotes as relative
>     to the including file and a path in angle brackets as located in one
>     of the directories of the configured system search path.
> 
> So behavior seems to depend on the implementation of the compiler. I'm
> not sure we can trust all architectures to do what we expect.

Even if we could it still feels somewhat fragile. The top-level source directory gets added to our include paths, as well, and consequently it may also be found via <version-def.h>. So things would depend on the order of "-I" directives now. Which makes me lean into the direction of my proposed workaround, to optionally inject an absolute path.

> Or, because I don't expect many people to use Make and Meson at the
> same time, do we not consider this an issue for most anyway?

In the current phase I think it's still quite likely that people use both at the same time, so fixing it would be nice.

Patrick
Previous: Toon ClaesNext: Toon Claes
Message 5 of 8 in “meson: ensure correct version-def.h is used”
  1. meson: ensure correct version-def.h is usedToon Claes, Jan 13, 2025
  2. Patrick SteinhardtJan 13, 2025
  3. Junio C HamanoJan 13, 2025
  4. Toon ClaesJan 13, 2025
  5. Patrick SteinhardtJan 14, 2025
  6. meson: ensure correct version-def.h is usedToon Claes, Jan 14, 2025
  7. Patrick SteinhardtJan 16, 2025
  8. Junio C HamanoJan 16, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.