Re: [PATCH 08/11] meson: simplify setup of PATH environment variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 29, 2025 at 02:42:07PM -0600, Justin Tobler wrote:
> On 25/01/29 08:12AM, Patrick Steinhardt wrote:
> >  script_environment = environment()
> > -foreach tool : ['cat', 'grep', 'sed']
> > -  program = find_program(tool, dirs: program_path)
> > -  script_environment.prepend('PATH', fs.parent(program.full_path()))
> > +foreach program : [cat, cygpath, diff, git, grep, sed, shell, tar]
> > +  if program.found()
> > +    script_environment.prepend('PATH', fs.parent(program.full_path()))
> > +  endif
> 
> It looks like cygpath, diff, shell, and tar were previously not being
> appended to the path environment. With this change now they are.

You know, I think I've been approaching this from the wrong angle. It's
not like we need to add these tools to PATH in case they have been found
via the usual PATH lookup: Meson knows to remember PATH just fine, so
the scripts would be able to find them anyway.

The actual issue is that we sometimes end up looking up programs via
something else but PATH, namely on Windows, where we may instead look up
programs via the Git for Windows installation. So the proper way to
handle this is to add these system-specific paths to PATH, not every
single binary's parent directory.

Will adapt, thanks for making me rethink.

Patrick




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux