Re: fix: propagate M4 env variable to flex subprocess

From: "J(dot) Javier Maestro" <jjmaestro(at)ieee(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: fix: propagate M4 env variable to flex subprocess
Date: 2025-05-18 03:32:24
Message-ID: CABvji06nzUvMbyZRXhG178U6tER0WrRX78tfMbW46_SCpZ6U+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 13, 2025 at 11:54 AM Andres Freund <andres(at)anarazel(dot)de> wrote:

> Hi,
>
> On 2025-05-12 23:14:59 -0400, J. Javier Maestro wrote:
> > The pgflex wrapper runs flex with an explicit environment, so it doesn't
> > inherit environment variables from the parent process. However, flex can
> > use the M4 env variable and/or the PATH (via execvp) to find the m4 macro
> > processor.
>
> > Thus, since flex honors the M4 env variable, it should be propagated to
> the
> > subprocess environment if it's set in the parent environment. This patch
> > fixes it.
>
> I think it probably was not intentional to fully specify the environment,
> rather than just *adding* FLEX_TMP_DIR to the caller's environment.

I think so, it definitely looks like the only intent was to
specify FLEX_TMP_DIR.

But even if the goal wasn’t to fully specify the environment, this fix is
only passing an env variable that's supposed to be there because Flex will
honor it if set.

> Bilal, I think you wrote this originally, do you recall?
>
> It seems like an issue beyond just M4...
>

IIRC the rest of the tools in the environment have ways to be specified via
Meson options (BISON, FLEX, PERL) so the only issue I see is Flex not being
able to find the specific m4 binary. What other issue(s) are you
considering?

Thanks!

Javier

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-05-18 07:24:43 Re: Find comment on SearchSysCacheLockedCopy1
Previous Message Paul A Jungwirth 2025-05-17 23:29:26 Find comment on SearchSysCacheLockedCopy1