Re: [PATCH wayland v1 1/1] wayland-scanner.pc.in: prepend pc_sysrootdir

2016-09-19 Thread Emil Velikov
On 15 September 2016 at 23:22, Joe Konno  wrote:
> From: Joe Konno 
>
> In a cross-compilation environment with packages depending on
> wayland-scanner, ensure the path to wayland-scanner is correct. Without
> this patch, the path will _not_ point to the target environment but to
> the host's, potentially leading to breakage.
>
Afaict the [cs]ore part here is that one is using a git checkout(s)
with cross-compilation.

If we ignore that for a moment, here are some possible combinations:
 - cross-compile both provider (wayland-scanner) and it's user(s)
 - cross-compile only one of them and build the other(s) natively

Then we add the following on top a) host == target may _not_ be always
true and b) doing cross-compiling different components on different
systems/platforms _is_ an option. So in order to proceed one has to
have wayland-scanner (in this case of course) built for each possible
combination/platform above. Which in itself is is close to a
combinatoric explosion.

Coming back:
I must admit - there is no simple way (that I know of) to annotate
dependencies which should be built/installed on the build platform in
order to have a successful "make dist". Yet ultimately this is what
you want - work from a release (be the official or local) tarball.

I'm not familiar with bitbake and alike, but some/many Linux
distributions have a "prepare" step which unlike the
build/check/install one is not distributed across systems (via DistCC
and similar solutions).

Ideally one should do and/or bitbake isn't too far off the following:
 - git checkout as-needed
 - wget tarballs
 - for i in as-needed; do apply local patches, run `make dist` (might
need to have some dependencies build/installed); done
 - for everyone; do tar -xaf foo && cd foo &&  ./configure &&
make/make install; done

Regards,
Emil
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland v1 1/1] wayland-scanner.pc.in: prepend pc_sysrootdir

2016-09-16 Thread Joe Konno
On Fri, 16 Sep 2016 17:30:18 +0200
Arnaud Vrac  wrote:

> On Fri, Sep 16, 2016 at 5:19 PM, Joe Konno 
> wrote:
> 
> > On Fri, 16 Sep 2016 10:53:32 +0300
> > Pekka Paalanen  wrote:
> >  
> > > On Thu, 15 Sep 2016 15:22:12 -0700
> > > Joe Konno  wrote:
> > >  
> > > > From: Joe Konno 
> > > >
> > > > In a cross-compilation environment with packages depending on
> > > > wayland-scanner, ensure the path to wayland-scanner is correct. Without
> > > > this patch, the path will _not_ point to the target environment but to
> > > > the host's, potentially leading to breakage.
> > > >
> > > > https://bugs.freedesktop.org/show_bug.cgi?id=97828
> > > >
> > > > Signed-off-by: Joe Konno 
> > > > ---
> > > >  src/wayland-scanner.pc.in | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/src/wayland-scanner.pc.in b/src/wayland-scanner.pc.in
> > > > index 7b2a4c92e0e3..ec11a0bc982c 100644
> > > > --- a/src/wayland-scanner.pc.in
> > > > +++ b/src/wayland-scanner.pc.in
> > > > @@ -2,7 +2,7 @@ prefix=@prefix@
> > > >  exec_prefix=@exec_prefix@
> > > >  datarootdir=@datarootdir@
> > > >  pkgdatadir=@datadir@/@PACKAGE@
> > > > -wayland_scanner=@bindir@/wayland-scanner
> > > > +wayland_scanner=${pc_sysrootdir}/@bindir@/wayland-scanner
> > > >
> > > >  Name: Wayland Scanner
> > > >  Description: Wayland scanner  
> > >
> > > Hi,
> > >
> > > ok, so pc_sysrootdir points to the sysroot. I would just like to
> > > confirm that this really does what you intend. wayland-scanner is a
> > > build tool to be run on the host. Such tools get installed into the
> > > sysroot even when compiled for the host, not the target, yes?
> > >
> > > I read both http://dev.gentoo.org/~mgorny/pkg-config-spec.html and
> > > https://autotools.io/pkgconfig/cross-compiling.html but couldn't
> > > actually understand what is going on, perhaps because I never
> > > cross-compile.
> > >
> > > Hence I cannot offer a Reviewed-by, but I can offer:
> > > Acked-by: Pekka Paalanen 
> > >
> > > (Not for the 1.12.0 release.)
> > >
> > > Are you using binary-compatible arches for both host and target? I'd
> > > like to see a test on a setup where the binaries are completely
> > > incompatible so that the host != target difference is obvious.  
> >
> > I'm struggling with this particular cross-compilation scenario as well, as
> > there's a fair bit of wonky overhead involved in the build process I'm
> > dealing
> > with. Figured I'd introduce the patch and solicit feedback early while I
> > continue digging.
> >
> > Your points are fair and the feedback's appreciated. I'll see about testing
> > this out a bit more with an incompatible binary target-- right now my host
> > is
> > Intel-based and my target is also Intel-based.
> >
> > I'll reply back once I feel convinced one way or the other. ^_^
> >  
> 
> Hi Joe,
> 
> I believe your patch is not right, as pq says the sysroot normally contains
> the code compiled for the target, which might not be compatible with the
> host.
> 
> I think the proper way to do this is to compile wayland for the host
> separately, and use ${CHOST}-pkg-config instead of pkg-config to get the
> wayland-scanner path. In practice you would call
> x86_64-linux-gnu-pkg-config --variable=wayland_scanner. The
> x86_64-linux-gnu-pkg-config utility will look for pkgconfig files in the
> host sysroot, instead of the target sysroot, allowing this use case to work.
> 
> Unfortunately not many packages do this correctly...
> 
> Regards,
> Arnaud

