Re: [PATCH v2] kbuild: resolve symlinks for O= properly

From: Nicolas Schier
Date: Mon Jan 22 2024 - 10:21:56 EST


On Mon, Jan 22, 2024 at 03:12:03PM +0100, Sebastian Andrzej Siewior wrote:
> On 2023-12-16 01:06:37 [+0900], Masahiro Yamada wrote:
>
> > Using the physical directory structure for the O= option seems more
> > reasonable.
> >
> > The comment says "expand a shell special character '~'", but it has
> > already been expanded to the home directory in the command line.
>
> It might have been expanded, it might have not been expanded. Having a
> shell script:
> | #!/bin/sh
> |
> | exec make O=~/scratch/mk-check defconfig
>
> with bin/sh = dash results in:
>
> | make[1]: Entering directory '/home/bigeasy/linux/~/scratch/mk-check'
>
> while bin/sh = bash expands the ~ properly before for O=. Would it be
> too much to ask, to expand the ~?

Expanding tilde expandos is traditionally a shell feature, as you
already mentioned; and bash supports also expandos like '~+' and '~-'.
I think, we should leave the shell things in shells.

Thus, please update your shell scripts to be compliant to their
interpreting shell (e.g. use '$HOME' or switch the shell).

Kind regards,
Nicolas

Attachment: signature.asc
Description: PGP signature