Re: [Vala] Vala broken on non-gnu systems

2011-03-24 Thread pancake
Those defines should be defined by vala internally? All systems can be 
identified by __linux__ __FreeBSD__ ... do you think this should be defined by 
vala? Autoconf is imho not the right place for this.

On 23/03/2011, at 12:41, Marco Trevisan (Treviño) m...@3v1n0.net wrote:

 Il giorno mer, 16/03/2011 alle 14.05 +0100, pancake ha scritto:
 /* Result of the benchmark:
 $ time ./a.out 1
 
 real0m0.225s
 user0m0.223s
 sys 0m0.000s
 $ time ./a.out 0
 
 real0m0.380s
 user0m0.377s
 sys 0m0.000s
 */
 
 Well, since the difference seems sensible, it would be better if valac
 would export something like HAVE_POSIX when possible (or
 HAVE_{LINUX,BSD,WIN} ... ) and use them in VAPIs (and in vala files).
 I guess this would allow some code optinizations without a build
 system...
 
 
 ___
 vala-list mailing list
 vala-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/vala-list
 
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala broken on non-gnu systems

2011-03-23 Thread Treviño
Il giorno mer, 16/03/2011 alle 14.05 +0100, pancake ha scritto:
 /* Result of the benchmark:
 $ time ./a.out 1
 
 real0m0.225s
 user0m0.223s
 sys 0m0.000s
 $ time ./a.out 0
 
 real0m0.380s
 user0m0.377s
 sys 0m0.000s
 */

Well, since the difference seems sensible, it would be better if valac
would export something like HAVE_POSIX when possible (or
HAVE_{LINUX,BSD,WIN} ... ) and use them in VAPIs (and in vala files).
I guess this would allow some code optinizations without a build
system...


___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala broken on non-gnu systems

2011-03-16 Thread Alexander Kojevnikov
On 16 March 2011 13:49, Anatol Pomozov anatol.pomo...@gmail.com wrote:
 On Tue, Mar 15, 2011 at 10:46 PM, Alexander Kojevnikov
 alexan...@kojevnikov.com wrote:
 On 16 March 2011 12:07, Anatol Pomozov anatol.pomo...@gmail.com wrote:
 While you are here you might want to fix tests/testrunner.sh that also
 uses GNU extension (xargs -r). See line 167.

 Which Unix are you using?

 macosx 10.6.4

I filed this as bgo#644884 [0], please test the attached patch and
comment in the bug.

[0] https://bugzilla.gnome.org/show_bug.cgi?id=644884
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala broken on non-gnu systems

2011-03-16 Thread Anatol Pomozov
Hi

On Tue, Mar 15, 2011 at 11:43 PM, Alexander Kojevnikov
alexan...@kojevnikov.com wrote:
 On 16 March 2011 13:49, Anatol Pomozov anatol.pomo...@gmail.com wrote:
 On Tue, Mar 15, 2011 at 10:46 PM, Alexander Kojevnikov
 alexan...@kojevnikov.com wrote:
 On 16 March 2011 12:07, Anatol Pomozov anatol.pomo...@gmail.com wrote:
 While you are here you might want to fix tests/testrunner.sh that also
 uses GNU extension (xargs -r). See line 167.

 Which Unix are you using?

 macosx 10.6.4

 I filed this as bgo#644884 [0], please test the attached patch and
 comment in the bug.

 [0] https://bugzilla.gnome.org/show_bug.cgi?id=644884

Current HEAD is broken on macosx so I checked out revision before the
Jurg's change
$ git checkout a2d2120b~
applied your patch and it fixes the issue with xargs -r.

But now tests are broken because of other error:

make  check-TESTS
TEST: Building...  FAIL
cc1: error: -Wuninitialized is not supported without -O
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
make[4]: *** [check-TESTS] Error 1
make[3]: *** [check-am] Error 2
make[2]: *** [check] Error 2
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala broken on non-gnu systems

2011-03-16 Thread Anatol Pomozov
Hi

On Wed, Mar 16, 2011 at 1:37 AM, Alexander Kojevnikov
alexan...@kojevnikov.com wrote:
 On 16 March 2011 16:33, Anatol Pomozov anatol.pomo...@gmail.com wrote:
 But now tests are broken because of other error:

 make  check-TESTS
 TEST: Building...                                                      FAIL
 cc1: error: -Wuninitialized is not supported without -O
 error: cc exited with status 256
 Compilation failed: 1 error(s), 0 warning(s)
 make[4]: *** [check-TESTS] Error 1
 make[3]: *** [check-am] Error 2
 make[2]: *** [check] Error 2
 make[1]: *** [check-recursive] Error 1
 make: *** [check] Error 2


 This should be fixed by the patch in the other bug I mentioned, please
 give it a try:

 https://bugzilla.gnome.org/show_bug.cgi?id=644876

Thanks for your patches. It is much better now.

Now only dbus tests fail with

  /dbus/basic-types/server:FAIL
Failed to start message bus: launchd's environment variable
DBUS_LAUNCHD_SESSION_BUS_SOCKET is empty, but should contain a socket
path.

EOF in dbus-launch reading address from bus daemon

** CRITICAL **: file /Users/anatol/sources/vala/tests/_test/main.c:
line 19824: uncaught error: Error connecting: No such file or
directory (g-io-error-quark, 1)
aborting...
dbus.basic_types.server.check: line 4: 74545 Abort trap
./test /dbus/basic-types/server
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec
... or kill -l [sigspec]



It looks similar to this issue https://trac.macports.org/ticket/26712
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala broken on non-gnu systems

2011-03-16 Thread pancake

/* Result of the benchmark:
$ time ./a.out 1

real0m0.225s
user0m0.223s
sys 0m0.000s
$ time ./a.out 0

real0m0.380s
user0m0.377s
sys 0m0.000s
*/
#include string.h
#include sys/types.h
#define ITERS 10
int slen = ;
char *str;

static inline size_t  mystrnlen(const char*  str, size_t  maxlen) {
char*  p = memchr(str, 0, maxlen);

if (p == NULL)
return maxlen;
else
return (p - str);
}

int test_memchr () {
int i;
int ret = 0;
for (i=0; i ITERS; i++) {
ret += mystrnlen (str, slen);
}
return ret;
}

void test_strnlen () {
int i;
int ret = 0;
for (i=0; i ITERS; i++) {
ret += strnlen (str, slen);
}
return ret;
}

main(int argc, char **argv) {
if (argc1) {
str = malloc (slen+1);
memset (str, 'A', slen);
str[slen] = 0;
switch (atoi (argv[1])) {
case 0: test_memchr (); break;
case 1: test_strnlen (); break;
}
} else printf (Usage: memchr [0|1]\n);
}



On 03/16/11 09:59, Anatol Pomozov wrote:

Hi

On Wed, Mar 16, 2011 at 1:37 AM, Alexander Kojevnikov
alexan...@kojevnikov.com  wrote:

On 16 March 2011 16:33, Anatol Pomozovanatol.pomo...@gmail.com  wrote:

But now tests are broken because of other error:

make  check-TESTS
TEST: Building...  FAIL
cc1: error: -Wuninitialized is not supported without -O
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
make[4]: *** [check-TESTS] Error 1
make[3]: *** [check-am] Error 2
make[2]: *** [check] Error 2
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2


This should be fixed by the patch in the other bug I mentioned, please
give it a try:

https://bugzilla.gnome.org/show_bug.cgi?id=644876

Thanks for your patches. It is much better now.

Now only dbus tests fail with

   /dbus/basic-types/server:FAIL
Failed to start message bus: launchd's environment variable
DBUS_LAUNCHD_SESSION_BUS_SOCKET is empty, but should contain a socket
path.

