Re: [ports-gcc-8] Unbreak lang/erlang/*

2019-04-16 Thread Charlene Wendling
On Mon, 15 Apr 2019 15:39:56 +0100
Stuart Henderson  wrote:

> On 2019/04/15 13:34, Stuart Henderson wrote:
> > There are two approaches -
> > 
> > - either we can just get rid of the mechanism completely (it isn't
> > used consistently; compare 19/pkg/PLIST-main with the others).
> > Upside: simple. Downside: bigger PLIST diffs between Erlang updates.
> > 
> > - or we can rename the variables used (prefix with E_ or something),
> > either just COMPILER to reduce PLIST churn, or all of them.
> > 
> > I'm leaning towards the first one. Builds ongoing ...
> > 
> 
> I went for the second in the end to reduce infrastructure changes.
> 
> 

Awesome, your diff allowed to build all Erlang versions on
macppc/ports-gcc-8 without issues :) Thanks again!

OK cwen@



Re: [ports-gcc-8] Unbreak lang/erlang/*

2019-04-15 Thread Stuart Henderson
On 2019/04/15 00:54, Charlene Wendling wrote:
> 
> Erlang (all versions) doesn't package with ports-gcc-8, because: 
> 
> - WxWidgets is built with headers made for ports-gcc-8, with
>   C++14 as the standard C++ version.
> 
> - Erlang requires WxWidgets but uses base-gcc, and during
>   configuration, it indeed outputs in $WRKSRC/lib/wx/config.log: 
>   
>   "/usr/local/include/wx-3.0/wx/strvararg.h:25:27: error:"
>   "type_traits: No such file or directory"
>   
>   AFAIK base-gcc wants 
> 
> - Meanwhile, it just builds without Wx, the issue appears when
>   packaging, because the Wx related files are not present.
> 
> 
> It should have been easy if CHOSEN_COMPILER wasn't "irrelevant",
> and if we were able to define it, but it would break the build on
> clang archs.
> 
> What i'm proposing here is to bypass CHOSEN_COMPILER for !clang
> arches. It unbreaks the packaging and ensures that WANTLIB is 
> proper, calling egcc/++ directly seems a bit too rough though.
> 
> It has been tested against Erlang 16 and 18, as my partial bulk
> is still ongoing, i don't have resources to try them all.

This mess is due to a conflict between the variable name COMPILER in
infrastructure, and the mechanism used in the Erlang ports Makefile
to substitute e.g. "compiler-7.3" with "${COMPILER}" in the plists.
It isn't passed to the erlang build, it's just done for the port.

The "COMPILER=irrelevant" thing in Makefile.inc was done as a quick
fix in the gcc/clang transition but it's confusing and gets in the way.
And with wxWidgets we *do* want to use COMPILER the way it was intended.

Rather than stacking another hack on top of the existing
"CHOSEN_COMPILER=irrelevant" one, let's just get rid of it.

There are two approaches -

- either we can just get rid of the mechanism completely (it isn't
used consistently; compare 19/pkg/PLIST-main with the others). Upside:
simple. Downside: bigger PLIST diffs between Erlang updates.

- or we can rename the variables used (prefix with E_ or something),
either just COMPILER to reduce PLIST churn, or all of them.

I'm leaning towards the first one. Builds ongoing ...



[ports-gcc-8] Unbreak lang/erlang/*

2019-04-14 Thread Charlene Wendling


Erlang (all versions) doesn't package with ports-gcc-8, because: 

- WxWidgets is built with headers made for ports-gcc-8, with
  C++14 as the standard C++ version.

- Erlang requires WxWidgets but uses base-gcc, and during
  configuration, it indeed outputs in $WRKSRC/lib/wx/config.log: 
  
  "/usr/local/include/wx-3.0/wx/strvararg.h:25:27: error:"
  "type_traits: No such file or directory"
  
  AFAIK base-gcc wants 

- Meanwhile, it just builds without Wx, the issue appears when
  packaging, because the Wx related files are not present.


It should have been easy if CHOSEN_COMPILER wasn't "irrelevant",
and if we were able to define it, but it would break the build on
clang archs.

What i'm proposing here is to bypass CHOSEN_COMPILER for !clang
arches. It unbreaks the packaging and ensures that WANTLIB is 
proper, calling egcc/++ directly seems a bit too rough though.

It has been tested against Erlang 16 and 18, as my partial bulk
is still ongoing, i don't have resources to try them all.


Charlène. 


Index: Makefile.inc
===
RCS file: /cvs/ports/lang/erlang/Makefile.inc,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile.inc
--- Makefile.inc2 Jun 2018 14:03:24 -   1.17
+++ Makefile.inc14 Apr 2019 22:19:51 -
@@ -40,6 +40,18 @@ CFLAGS +=-fno-pie
 LDFLAGS += -nopie
 .endif
 
+# Unbreak wx libs. WxWidgets is built with ports-gcc-8, clashing
+# with base-gcc-4.2 used to build Erlang because of different C++ 
+# headers used.  We can't set COMPILER in a short, don't repeat
+# yourself way because COMPILER is "irrelevant" (see 18/Makefile
+# for example), so doing it here.
+.if ! ${PROPERTIES:Mclang}
+MODULES += gcc4
+COMPILER_LIBCXX =  ${LIBECXX}
+CC =   ${LOCALBASE}/bin/egcc
+CXX =  ${LOCALBASE}/bin/eg++
+.endif
+
 USE_GMAKE= Yes
 
 MAKE_ENV +=DESTDIR=$(DESTDIR)
Index: 16/Makefile
===
RCS file: /cvs/ports/lang/erlang/16/Makefile,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile
--- 16/Makefile 2 Jan 2019 12:44:07 -   1.23
+++ 16/Makefile 14 Apr 2019 22:19:51 -
@@ -13,8 +13,8 @@ PKGNAME=  erlang-$V
 PKGNAME-main=  erlang-16b.03
 PKGNAME-wx=erlang-wx-16b.03
 
-REVISION-main= 16
-REVISION-wx=   4
+REVISION-main= 17
+REVISION-wx=   5
 
 VERSION_SPEC=  >=16v0,<17v0
 PKGSPEC-main=  erlang-${VERSION_SPEC}
Index: 17/Makefile
===
RCS file: /cvs/ports/lang/erlang/17/Makefile,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile
--- 17/Makefile 2 Jan 2019 12:44:07 -   1.23
+++ 17/Makefile 14 Apr 2019 22:19:51 -
@@ -13,8 +13,8 @@ PKGNAME=  erlang-$V
 PKGNAME-main=  erlang-$V
 PKGNAME-wx=erlang-wx-$V
 
-REVISION-main= 12
-REVISION-wx=   4
+REVISION-main= 13
+REVISION-wx=   5
 
 VERSION_SPEC=  >=17v0,<18v0
 PKGSPEC-main=  erlang-${VERSION_SPEC}
Index: 18/Makefile
===
RCS file: /cvs/ports/lang/erlang/18/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- 18/Makefile 2 Jan 2019 12:44:07 -   1.20
+++ 18/Makefile 14 Apr 2019 22:19:51 -
@@ -12,7 +12,8 @@ DISTNAME= otp_src_$V
 PKGNAME=   erlang-$V
 PKGNAME-main=  erlang-$V
 PKGNAME-wx=erlang-wx-$V
-REVISION-wx=   0
+REVISION-main= 0
+REVISION-wx=   1
 
 VERSION_SPEC=  >=18v0,<19v0
 PKGSPEC-main=  erlang-${VERSION_SPEC}
Index: 19/Makefile
===
RCS file: /cvs/ports/lang/erlang/19/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- 19/Makefile 2 Jan 2019 12:44:07 -   1.13
+++ 19/Makefile 14 Apr 2019 22:19:51 -
@@ -13,8 +13,8 @@ PKGNAME=  erlang-$V
 PKGNAME-main=  erlang-$V
 PKGNAME-wx=erlang-wx-$V
 
-REVISION-main= 5
-REVISION-wx=   2
+REVISION-main= 6
+REVISION-wx=   3
 
 VERSION_SPEC=  >=19v0,<20v0
 PKGSPEC-main=  erlang-${VERSION_SPEC}
Index: 21/Makefile
===
RCS file: /cvs/ports/lang/erlang/21/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- 21/Makefile 2 Jan 2019 12:44:07 -   1.2
+++ 21/Makefile 14 Apr 2019 22:19:51 -
@@ -7,7 +7,8 @@ COMMENT-wx= WxWidgets bindings for Erlan
 
 V= 21.2
 MAJ_V= 21
-REVISION=  0
+REVISION=  1
+REVISION-wx=   0
 EPOCH= 0
 DISTNAME=  otp_src_$V
 PKGNAME=   erlang-$V