On Thu, Oct 11, 2018 at 04:28:43PM +0200, Roland Hieber wrote:
> On Wed, Oct 10, 2018 at 03:22:13PM +0200, Alexander Dahl wrote:
> > On Wed, Oct 10, 2018 at 02:21:48PM +0200, Roland Hieber wrote:
> > > On Wed, Oct 10, 2018 at 01:04:01PM +0200, Roland Hieber wrote:
> > [...] I set PTXCONF_SETUP_SRCDIR to
> > /mnt/trash/src first, and to the default ${PTXDIST_WORKSPACE}/src
> > then. The problem is reproducible for packages where you build the
> > host, but not the target package, e.g. FOO=n and HOST_FOO=y. For
> > DistroKit master that is the case for acl, coreutils and maybe more.
>
> Indeed, I can also reproduce this with ${PTXDIST_WORKSPACE}/src. I guess
> HOST_* packages are missing the mapping from the HOST_*_SOURCE to the
> *_SOURCE variables, but I cannot see right now where and when this
> broke. I'll try a bisect later today.
I did a git bisect run with a script that deletes $SRCDIR/coreutils*
followed by ptxdist get host-coreutils. It results in commit 400bee10 [a]
as the first commit which no longer downloads coreutils*tar.gz and only
prints "error: empty parameter to 'ptxd_make_get'". That commit
unfortunately landed in ptxdist-2018.10.0.
I'm not so versed in the inner workings of ptxd_lib_dgen.awk - mol, do
you have an idea what needs to be done here? It looks to me that if we
don't want to reintroduce the $(<PKG>_SOURCE) := <PKG> variables, we need to
teach the '$(SRCDIR)/%' target [b] how to infer the HOST_<PKG> prefix
from the source archive name, even if <pkg> is not selected. But I have
no idea how to do that.
- Roland
[b]: see
https://git.pengutronix.de/cgit/ptxdist/tree/rules/post/ptxd_make_world_get.make#n16
[a]: this patch:
commit 400bee10bdb3f6ab29304365a19ce05929f09436
Author: Michael Olbrich <[email protected]>
Date: 2018-09-28 19:02
ptxd_lib_dgen: make sure $(<PKG>_SOURCE) refers to the primary package
To get the package for a source archive we define for each package:
$(<PKG>_SOURCE) := <PKG>
With host and cross packages that share the source with the target package,
the same variable may be defined multiple times. Which one 'wins' is
undefined.
Avoid this by only defining the variable for the target package.
Signed-off-by: Michael Olbrich <[email protected]>
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index 888d989ee..5437d497c 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -338,7 +338,13 @@ function write_deps_pkg_active(this_PKG, this_pkg, prefix)
{
#
# default deps
#
+ if (prefix != "") {
+ target_PKG = gensub(/^HOST_|^CROSS_/, "", 1, this_PKG);
+ print "ifneq ($(" this_PKG "_SOURCE),$(" target_PKG "_SOURCE))"
> DGEN_DEPS_POST;
+ }
print "$(if $(" this_PKG "_SOURCE),$(eval $(" this_PKG "_SOURCE) := "
this_PKG "))" > DGEN_DEPS_POST;
+ if (prefix != "")
+ print "endif"
> DGEN_DEPS_POST;
print "$(foreach src,$(" this_PKG "_SOURCES)," \
"$(eval $(STATEDIR)/" this_pkg ".get:" "$(STATEDIR)/"
this_pkg ".$(notdir $(src)).stamp))" > DGEN_DEPS_POST;
print "$(STATEDIR)/" this_pkg ".extract: "
"$(STATEDIR)/" this_pkg ".get" > DGEN_DEPS_POST;
--
Roland Hieber | [email protected] |
Pengutronix e.K. | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
ptxdist mailing list
[email protected]