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

Re: [PATCH v1] libacpi: use temporary files for generated files


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 29 Oct 2020 10:57:15 +0000
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Olaf Hering <olaf@xxxxxxxxx>
  • Delivery-date: Thu, 29 Oct 2020 10:57:40 +0000
  • Ironport-sdr: Vf9RLH2f0eDGqmSQISgS67B2/3ErBoNa90E5UUQJn44P8+fnmMS7WtmVRWAQ06ZahosTUtEl45 KxiKEmto9P8zZFBxNCD8qnUgR4t+0OViP5Ztd5hvAETaapiVamC+vIcfZjedBF31oBd4kAtA7I ELyYoA11opINXzIqwAsTkgp+K4IEAsywk/VVBhm1oyBTo+ra6z5rQSBwA4NYRogjnI+78luQyY hjre/nT8hQv75KEOqbbVeuAsTeF6cjF3dg1UMKFhrsyoN6XdgQk4NW6wsL1yr0sgvOPCeVoi1w wHI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Oct 29, 2020 at 09:47:09AM +0100, Jan Beulich wrote:
> On 28.10.2020 19:13, Anthony PERARD wrote:
> > On Tue, Oct 27, 2020 at 12:06:56PM +0100, Jan Beulich wrote:
> >> On 27.10.2020 11:57, Andrew Cooper wrote:
> >>> On 27/10/2020 10:37, Jan Beulich wrote:
> >>>> On 27.10.2020 11:27, Olaf Hering wrote:
> >>>>> Am Tue, 27 Oct 2020 11:16:04 +0100
> >>>>> schrieb Jan Beulich <jbeulich@xxxxxxxx>:
> >>>>>
> >>>>>> This pattern is used when a rule consists of multiple commands
> >>>>>> having their output appended to one another's.
> >>>>> My understanding is: a rule is satisfied as soon as the file exists.
> >>>> No - once make has found that a rule's commands need running, it'll
> >>>> run the full set and only check again afterwards.
> >>>
> >>> It stops at the first command which fails.
> >>>
> >>> Olaf is correct, but the problem here is an incremental build issue, not
> >>> a parallel build issue.
> >>>
> >>> Intermediate files must not use the name of the target, or a failure and
> >>> re-build will use the (bogus) intermediate state rather than rebuilding 
> >>> it.
> >>
> >> But there's no intermediate file here - the file gets created in one
> >> go. Furthermore doesn't make delete the target file(s) when a rule
> >> fails? (One may not want to rely on this, and hence indeed keep multi-
> >> part rules update intermediate files of different names.)
> > 
> > What if something went badly enough and sed didn't managed to write the
> > whole file and make never had a chance to remove the bogus file?
> 
> How's this different from an object file getting only partly written
> and not deleted? We'd have to use the temporary file approach in
> literally every rule if we wanted to cater for this.

I though that things like `gcc' would write the final object to a
temporary place then rename it to the final destination, but that
doesn't seems to be the case.

I tried to see what happens if the `sed' command fails, and the target is
created, empty, and doesn't gets deleted by make. So an incremental
build uses a broken file without trying to rebuild it.

If we want `make' to delete target when a rule fails, I think we need to
add '.DELETE_ON_ERROR:' somewhere. Or avoid creating files before the
command is likely to succeed.

Cheers,

-- 
Anthony PERARD



 


Rackspace

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