[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: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 8 Oct 2025 17:36:30 +0200
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Wed, 08 Oct 2025 15:36:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.10.2025 17:07, Roger Pau Monné wrote:
> 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?

Yes, splitting like this ought to do.

>> 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?

I don't think so, no. What it feels a little as if you may be thinking of
is that if a Makefile itself is a target, make will re-invoke itself once
it was updated.

>  The pdx.h generation is a clear example
> here, but the same could apply to runes used to build object files?

Well, yes. That's why we have the .*.cmd files in the hypervisor build
system. That's less coarse than using the full Makefile-s as dependencies.

Jan



 


Rackspace

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