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

Re: Weird set -u error



On Fri, 26 Aug 2022, David wrote:

On Fri, 26 Aug 2022 at 22:14, <tomas@tuxteam.de> wrote:
On Fri, Aug 26, 2022 at 07:24:44AM -0400, Greg Wooledge wrote:
On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:

[...]

On Fri, Aug 26, 2022 at 11:04:25AM +0200, Thomas Schmitt wrote:
tomas@tuxteam.de wrote:

But all in all we're still "fixing" a package-provided script. Should
we file a bug against it? WDYT?

In my opinion, the only "bug" is the user putting -u in the SHELL
definition contained in the Makefile. I haven't yet seen them
answer Greg's enquiry=WHY?!


I disagree with Greg.

The real Makefile has -euo pipefail - and works perfectly, even from
cron. I tend to use this in all scripts. -u in particular is useful for
picking up typos and -e makes it fail fast and early.

It's only when I attempted to redirect output that I spotted this.

The failure doesn't even break anything, it just creates noise on
stderr.

I might log a bug to fix /etc/bash.bashrc but I'm suspecting there's a
bug in make - and changing .bashrc will just hide the symptoms.

Tim.



Reply to: