Re: Patch for premake 4.4 beta 5 from premake 4
CC'ing premake developers. 24.06.2014, 18:09, Vitaly Magerya vmage...@gmail.com: TL;DR: could a brave ports comitter apply an update for devel/premake4 at [1]? That would be much appreciated. Redports logs for this update are at [2]. Note that redports for some reason doesn't invoke regression-test target today; probably a bug on their part. On 2014-06-24 09:51, Sergei G wrote: I had to update Premake 4 port (4.3) to 4.4 beta 5 on FreeBSD 10.0-RELEASE #0. I included patch file with changes applied to Premake 4 port. The changes consist of: 3 regression tests failed (it appears due to at least one missing patch file): The main cause of these regressions is actually a very strange one (and you're right that those patches are what fixed it in the past). So, in one of it's routines premake tries to open '/etc/ld.so.conf'; it does so via Lua function 'io.open'. Now, FreeBSD doesn't have that file, and in theory 'io.open' should return 'nil', which should cause premake to skip this file. What actually happens is that 'io.open' returns some object that is neither nil, nor a proper file object. Premake thinks that 'io.open' succeeded, and tries to read from that non-nil, non-file object, which doesn't work. Why doesn't 'io.open' return 'nil' here is a mystery to me. Maybe premake ships with buggy Lua sources. I don't know. In any case, this problem is fixed in the patch at [1]. Once I installed premake I observed that it generated Makefile with gcc in it, instead of clang. Should switch to clang be applied at premake or Box2D project level? It appears that Premake only supports GCC for its gmake target. It is possible to simply replace gcc with clang in the premake sources, and it will mostly work, but: 1) it will not work for projects that use advanced options, since clang does not support, and in fact fails on some of the flags premake may pass to it (-ffast-math for example); 2) makefiles generated on FreeBSD will fail on other platforms (not sure if premake promises them to work though). The long-term solution for premake is to recognize clang as a valid compiler, and provide a set of flags it understands. The short-term solution for programs that use premake is to either require GCC from ports, or to manually replace gcc with clang before building, patching out incompatible compiler flags, if any. Note that Box2D v2.3.1 doesn't seem to use any flags that clang doesn't understand, so it is safe to change gcc into cc, and g++ into c++ in the makefiles that premake generates for it. [1] http://tx97.net/~magv/diff/premake-4.4.b5.diff [2] https://redports.org/buildarchive/20140624134401-54287/ ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org -- Regards, Konstantin ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Patch for premake 4.4 beta 5 from premake 4
I should've probably posted in here, but I have created yesterday issue in official premake bug tracking system with reference to this thread. https://bitbucket.org/premake/premake-dev/issue/241/freebsd-10-support-on-44-beta-5 On Wed, Jun 25, 2014 at 1:10 AM, Konstantin Tokarev annu...@yandex.ru wrote: CC'ing premake developers. 24.06.2014, 18:09, Vitaly Magerya vmage...@gmail.com: TL;DR: could a brave ports comitter apply an update for devel/premake4 at [1]? That would be much appreciated. Redports logs for this update are at [2]. Note that redports for some reason doesn't invoke regression-test target today; probably a bug on their part. On 2014-06-24 09:51, Sergei G wrote: I had to update Premake 4 port (4.3) to 4.4 beta 5 on FreeBSD 10.0-RELEASE #0. I included patch file with changes applied to Premake 4 port. The changes consist of: 3 regression tests failed (it appears due to at least one missing patch file): The main cause of these regressions is actually a very strange one (and you're right that those patches are what fixed it in the past). So, in one of it's routines premake tries to open '/etc/ld.so.conf'; it does so via Lua function 'io.open'. Now, FreeBSD doesn't have that file, and in theory 'io.open' should return 'nil', which should cause premake to skip this file. What actually happens is that 'io.open' returns some object that is neither nil, nor a proper file object. Premake thinks that 'io.open' succeeded, and tries to read from that non-nil, non-file object, which doesn't work. Why doesn't 'io.open' return 'nil' here is a mystery to me. Maybe premake ships with buggy Lua sources. I don't know. In any case, this problem is fixed in the patch at [1]. Once I installed premake I observed that it generated Makefile with gcc in it, instead of clang. Should switch to clang be applied at premake or Box2D project level? It appears that Premake only supports GCC for its gmake target. It is possible to simply replace gcc with clang in the premake sources, and it will mostly work, but: 1) it will not work for projects that use advanced options, since clang does not support, and in fact fails on some of the flags premake may pass to it (-ffast-math for example); 2) makefiles generated on FreeBSD will fail on other platforms (not sure if premake promises them to work though). The long-term solution for premake is to recognize clang as a valid compiler, and provide a set of flags it understands. The short-term solution for programs that use premake is to either require GCC from ports, or to manually replace gcc with clang before building, patching out incompatible compiler flags, if any. Note that Box2D v2.3.1 doesn't seem to use any flags that clang doesn't understand, so it is safe to change gcc into cc, and g++ into c++ in the makefiles that premake generates for it. [1] http://tx97.net/~magv/diff/premake-4.4.b5.diff [2] https://redports.org/buildarchive/20140624134401-54287/ ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org -- Regards, Konstantin ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Patch for premake 4.4 beta 5 from premake 4
I had to update Premake 4 port (4.3) to 4.4 beta 5 on FreeBSD 10.0-RELEASE #0. I included patch file with changes applied to Premake 4 port. The changes consist of: 1. updating version and addition of beta version in Makefile 2. switch to clang compiler in Makefile 3. update of download file signatures 4. removal of 2 patch files, because the files appear to be obsolete and I could not figure out the proper fix. Keeping both patch files resulted in error during premake execution. I was successful for my small scope of compiling Box2D, but I observed a couple of issues with my upgrade. 3 regression tests failed (it appears due to at least one missing patch file): cd /usr/ports/devel/premake4.4/work/premake-4.4-beta5/tests ./test Building configurations... Running action 'test'... os.findlib_FindSystemLib: [string function os.executef(cmd, ...)...]:12: attempt to call method 'lines' (a nil value) os.findlib_FailsOnBadLibName: [string function os.executef(cmd, ...)...]:12: attempt to call method 'lines' (a nil value) premake_command.valueIsSet: ...remake-4.4-beta5/tests/base/test_premake_command.lua:13: expected /usr/ports/devel/premake4.4/work/premake-4.4-beta5/bin/debug/premake4 but was /usr/ports/devel/premake4.4/work/premake-4.4-beta5/bin/release/premake4 running time : 1.9140625 713 tests passed, 3 failed Done. Once I installed premake I observed that it generated Makefile with gcc in it, instead of clang. Should switch to clang be applied at premake or Box2D project level? Thanks diff -Naur premake4/Makefile premake4.4/Makefile --- premake4/Makefile 2014-01-24 16:41:42.0 -0800 +++ premake4.4/Makefile 2014-06-23 23:33:07.0 -0700 @@ -2,10 +2,11 @@ # $FreeBSD: head/devel/premake4/Makefile 340969 2014-01-25 00:41:42Z bapt $ PORTNAME= premake4 -PORTVERSION= 4.3 +PORTVERSION= 4.4 +BETAVERSION=-beta5 CATEGORIES=devel MASTER_SITES= SF/premake/Premake/${PORTVERSION} -DISTNAME= premake-${PORTVERSION}-src +DISTNAME= premake-${PORTVERSION}${BETAVERSION}-src EXTRACT_SUFX= .zip MAINTAINER=vmage...@gmail.com @@ -13,7 +14,7 @@ OPTIONS_DEFINE=DOCS -WRKSRC=${WRKDIR}/premake-${PORTVERSION} +WRKSRC=${WRKDIR}/premake-${PORTVERSION}${BETAVERSION} BUILD_WRKSRC= ${WRKSRC}/build/gmake.unix USES= gmake @@ -24,7 +25,7 @@ PORTDOCS= CHANGES.txt LICENSE.txt README.txt post-patch: - ${REINPLACE_CMD} -e 's|-ldl||' ${BUILD_WRKSRC}/Premake4.make + ${REINPLACE_CMD} -e 's|-ldl||' -e 's|CC = gcc|CC = clang|' -e 's|CXX = g\+\+|CXX = clang++|' ${BUILD_WRKSRC}/Premake4.make ${REINPLACE_CMD} -e 's|debug|release|' ${WRKSRC}/tests/test do-install: diff -Naur premake4/distinfo premake4.4/distinfo --- premake4/distinfo 2014-01-22 07:30:13.0 -0800 +++ premake4.4/distinfo 2014-06-23 22:01:46.0 -0700 @@ -1,2 +1,2 @@ -SHA256 (premake-4.3-src.zip) = 36536490f8928d8ecde135da80cd8b751ea5bebe50cabba5c0de49cd41cb2780 -SIZE (premake-4.3-src.zip) = 514366 +SHA256 (premake-4.4-beta5-src.zip) = 0fa1ed02c5229d931e87995123cdb11d44fcc8bd99bba8e8bb1bbc0aaa798161 +SIZE (premake-4.4-beta5-src.zip) = 596883 diff -Naur premake4/files/patch-src-base-os.lua premake4.4/files/patch-src-base-os.lua --- premake4/files/patch-src-base-os.lua2014-01-22 09:40:44.0 -0800 +++ premake4.4/files/patch-src-base-os.lua 1969-12-31 16:00:00.0 -0800 @@ -1,17 +0,0 @@ src/base/os.lua.orig 2012-01-31 15:40:25.0 +0200 -+++ src/base/os.lua2012-01-31 15:42:16.0 +0200 -@@ -33,14 +33,6 @@ - else - formats = { lib%s.so, %s.so } - path = os.getenv(LD_LIBRARY_PATH) or -- -- io.input(/etc/ld.so.conf) -- if io.input() then -- for line in io.lines() do -- path = path .. : .. line -- end -- io.input():close() -- end - end - - table.insert(formats, %s) diff -Naur premake4/files/patch-src-host-scripts.c premake4.4/files/patch-src-host-scripts.c --- premake4/files/patch-src-host-scripts.c 2014-01-22 09:40:44.0 -0800 +++ premake4.4/files/patch-src-host-scripts.c 1969-12-31 16:00:00.0 -0800 @@ -1,5 +0,0 @@ src/host/scripts.c.orig2010-11-16 13:29:13.0 +0200 -+++ src/host/scripts.c 2012-01-31 16:05:26.0 +0200 -@@ -7 +7 @@ -- function os.executef(cmd, ...)\ncmd = string.format(cmd, unpack(arg))\nreturn os.execute(cmd)\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\windows\) then\nformats = { \%s.dll\, \%s\ }\npath = os.getenv(\PATH\)\nelse\nif os.is(\macosx\) then\nformats
Re: Patch for premake 4.4 beta 5 from premake 4
On 2014-06-24 09:51, Sergei G wrote: I had to update Premake 4 port (4.3) to 4.4 beta 5 on FreeBSD 10.0-RELEASE #0. I wanted to wait for the full (non-beta) 4.4 release, but seeing that some projects are already using 4.4-betas, I guess it's time to update the port... I included patch file with changes applied to Premake 4 port. The changes consist of: 1. updating version and addition of beta version in Makefile 2. switch to clang compiler in Makefile It's better to use 'cc' instead of 'clang'; this way nothing will break in 8.x and 9.x branches where GCC is still the default. 3. update of download file signatures 4. removal of 2 patch files, because the files appear to be obsolete and I could not figure out the proper fix. Keeping both patch files resulted in error during premake execution. I was successful for my small scope of compiling Box2D, but I observed a couple of issues with my upgrade. 3 regression tests failed (it appears due to at least one missing patch file): [...] Once I installed premake I observed that it generated Makefile with gcc in it, instead of clang. Should switch to clang be applied at premake or Box2D project level? I'll need to look into that before saying anything definite; I'll report back once I'll do that. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Patch for premake 4.4 beta 5 from premake 4
TL;DR: could a brave ports comitter apply an update for devel/premake4 at [1]? That would be much appreciated. Redports logs for this update are at [2]. Note that redports for some reason doesn't invoke regression-test target today; probably a bug on their part. On 2014-06-24 09:51, Sergei G wrote: I had to update Premake 4 port (4.3) to 4.4 beta 5 on FreeBSD 10.0-RELEASE #0. I included patch file with changes applied to Premake 4 port. The changes consist of: 3 regression tests failed (it appears due to at least one missing patch file): The main cause of these regressions is actually a very strange one (and you're right that those patches are what fixed it in the past). So, in one of it's routines premake tries to open '/etc/ld.so.conf'; it does so via Lua function 'io.open'. Now, FreeBSD doesn't have that file, and in theory 'io.open' should return 'nil', which should cause premake to skip this file. What actually happens is that 'io.open' returns some object that is neither nil, nor a proper file object. Premake thinks that 'io.open' succeeded, and tries to read from that non-nil, non-file object, which doesn't work. Why doesn't 'io.open' return 'nil' here is a mystery to me. Maybe premake ships with buggy Lua sources. I don't know. In any case, this problem is fixed in the patch at [1]. Once I installed premake I observed that it generated Makefile with gcc in it, instead of clang. Should switch to clang be applied at premake or Box2D project level? It appears that Premake only supports GCC for its gmake target. It is possible to simply replace gcc with clang in the premake sources, and it will mostly work, but: 1) it will not work for projects that use advanced options, since clang does not support, and in fact fails on some of the flags premake may pass to it (-ffast-math for example); 2) makefiles generated on FreeBSD will fail on other platforms (not sure if premake promises them to work though). The long-term solution for premake is to recognize clang as a valid compiler, and provide a set of flags it understands. The short-term solution for programs that use premake is to either require GCC from ports, or to manually replace gcc with clang before building, patching out incompatible compiler flags, if any. Note that Box2D v2.3.1 doesn't seem to use any flags that clang doesn't understand, so it is safe to change gcc into cc, and g++ into c++ in the makefiles that premake generates for it. [1] http://tx97.net/~magv/diff/premake-4.4.b5.diff [2] https://redports.org/buildarchive/20140624134401-54287/ ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org