Thanks a mil, Arnaud. I appreciate your feedback. Some of my observations are
making more sense now, and I'm increasingly convinced this patch I submitted
isn't the solution Wayland's looking for (or needs).

Apologies for cluttering the list, Pekka and folks. I don't think this patch
as-is should be considered for inclusion.

Cheers, and thanks again!


pgpL8y4sOKtLK.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland v1 1/1] wayland-scanner.pc.in: prepend pc_sysrootdir

2016-09-16 Thread Arnaud Vrac
On Fri, Sep 16, 2016 at 5:19 PM, Joe Konno 
wrote:

> On Fri, 16 Sep 2016 10:53:32 +0300
> Pekka Paalanen  wrote:
>
> > On Thu, 15 Sep 2016 15:22:12 -0700
> > Joe Konno  wrote:
> >
> > > From: Joe Konno 
> > >
> > > In a cross-compilation environment with packages depending on
> > > wayland-scanner, ensure the path to wayland-scanner is correct. Without
> > > this patch, the path will _not_ point to the target environment but to
> > > the host's, potentially leading to breakage.
> > >
> > > https://bugs.freedesktop.org/show_bug.cgi?id=97828
> > >
> > > Signed-off-by: Joe Konno 
> > > ---
> > >  src/wayland-scanner.pc.in | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/src/wayland-scanner.pc.in b/src/wayland-scanner.pc.in
> > > index 7b2a4c92e0e3..ec11a0bc982c 100644
> > > --- a/src/wayland-scanner.pc.in
> > > +++ b/src/wayland-scanner.pc.in
> > > @@ -2,7 +2,7 @@ prefix=@prefix@
> > >  exec_prefix=@exec_prefix@
> > >  datarootdir=@datarootdir@
> > >  pkgdatadir=@datadir@/@PACKAGE@
> > > -wayland_scanner=@bindir@/wayland-scanner
> > > +wayland_scanner=${pc_sysrootdir}/@bindir@/wayland-scanner
> > >
> > >  Name: Wayland Scanner
> > >  Description: Wayland scanner
> >
> > Hi,
> >
> > ok, so pc_sysrootdir points to the sysroot. I would just like to
> > confirm that this really does what you intend. wayland-scanner is a
> > build tool to be run on the host. Such tools get installed into the
> > sysroot even when compiled for the host, not the target, yes?
> >
> > I read both http://dev.gentoo.org/~mgorny/pkg-config-spec.html and
> > https://autotools.io/pkgconfig/cross-compiling.html but couldn't
> > actually understand what is going on, perhaps because I never
> > cross-compile.
> >
> > Hence I cannot offer a Reviewed-by, but I can offer:
> > Acked-by: Pekka Paalanen 
> >
> > (Not for the 1.12.0 release.)
> >
> > Are you using binary-compatible arches for both host and target? I'd
> > like to see a test on a setup where the binaries are completely
> > incompatible so that the host != target difference is obvious.
>
> I'm struggling with this particular cross-compilation scenario as well, as
> there's a fair bit of wonky overhead involved in the build process I'm
> dealing
> with. Figured I'd introduce the patch and solicit feedback early while I
> continue digging.
>
> Your points are fair and the feedback's appreciated. I'll see about testing
> this out a bit more with an incompatible binary target-- right now my host
> is
> Intel-based and my target is also Intel-based.
>
> I'll reply back once I feel convinced one way or the other. ^_^
>

