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

Re: [PATCH] build: adjust include/xen/compile.h generation


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 13 Jan 2022 13:11:41 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ZZhMMYY4C3WTxFsQcYaYyArCJiH3SojVIbs2CCEX/yI=; b=N59hfsswkxIj6EbdAcItC0WSKPqh7avE8l4avUo0kv2wLg5oQjWPwttk+QHbSu2U5hFCC2QgkxKjPmSsFGzCToLomfyzaRdEU969E18OHs+CnQdwy0rOxiXDZCpX5FLg43x3cE6TUBjjPsiPO20eCySw06oIfgjtLamhmHpsabcEMjx46dVWYu72UntVqKqKC0cmyv5yKakKKqmC3ElJAczvek2IJksMlQFSamYD1bzcVi+w2Uznd3R/5cJmP9oikEXVkE7K3Tx3ceBPMuaD6c3HfqRnUD5cndLi3QX56XWgv4LOtaGUblZlytY2L3jYAN/do+MA/qIZk3LkUwte4g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ayv2J+CM7vvwkjlh/zocNhhuOTxmdyYi+QYYyRyT0kPdd539ju3hk3i9CWNhNqcZvVRyrAqcQ5NQrlHArnVYtlQkyksmIkA9JVUb9S8aiy4ySvKC2U1mfGACTBezUoMkoyR9cvumJdjK5cbYMvpagZ0nt7E3wZFXsuuk6j92qEjfLQIkxVdgbLyVhvIoehwqHlfGl+TMFpiyJeXzwecf9Uyq5zIbN70edtXbq4TqKFpyXqU4LFwO2Pp8LPjTll66A6PmUV/A+0ZqeH3++gEYwWs0MqZZajedA8HRMir55cjs2Z6DCLbr23BI0wH7IFqav9vsuvkiisAy/xYMYF+IrQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 13 Jan 2022 12:12:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.01.2022 12:22, Anthony PERARD wrote:
> On Tue, Jan 11, 2022 at 03:16:17PM +0100, Jan Beulich wrote:
>> Prior to 19427e439e01 ("build: generate "include/xen/compile.h" with
>> if_changed") running "make install-xen" as root would not have printed
>> the banner under normal circumstances. Its printing would instead have
>> indicated that something was wrong (or during a normal build the lack
>> of printing would do so).
> 
> So, having several line of logs with one generating "compile.h", and
> several object rebuild plus the re-linking of xen isn't enough has to
> indicate that something is wrong?

Well, for warnings and errors to be easy to spot (and until your rework
to make our build more Linux-like is in place) passing -s to make is a
must, imo.

> Also, with this patch, the banner would no longer be printed on rebuild,
> unless one doesn't try to prevent regeneration of "compile.h" by
> exporting two variables.
> 
> I kind of like having the banner been nearly always printed, but I'm not
> opposed to the change.

I'd be happy to use a solution where the banner is always printed for
"normal" builds, but not when compile.h re-generation is skipped
during "install-xen" as root. Assuming of course that was the behavior
prior to your changes - I never tried suppressing compile.h updating
via setting XEN_BUILD_{DATE,TIME}. My goal merely is that it not be
printed during "install-xen" as root, as that's how things had been
for many years.

>> Further aforementioned change had another undesirable effect, which I
>> didn't notice during review: Originally compile.h would have been
>> re-generated (and final binaries re-linked) when its dependencies were
>> updated after an earlier build. This is no longer the case now, which
>> means that if some other file also was updated, then the re-build done
>> during "make install-xen" would happen with a stale compile.h (as its
>> updating is suppressed in this case).
> 
> So, the comment:
>     Don't refresh this files during e.g., 'sudo make install'
> wasn't correct?

In a way, yes. The file would have got refreshed for two reasons: By
deleting it (i.e. unconditionally) during a normal build, but via
dependencies only during "install-xen" as root.

> On the other hand, it's probably not good to not regen the file when the
> prerequisite changes. It's kind of weird to "rm" the target, but I don't
> have a better solution at the moment.

I agree it's weird, but I've outlined the only alternative to this
that I see, ...

>> Restore the earlier behavior for both aspects.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> ---
>> An alternative to removing the target would be to replace "! -r $@" by
>> "-n '$?'" in the shell "if", but that would cause unhelpful alteration
>> of what gets recorded in include/xen/.compile.h.cmd. (The command
>> normally changes every time anyway, due to the inclusion of
>> $(XEN_BUILD_TIME), but I consider that different from varying the
>> conditions of the "if".)

... here.

>> --- a/xen/Makefile
>> +++ b/xen/Makefile
>> @@ -424,6 +424,7 @@ targets += .banner
>>  quiet_cmd_compile.h = UPD     $@
>>  define cmd_compile.h
>>      if [ ! -r $@ -o -O $@ ]; then \
>> +    cat .banner; \
>>      sed -e 's/@@date@@/$(XEN_BUILD_DATE)/g' \
>>          -e 's/@@time@@/$(XEN_BUILD_TIME)/g' \
>>          -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
>> @@ -441,7 +442,7 @@ define cmd_compile.h
>>  endef
>>  
>>  include/xen/compile.h: include/xen/compile.h.in .banner FORCE
>> -    @cat .banner
>> +    $(if $(filter-out FORCE,$?),rm -fv $@)
> 
> Is there a reason for -v? Do we care if the file existed?

That's meant to be an indication of the file getting updated during
"install-xen" as root. I thought it might be nice to have this extra
indicator, but I wouldn't mind dropping it if that helps acceptance
of the change. Can you let me know how important this aspect is to
you?

> Do we want to log "rm -f compile.h" ? Or could you just prefix the line
> with $(Q)?

I'll add $(Q). As said, I always build with "make -s" (except when
debugging weird build issues), so this is nothing I would have noticed.

Jan




 


Rackspace

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