tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Fix subst SUBST_NOOP_OK?=yes fallout
* On 2020-06-23 at 19:32 BST, Roland Illig wrote:
> On 23.06.2020 20:01, Jonathan Perkin wrote:
> > * On 2020-06-23 at 18:28 BST, Roland Illig wrote:
> >
> > > Can you run the following lines before and after the fix? Just to make
> > > sure that the subst.mk test suite would have caught this pdksh bug.
> > >
> > > cd regress/infra-unittests
> > > sh subst.sh
> >
> > Before the fix everything fails (44 "assertion failed in ...").
> >
> > After the fix I still see some failures:
> >
> > $ pdksh subst.sh
> > assertion failed in "brackets in filename patterns": file "*" has unexpected content:
> > --- /tmp/infra-unittests-47062/expected
> > +++ *
> > @@ -1 +1 @@
> > -after
> > +before
> >
> > assertion failed in "brackets in filename patterns": file "[*]" has unexpected content:
> > --- /tmp/infra-unittests-47062/expected
> > +++ [*]
> > @@ -1 +1 @@
> > -before
> > +after
>
> Oh, that's funny. This means that your shell does not expand the square
> brackets in this code:
>
> pattern='[*]'
> for filename in $pattern; do
> :
> done
>
> All of NetBSD-sh, shells/bash, shells/dash, shells/mksh, shells/pdksh,
> shells/oksh do that, though.
>
> Assuming that shells/pdksh is your "primary shell", what is the shell
> used by bmake? It would be strange if pdksh behaved differently between
> NetBSD and macOS.
I recently committed these:
https://github.com/NetBSD/pkgsrc/commit/94a7dba7283c
https://github.com/NetBSD/pkgsrc/commit/740ff71b71f5
which means it is now also shells/pdksh, but prior to those commits it
was /bin/sh (aka bash), and would be for most OS, which probably
explained why my first pdksh bulk build (performed before these were
committed) looked ok.
> > assertion failed in "unreadable file": file "/tmp/infra-unittests-47062/output" has unexpected content:
> > --- /tmp/infra-unittests-47062/expected
> > +++ /tmp/infra-unittests-47062/output
> > @@ -1,7 +1 @@
> > => Substituting "id" in unreadable-file
> > -sh: cannot open unreadable-file: permission denied
> > -sh: cannot open unreadable-file: permission denied
> > -*** Error code 1
> > -
> > -Stop.
> > -bmake: stopped in /tmp/infra-unittests-47062/work
>
> Ah, I didn't think that someone would run the tests as root. Obviously
> root doesn't care about the file mode.
Builds within pbulk are built by the pbulk user, but for general
development work and testing I just use root as its far simpler (and
obviously still fully sandboxed).
--
Jonathan Perkin - Joyent, Inc. - www.joyent.com
Home |
Main Index |
Thread Index |
Old Index