Bug#881341: webkit2gtk FTCBFS: debian/rules confuses build and host

2017-11-10 Thread Helmut Grohne
On Fri, Nov 10, 2017 at 08:25:59PM +0100, Alberto Garcia wrote:
> Both those flags (--no-keep-memory and --no-relax) plus the -g1 that
> you're changing in your patch were added because the build was failing
> (not enough memory, at least in the 1st and the 3rd case).

Thanks for your attention to detail. Yes, at least --no-keep-memory
should keep being conditional of the build architecture. That part of my
patch is wrong then.

> If the build machine is able to compile webkit without those flags
> then there's no need to add them, so if I'm understanding it right it
> doesn't depend on the target architecture but on the machine where
> you're doing the build.

For --no-relax, the question is harder as it influences the object file
generated. Given your reasoning though, maybe checking build is still
better.

> For the -g1 case we probably want to do it depending on the target
> architecture anyway, but for the --no-keep-memory case I don't see
> why.

I stand corrected.

> And now that we're at it, I'm not sure if --no-relax is even necessary
> anymore. This was added for alpha in 2008 to work around a binutils
> bug, which I guess has been already fixed ? It would be nice to test
> that, but I don't have access to an alpha machine.

You could try cross building from amd64. ;)

Helmut



Bug#881341: webkit2gtk FTCBFS: debian/rules confuses build and host

2017-11-10 Thread Alberto Garcia
On Fri, Nov 10, 2017 at 07:07:00PM +0100, Helmut Grohne wrote:

> > > ifeq ($(DEB_HOST_ARCH_BITS),32)
> > >   LDFLAGS += -Wl,--no-keep-memory
> > >  endif
> > >  
> > > -ifeq ($(DEB_BUILD_ARCH),alpha)
> > > +ifeq ($(DEB_HOST_ARCH),alpha)
> > >   LDFLAGS += -Wl,--no-relax
> > >  endif
> > 
> > Wait a minute, why do you change this to DEB_HOST_ARCH here? Shouldn't
> > we be using the DEB_BUILD_* variables in these two cases?
> 
> I think you are confusing build and host again.
> 
> If you check DEB_BUILD_ARCH, then you will pass -Wl,--no-relax when
> building for amd64 on alpha. Since --no-relax is machine-dependent,
> that seems wrong to me. In general, changing the build architecture
> should not affect the resulting binary packages. Passing different
> flags for different build architectures often breaks that.

Both those flags (--no-keep-memory and --no-relax) plus the -g1 that
you're changing in your patch were added because the build was failing
(not enough memory, at least in the 1st and the 3rd case).

If the build machine is able to compile webkit without those flags
then there's no need to add them, so if I'm understanding it right it
doesn't depend on the target architecture but on the machine where
you're doing the build.

For the -g1 case we probably want to do it depending on the target
architecture anyway, but for the --no-keep-memory case I don't see
why.

And now that we're at it, I'm not sure if --no-relax is even necessary
anymore. This was added for alpha in 2008 to work around a binutils
bug, which I guess has been already fixed ? It would be nice to test
that, but I don't have access to an alpha machine.

Berto



Bug#881341: webkit2gtk FTCBFS: debian/rules confuses build and host

2017-11-10 Thread Helmut Grohne
On Fri, Nov 10, 2017 at 05:08:53PM +0200, Alberto Garcia wrote:
> On Fri, Nov 10, 2017 at 03:49:58PM +0100, Helmut Grohne wrote:
> > ifeq ($(DEB_HOST_ARCH_BITS),32)
> > LDFLAGS += -Wl,--no-keep-memory
> >  endif
> >  
> > -ifeq ($(DEB_BUILD_ARCH),alpha)
> > +ifeq ($(DEB_HOST_ARCH),alpha)
> > LDFLAGS += -Wl,--no-relax
> >  endif
> 
> Wait a minute, why do you change this to DEB_HOST_ARCH here? Shouldn't
> we be using the DEB_BUILD_* variables in these two cases?

I think you are confusing build and host again.

If you check DEB_BUILD_ARCH, then you will pass -Wl,--no-relax when
building for amd64 on alpha. Since --no-relax is machine-dependent, that
seems wrong to me. In general, changing the build architecture should
not affect the resulting binary packages. Passing different flags for
different build architectures often breaks that.

Helmut



Bug#881341: webkit2gtk FTCBFS: debian/rules confuses build and host