Hi Joe,

I believe your patch is not right, as pq says the sysroot normally contains
the code compiled for the target, which might not be compatible with the
host.

I think the proper way to do this is to compile wayland for the host
separately, and use ${CHOST}-pkg-config instead of pkg-config to get the
wayland-scanner path. In practice you would call
x86_64-linux-gnu-pkg-config --variable=wayland_scanner. The
x86_64-linux-gnu-pkg-config utility will look for pkgconfig files in the
host sysroot, instead of the target sysroot, allowing this use case to work.

Unfortunately not many packages do this correctly...

Regards,
Arnaud
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland v1 1/1] wayland-scanner.pc.in: prepend pc_sysrootdir

2016-09-16 Thread Joe Konno
On Fri, 16 Sep 2016 10:53:32 +0300
Pekka Paalanen  wrote:

> On Thu, 15 Sep 2016 15:22:12 -0700
> Joe Konno  wrote:
> 
> > From: Joe Konno 
> > 
> > In a cross-compilation environment with packages depending on
> > wayland-scanner, ensure the path to wayland-scanner is correct. Without
> > this patch, the path will _not_ point to the target environment but to
> > the host's, potentially leading to breakage.
> > 
> > https://bugs.freedesktop.org/show_bug.cgi?id=97828
> > 
> > Signed-off-by: Joe Konno 
> > ---
> >  src/wayland-scanner.pc.in | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/wayland-scanner.pc.in b/src/wayland-scanner.pc.in
> > index 7b2a4c92e0e3..ec11a0bc982c 100644
> > --- a/src/wayland-scanner.pc.in
> > +++ b/src/wayland-scanner.pc.in
> > @@ -2,7 +2,7 @@ prefix=@prefix@
> >  exec_prefix=@exec_prefix@
> >  datarootdir=@datarootdir@
> >  pkgdatadir=@datadir@/@PACKAGE@
> > -wayland_scanner=@bindir@/wayland-scanner
> > +wayland_scanner=${pc_sysrootdir}/@bindir@/wayland-scanner
> >  
> >  Name: Wayland Scanner
> >  Description: Wayland scanner  
> 
> Hi,
> 
> ok, so pc_sysrootdir points to the sysroot. I would just like to
> confirm that this really does what you intend. wayland-scanner is a
> build tool to be run on the host. Such tools get installed into the
> sysroot even when compiled for the host, not the target, yes?
> 
> I read both http://dev.gentoo.org/~mgorny/pkg-config-spec.html and
> https://autotools.io/pkgconfig/cross-compiling.html but couldn't
> actually understand what is going on, perhaps because I never
> cross-compile.
> 
> Hence I cannot offer a Reviewed-by, but I can offer:
> Acked-by: Pekka Paalanen 
> 
> (Not for the 1.12.0 release.)
> 
> Are you using binary-compatible arches for both host and target? I'd
> like to see a test on a setup where the binaries are completely
> incompatible so that the host != target difference is obvious.

