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

Re: [PATCH for-4.21] tools/tests: don't pass -E to sed


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 8 Oct 2025 17:07:29 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YtOeElyIR5YUcsuNXZICGlpmkQ6AjNzAVIH2oXN3xzo=; b=j8r8h0ryIwST5k3JFpBxFh10N0tQs/N0XynwU8W+m1jzgcCEXkt8ZsmaTsZC0KYxMjeZX9BBk4l+uVw5pzi/c83r9J+lWcNJ/BJl8/y/CNIc6nn+4GEiWuV3pVathaeq7CTY5LOfKG+ZECCyl4Vncu6Yy0WzYEH4Ap7u7MD0GwKIxw3JQje6kWcS/RZH5oJOKioX+zHr/gBhY+N7fxlGD4CedNJovrk/SxOT8pUzPIWtT8Gi+4Mbq4Sd0bpgrHvNi3gKZN605psy0alX1dYIq9WwRqVRZFdiMaZknwye/u/a2FH64K81/tzA+mopmPzaZ4FXHDbSV9UCEVAoswX86A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JRe7zWSCEMwR0Off78Ih5pXEITYaWKYkhBOgmo03VQiVefzzIJxYHKyFmX1cYuuI99iVPqNQnzU3Fb3/ooTyoHWT6Ojvh2uASgJ8/5BQ8R74jbEfVcCS0Y67miZW1QB0tM9Vm7teohq+7bQdkYZMoeyViXw2b70uwWXivxE4fs3RKC3cn2Sgr9MwwKwOPCTDD1kaw2aBDtkNsxxjZK386Wisrf0OSMjyhWtGroKFT1YVYNtFJ7OuYZp43f1qHlXoIzQEREKAwwfVAFDUB3PlgXCOL83/jKxkK6QLqUVVadmRw7MAOySXZ5Du1nQ13tVZUx4Lej/6+Uv2D63xsuXVIw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Wed, 08 Oct 2025 15:07:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Oct 08, 2025 at 04:42:13PM +0200, Jan Beulich wrote:
> On 08.10.2025 16:30, Roger Pau Monné wrote:
> > On Wed, Oct 08, 2025 at 11:47:05AM +0200, Jan Beulich wrote:
> >> Even the 2018 edition of The Open Group Base Specifications Issue 7 [1]
> >> doesn't name -E as a standard option; only Issue 8 [2] does. As there's
> >> nothing "extended" about the expression used, simply drop the -E.
> >>
> >> [1] https://pubs.opengroup.org/onlinepubs/9699919799/
> >> [2] https://pubs.opengroup.org/onlinepubs/9799919799/
> >>
> >> Fixes: cb50e4033717 ("test/pdx: add PDX compression unit tests")
> >> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> > 
> > Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Thanks.
> 
> >> ---
> >> In principle the -e could be dropped too, for being redundant.
> >>
> >> Hitting the problem with an older sed pointed out another problem here as
> >> well: The failed invocation left a 0-byte pdx.h, which upon re-invocation
> >> of make was (obviously) deemed up-to-date, thus causing the build to fail
> >> again (until the bad file was actually removed).
> > 
> > Hm, we could do something like:
> > 
> > sed -e '/^#[[:space:]]*include/d' <$< >$@ || $(RM) $@
> 
> As is that would hide failure of the sed invocation from make. I was first
> thinking to sed into a temporary file, to then rename that file. But this
> won't cover the more general case of the issue either.

Well, it would work if the sed into temporary file is a FORCE target,
and then the move to the final file is only done if there are
differences?

> Meanwhile I think
> that the Makefile itself should become a dependency of the of the target
> header. That way, if the sed expression changes, the file will be rebuilt.
> (Of course this still builds on an assumption, specifically that any
> failure here would be dealt with by an adjustment to the rule. So possibly
> we need a combination of both.)

It feels weird to me that a Makefile depends on itself, but yes, it
might solve the issue you pointed out in a simpler way.  Doesn't
makefile consider all make generated targets as obsolete if the
makefile itself changes?  The pdx.h generation is a clear example
here, but the same could apply to runes used to build object files?

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.