2017-11-10 Thread Alberto Garcia
On Fri, Nov 10, 2017 at 03:49:58PM +0100, Helmut Grohne wrote:
> ifeq ($(DEB_HOST_ARCH_BITS),32)
>   LDFLAGS += -Wl,--no-keep-memory
>  endif
>  
> -ifeq ($(DEB_BUILD_ARCH),alpha)
> +ifeq ($(DEB_HOST_ARCH),alpha)
>   LDFLAGS += -Wl,--no-relax
>  endif

Wait a minute, why do you change this to DEB_HOST_ARCH here? Shouldn't
we be using the DEB_BUILD_* variables in these two cases?

Berto



Bug#881341: webkit2gtk FTCBFS: debian/rules confuses build and host

2017-11-10 Thread Alberto Garcia
Control: tags -1 pending

On Fri, Nov 10, 2017 at 03:49:58PM +0100, Helmut Grohne wrote:

> webkit2gtk fails to cross build from source for a significant number
> of reasons. One of those reasons is that debian/rules confuses build
> and host.

Thanks, I was preparing a new release and I'll include this patch.

Berto



Bug#881341: webkit2gtk FTCBFS: debian/rules confuses build and host

2017-11-10 Thread Helmut Grohne
Source: webkit2gtk
Version: 2.18.2-1
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

webkit2gtk fails to cross build from source for a significant number of
reasons. One of those reasons is that debian/rules confuses build and
host. "build" is the machine type you are building on and host is the
one you are building for. Yet, debian/rules determines flags based on
the build architecture. Building e.g. for armhf on amd64 fails to find
gstreamer-gl-1.0, because the build-depends annotate the relevant
dependency with !armhf. Switching to the proper flags fixes this aspect,
but doesn't make webkit2gtk cross build. Please consider applying the
attached patch and closing this bug when doing so.

Helmut
diff --minimal -Nru webkit2gtk-2.18.2/debian/changelog 
webkit2gtk-2.18.2/debian/changelog
--- webkit2gtk-2.18.2/debian/changelog  2017-10-27 15:05:15.0 +0200
+++ webkit2gtk-2.18.2/debian/changelog  2017-11-09 17:26:34.0 +0100
@@ -1,3 +1,10 @@
+webkit2gtk (2.18.2-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix confusion of build and host in debian/rules. (Closes: #-1)
+
+ -- Helmut Grohne   Thu, 09 Nov 2017 17:26:34 +0100
+
 webkit2gtk (2.18.2-1) unstable; urgency=medium
 
   * New upstream release.
diff --minimal -Nru webkit2gtk-2.18.2/debian/rules 
webkit2gtk-2.18.2/debian/rules
--- webkit2gtk-2.18.2/debian/rules  2017-10-27 15:05:15.0 +0200
+++ webkit2gtk-2.18.2/debian/rules  2017-11-09 17:26:34.0 +0100
@@ -2,9 +2,7 @@
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
-DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
-DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+include /usr/share/dpkg/architecture.mk
 
 CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) -Wall
 CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
@@ -20,23 +18,23 @@
LDFLAGS += -Wl,--no-keep-memory
 endif
 
-ifeq ($(DEB_BUILD_ARCH),alpha)
+ifeq ($(DEB_HOST_ARCH),alpha)
LDFLAGS += -Wl,--no-relax
 endif
 
 # The debug packages produced by webkit are huge and cause problems in
 # most buildds, so use -g1 in all architectures except the ones that
 # are known to work fine
-ifeq (,$(filter $(DEB_BUILD_ARCH),amd64 ppc64 ppc64el))
+ifeq (,$(filter $(DEB_HOST_ARCH),amd64 ppc64 ppc64el))
CFLAGS := $(CFLAGS:-g=-g1)
 endif
 
-ifeq (,$(filter $(DEB_BUILD_ARCH),i386 amd64 hurd-i386 kfreebsd-i386 
kfreebsd-amd64 armhf arm64))
+ifeq (,$(filter $(DEB_HOST_ARCH),i386 amd64 hurd-i386 kfreebsd-i386 
kfreebsd-amd64 armhf arm64))
EXTRA_CMAKE_ARGUMENTS += -DENABLE_JIT=OFF
 endif
 
 # https://bugs.webkit.org/show_bug.cgi?id=175127
-ifneq (,$(filter $(DEB_BUILD_ARCH),armel armhf sparc64 hurd-i386 kfreebsd-i386 
kfreebsd-amd64))
+ifneq (,$(filter $(DEB_HOST_ARCH),armel armhf sparc64 hurd-i386 kfreebsd-i386 
kfreebsd-amd64))
EXTRA_CMAKE_ARGUMENTS += -DUSE_GSTREAMER_GL=OFF
 endif