EOF in dbus-launch reading address from bus daemon

** CRITICAL **: file /Users/anatol/sources/vala/tests/_test/main.c:
line 19824: uncaught error: Error connecting: No such file or
directory (g-io-error-quark, 1)
aborting...
dbus.basic_types.server.check: line 4: 74545 Abort trap
./test /dbus/basic-types/server
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec
... or kill -l [sigspec]



It looks similar to this issue https://trac.macports.org/ticket/26712
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala broken on non-gnu systems

2011-03-16 Thread Jürg Billeter
On Tue, 2011-03-15 at 20:05 +0100, pancake wrote:
 The commit a2s2120.. dated at 2011-02-10 adds the use of strnlen
 function in glib-2.0.vapi.
 
 This function is a gnu extension on libc. This is not glib and this
 function is only available in GNU LibC. Do the build breaks on OSX,
 Windows and probably all BSD systems.

This is now fixed in master. strnlen is in POSIX 2008 but Mac OS X
doesn't appear to support it yet.

Jürg

___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala broken on non-gnu systems

2011-03-15 Thread Anatol Pomozov
Hi

On Tue, Mar 15, 2011 at 12:05 PM, pancake panc...@nopcode.org wrote:
 The commit a2s2120.. dated at 2011-02-10 adds the use of strnlen function in 
 glib-2.0.vapi.

 This function is a gnu extension on libc. This is not glib and this function 
 is only available in GNU LibC. Do the build breaks on OSX, Windows and 
 probably all BSD systems.

 It would be great if someone with commit access (Jurg?) fixes that.

While you are here you might want to fix tests/testrunner.sh that also
uses GNU extension (xargs -r). See line 167.
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala broken on non-gnu systems

2011-03-15 Thread Alexander Kojevnikov
On 16 March 2011 12:07, Anatol Pomozov anatol.pomo...@gmail.com wrote:
 While you are here you might want to fix tests/testrunner.sh that also
 uses GNU extension (xargs -r). See line 167.

Which Unix are you using? FreeBSD's xarg works fine with or without
the -r option:

 -r  Compatibility with GNU xargs.  The GNU version of xargs runs the
 utility argument at least once, even if xargs input is empty, and
 it supports a -r option to inhibit this behavior.  The FreeBSD
 version of xargs does not run the utility argument on empty
 input, but it supports the -r option for command-line compatibil-
 ity with GNU xargs, but the -r option does nothing in the FreeBSD
 version of xargs.

On a side note, there are other issues with the test runner under
FreeBSD, they should be fixed by the patch attached to bgo#644876 [0]

[0] https://bugzilla.gnome.org/show_bug.cgi?id=644876
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala broken on non-gnu systems

2011-03-15 Thread Anatol Pomozov
Hi

On Tue, Mar 15, 2011 at 10:46 PM, Alexander Kojevnikov
alexan...@kojevnikov.com wrote:
 On 16 March 2011 12:07, Anatol Pomozov anatol.pomo...@gmail.com wrote:
 While you are here you might want to fix tests/testrunner.sh that also
 uses GNU extension (xargs -r). See line 167.

 Which Unix are you using?
macosx 10.6.4

 FreeBSD's xarg works fine with or without
 the -r option:

     -r      Compatibility with GNU xargs.  The GNU version of xargs runs the
             utility argument at least once, even if xargs input is empty, and
             it supports a -r option to inhibit this behavior.  The FreeBSD
             version of xargs does not run the utility argument on empty
             input, but it supports the -r option for command-line compatibil-
             ity with GNU xargs, but the -r option does nothing in the FreeBSD
             version of xargs.

 On a side note, there are other issues with the test runner under
 FreeBSD, they should be fixed by the patch attached to bgo#644876 [0]

 [0] https://bugzilla.gnome.org/show_bug.cgi?id=644876

___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list