Re: fix: propagate M4 env variable to flex subprocess - Mailing list pgsql-hackers

From J. Javier Maestro
Subject Re: fix: propagate M4 env variable to flex subprocess
Date
Msg-id CABvji06nzUvMbyZRXhG178U6tER0WrRX78tfMbW46_SCpZ6U+A@mail.gmail.com
Whole thread Raw
In response to Re: fix: propagate M4 env variable to flex subprocess  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Tue, May 13, 2025 at 11:54 AM Andres Freund <andres@anarazel.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

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Possible regression in PG18 beta1
Next
From: Shaik Mohammad Mujeeb
Date:
Subject: Suggestion: Update Copyright Year to 2025 in Recently Added Files