I'm struggling with this particular cross-compilation scenario as well, as
there's a fair bit of wonky overhead involved in the build process I'm dealing
with. Figured I'd introduce the patch and solicit feedback early while I
continue digging.

Your points are fair and the feedback's appreciated. I'll see about testing
this out a bit more with an incompatible binary target-- right now my host is
Intel-based and my target is also Intel-based.

I'll reply back once I feel convinced one way or the other. ^_^

> 
> 
> Thanks,
> pq



pgpDx4QhAEys3.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland v1 1/1] wayland-scanner.pc.in: prepend pc_sysrootdir

2016-09-16 Thread Pekka Paalanen
On Thu, 15 Sep 2016 15:22:12 -0700
Joe Konno  wrote:

> From: Joe Konno 
> 
> In a cross-compilation environment with packages depending on
> wayland-scanner, ensure the path to wayland-scanner is correct. Without
> this patch, the path will _not_ point to the target environment but to
> the host's, potentially leading to breakage.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=97828
> 
> Signed-off-by: Joe Konno 
> ---
>  src/wayland-scanner.pc.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/wayland-scanner.pc.in b/src/wayland-scanner.pc.in
> index 7b2a4c92e0e3..ec11a0bc982c 100644
> --- a/src/wayland-scanner.pc.in
> +++ b/src/wayland-scanner.pc.in
> @@ -2,7 +2,7 @@ prefix=@prefix@
>  exec_prefix=@exec_prefix@
>  datarootdir=@datarootdir@
>  pkgdatadir=@datadir@/@PACKAGE@
> -wayland_scanner=@bindir@/wayland-scanner
> +wayland_scanner=${pc_sysrootdir}/@bindir@/wayland-scanner
>  
>  Name: Wayland Scanner
>  Description: Wayland scanner

Hi,

ok, so pc_sysrootdir points to the sysroot. I would just like to
confirm that this really does what you intend. wayland-scanner is a
build tool to be run on the host. Such tools get installed into the
sysroot even when compiled for the host, not the target, yes?

I read both http://dev.gentoo.org/~mgorny/pkg-config-spec.html and
https://autotools.io/pkgconfig/cross-compiling.html but couldn't
actually understand what is going on, perhaps because I never
cross-compile.

Hence I cannot offer a Reviewed-by, but I can offer:
Acked-by: Pekka Paalanen 

(Not for the 1.12.0 release.)

Are you using binary-compatible arches for both host and target? I'd
like to see a test on a setup where the binaries are completely
incompatible so that the host != target difference is obvious.


Thanks,
pq


pgpYTOIVqKmkF.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH wayland v1 1/1] wayland-scanner.pc.in: prepend pc_sysrootdir

2016-09-15 Thread Joe Konno
From: Joe Konno 

In a cross-compilation environment with packages depending on
wayland-scanner, ensure the path to wayland-scanner is correct. Without
this patch, the path will _not_ point to the target environment but to
the host's, potentially leading to breakage.

https://bugs.freedesktop.org/show_bug.cgi?id=97828

Signed-off-by: Joe Konno 
---
 src/wayland-scanner.pc.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/wayland-scanner.pc.in b/src/wayland-scanner.pc.in
index 7b2a4c92e0e3..ec11a0bc982c 100644
--- a/src/wayland-scanner.pc.in
+++ b/src/wayland-scanner.pc.in
@@ -2,7 +2,7 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 datarootdir=@datarootdir@
 pkgdatadir=@datadir@/@PACKAGE@
-wayland_scanner=@bindir@/wayland-scanner
+wayland_scanner=${pc_sysrootdir}/@bindir@/wayland-scanner
 
 Name: Wayland Scanner
 Description: Wayland scanner
-- 
1.8.3.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel