mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Alexander Dahl <post@lespocky.de>, Roland Hieber <rhi@pengutronix.de>
Subject: Re: [ptxdist] [PATCH v2] ptxd_lib_dgen: warn if host or image packages have targetinstall stage
Date: Fri, 12 Apr 2019 09:10:14 +0200	[thread overview]
Message-ID: <20190412071014.ko4vsi2mmnf2axf6@pengutronix.de> (raw)
In-Reply-To: <20190408093950.11488-1-rhi@pengutronix.de>

On Mon, Apr 08, 2019 at 11:39:50AM +0200, Roland Hieber wrote:
> This point came up multiple times in the past and the special handling
> of targetinstall stages lead to confusion when trying to depend on image
> packages. Document it to prevent further confusion in that matter, and
> warn the user if such a make target exists.
> 
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
> On Fri, Apr 05, 2019 at 04:18:37PM +0200, Michael Olbrich wrote:
> > Hmmm, how would we detect this? I don't think make allows me to check
> > if a specific target is explicitly defined. And packages can use only
> > the default stages. 
> 
> I was first thinking about using 'make -q' to check if building an
> image-*.targetinstall stage errors out, but on the way I found out that
> the dgen script already parses all rules/*.make files, so we can hook in
> there:
> 
> ---
>  doc/ref_rule_file_layout.inc  | 12 ++++++++++++
>  scripts/lib/ptxd_lib_dgen.awk | 10 ++++++++++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/doc/ref_rule_file_layout.inc b/doc/ref_rule_file_layout.inc
> index ea7eb8c4903d..f58b07b44817 100644
> --- a/doc/ref_rule_file_layout.inc
> +++ b/doc/ref_rule_file_layout.inc
> @@ -23,6 +23,18 @@ Each rule file provides PTXdist with the required steps (in PTXdist called
>  
>     - targetinstall.post
>  
> +.. note::
> +
> +  Host and image packages don't need to install anything in the target file system.
> +  Therefore, PTXdist only respects the *targetinstall* and *targetinstall.post*
> +  stages for packages whose name doesn't start with ``host-`` or ``image-``.
> +
> +  When you want to depend on the output of a certain image package, you can
> +  usually use its image name as an `additional prerequisite <make-prereq-types_>`_
> +  in your make rule for the dependent stage.
> +
> +.. _make-prereq-types: https://www.gnu.org/software/make/manual/make.html#Prerequisite-Types
> +
>  Default stage rules
>  ~~~~~~~~~~~~~~~~~~~
>  
> diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
> index f7143c02885f..4d97cbd2fa28 100644
> --- a/scripts/lib/ptxd_lib_dgen.awk
> +++ b/scripts/lib/ptxd_lib_dgen.awk
> @@ -94,6 +94,16 @@ function dump_file(src, dst, tmp) {
>  }
>  
>  
> +#
> +# warn user if an image-* or host-* package contains a targetinstall rule
> +# which will not be executed
> +#
> +match($0, /\$\(STATEDIR\)\/((image-.*|host-.*)\.targetinstall(.post)?):/, m) {

Please use the same syntax as everywhere else in the file. It's complicated
enough.

> +	print "Warning: " m[1] " stage will be ignored. " \
> +		"See section 'Rule File Layout' in the PTXdist reference for more info."

No, this should be fatal. Add a '$(error ...)' and maybe some $(warning
...) for multiple lines. Also, reference the filename and line number to
make this easier to find.

Michael

> +}
> +
> +
>  #
>  # parse "PACKAGES-$(PTXCONF_PKG) += pkg" lines, i.e. rules-files from
>  # rules/*.make. Setup mapping between upper and lower case pkg names
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2019-04-12  7:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 16:42 [ptxdist] [PATCH 1/4] doc: ref_manual: split up into multiple files Roland Hieber
2019-04-04 16:42 ` [ptxdist] [PATCH 2/4] doc: ref_make_macros: install_tree knows a "strip" parameter too Roland Hieber
2019-04-04 16:42 ` [ptxdist] [PATCH 3/4] doc: ref_make_macros: merge parameter macros into a single section Roland Hieber
2019-04-04 16:42 ` [ptxdist] [PATCH 4/4] doc: ref_make_macros: document ptx/yesno, ptx/falsetrue, ptx/onoff Roland Hieber
2019-04-05 12:33 ` [ptxdist] [PATCH 5/4] doc: ref_rule_file_layout: document targetinstall inexistence for host- and image- packages Roland Hieber
2019-04-05 13:17   ` Alexander Dahl
2019-04-05 14:18     ` Michael Olbrich
2019-04-08  9:39       ` [ptxdist] [PATCH v2] ptxd_lib_dgen: warn if host or image packages have targetinstall stage Roland Hieber
2019-04-12  7:10         ` Michael Olbrich [this message]
2019-04-23 15:39           ` Roland Hieber
2019-05-07 10:38             ` Roland Hieber
2019-05-29 10:24             ` Michael Olbrich
2019-06-06 16:26           ` [ptxdist] [PATCH v3 1/3] ptxd_lib_dgen: add line counter Roland Hieber
2019-06-06 16:26             ` [ptxdist] [PATCH v3 2/3] ptxd_lib_dgen: error out for targetinstall stages in host/cross/image packages Roland Hieber
2019-06-06 19:21               ` Alexander Dahl
2019-06-06 16:26             ` [ptxdist] [PATCH v3 3/3] ptxd_lib_dgen: fix typos Roland Hieber

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=20190412071014.ko4vsi2mmnf2axf6@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=post@lespocky.de \
    --cc=ptxdist@pengutronix.de \
    --cc=rhi@pengutronix.de \
    /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