xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>, Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)
Date: Thu, 21 Jul 2016 11:57:42 +0100	[thread overview]
Message-ID: <63b378ca-1c9c-3b0e-74c3-3ddbce08f35d@citrix.com> (raw)
In-Reply-To: <22416.42814.573656.92547@mariner.uk.xensource.com>

On 21/07/16 11:43, Ian Jackson wrote:
> Andrew Cooper writes ("[PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)"):
>> The GNU coding standards expect $(DESTDIR) to be the root of everything
>> installed, and for prefix to then be added to the path.  This is not how XTF
>> previously behaved.
>>
>> Replace $(PREFIX) with its more common form $(prefix), and rearange $(DESTDIR)
>> and $(prefix) to match expectation.
> ...
>> -DESTDIR ?= $(ROOT)/dist
>> -PREFIX ?= $(ROOT)
>> -export DESTDIR PREFIX
>> +# $(prefix) defaults to $(ROOT) so development and testing can be done
>> +# straight out of the working tree
>> +prefix  ?= $(ROOT)
> ...
>> +DEST := $(DESTDIR)$(prefix)
> ...
>> -	@mkdir -p $(DESTDIR)
>> -	$(INSTALL_PROGRAM) -p xtf-runner $(DESTDIR)
>> +	@mkdir -p $(DEST)
>> +	$(INSTALL_PROGRAM) -p xtf-runner $(DEST)
> The effect of this is that
>    make prefix=/usr
> will create
>    /usr/xtf-runner
>    /usr/tests/*/test-info.json
> which is not how things would normally be expected work.

XTF doesn't match any standard installable package.  It is some
configuration files and a load of microkernels which are not system
executables.

I build it with prefix=/opt/xtf as that is the only plausible place for
the results to live, per the FHS.  It could certainly be argued that it
should insert its own xtf/ directory rather than relying on prefix to
pass it.

>
> I think to make this work right, you have to do something like
>
>   ifeq ($prefix,)
>    bindir=$(ROOT)
>    xtflibdir=$(ROOT)
>   else
>    bindir=$(prefix)/bin
>    xtflibdir=$(prefix)/lib/xtf
>   endif
>   xtftestsdir=$(xtflibdir)/tests
>   ...
>         $(INSTALL_PROGRAM) -p xtf-runner $(DESTDIR)/$(bindir)
>   ...
>         $(INSTALL_DATA) -p test-info.json $(DESTDIR)/$(xtftestsdir)/$(NAME)

xtf-runner expects to find tests/ in the same directory it resides in,
because otherwise there is no sensible way to find it.

>
> Also it would be more conventional to use $(INSTALL) -d or
> $(INSTALL_DIR) rather than mkdir.

I will make this change.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-07-21 10:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 11:55 [PATCH XTF] build: introduce a dist target Wei Liu
2016-07-20 12:52 ` Andrew Cooper
2016-07-20 13:10   ` Wei Liu
2016-07-20 13:15     ` Andrew Cooper
2016-07-20 18:21 ` [PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix) Andrew Cooper
2016-07-20 18:28   ` Doug Goldstein
2016-07-20 18:31   ` Wei Liu
2016-07-21 10:43   ` Ian Jackson
2016-07-21 10:57     ` Andrew Cooper [this message]
2016-07-21 11:10       ` Ian Jackson
2016-07-25 16:23 ` [XTF PATCH v3] Correct the usage of $(DESTDIR) and $(PREFIX) Andrew Cooper
2016-07-26  9:09   ` Wei Liu
2016-07-26 10:14   ` Ian Jackson
2016-07-26 10:17     ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63b378ca-1c9c-3b0e-74c3-3ddbce08f35d@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).