Raku / whateverable

🤖 Different IRC bots that operate on a bunch of prebuilt Rakudo versions
https://gist.github.com/Whateverable
GNU Affero General Public License v3.0
18 stars 14 forks source link

Nativecallable is currently broken #281

Open AlexDaniel opened 6 years ago

AlexDaniel commented 6 years ago

Currently fails with this error:

gccxml_cc1plus: error: gccxml_builtins.h: No such file or directory
In file included from /tmp/N4yd5tJoeo:2:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:436: error: typedef 'decltype' is initialized (use __typeof__ instead)
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:436: error: 'nullptr' was not declared in this scope

I think the issue is not on our side.

manchicken commented 6 years ago

Can you please give us more context? The build script seems likely to make a difference here. Are you using LibraryMake? Are you using zef to build?

AlexDaniel commented 6 years ago

@manchicken sure, let's see if this little bit helps.

Let's say we have a file test.c:

#include <stddef.h>
#include <stdbool.h>

struct s {char b[];};

Now if I run this command in the terminal:

gptrixie --all test.c

I get this:

Calling GCCXML : gccxml test.c -fxml=plop.xml 
gccxml_cc1plus: error: gccxml_builtins.h: No such file or directory
In file included from test.c:1:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:436: error: typedef 'decltype' is initialized (use __typeof__ instead)
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:436: error: 'nullptr' was not declared in this scope
The spawned command 'gccxml' exited unsuccessfully (exit code: 1)
  in sub do-magic at /home/bisectable/.rakudobrew/moar-master/install/share/perl6/site/resources/915D48261FF094EE915B9274D7F47E4DB23C70AA line 217
  in sub MAIN at /home/bisectable/.rakudobrew/moar-master/install/share/perl6/site/resources/915D48261FF094EE915B9274D7F47E4DB23C70AA line 79
  in block <unit> at /home/bisectable/.rakudobrew/moar-master/install/share/perl6/site/resources/915D48261FF094EE915B9274D7F47E4DB23C70AA line 198
  in sub MAIN at /home/bisectable/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/gptrixie line 2
  in block <unit> at /home/bisectable/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/gptrixie line 2

You should be able to get gptrixie executable by installing GPTrixie module from zef (if using rakudobrew you might need to run rakudobrew rehash to get the executable included in PATH).

With this info, can you try reproducing it? Or does it work perfectly for you?

In my setup, gccxml version is 0.9.0+git20140716-2 but I don't see it in debian repos and now I'm wondering how it was installed…

That's all I know at this point. Any thoughts?

AlexDaniel commented 6 years ago

Ping @Skarsnik.

AlexDaniel commented 6 years ago

OK the issue seems to be with gccxml, but that thing no longer exist in debian repos (if it existed at all). According to GPTrixie docs, it is possible to use castxml instead.

By slapping --castxml=c11 parameter to gptrixie I got this:

\<AlexDaniel> nativecallable6: struct s {char b[10];}; \<nativecallable6> AlexDaniel, https://gist.github.com/6f57ec940c9e91f409d9a5e31059ef8b

So it's not entirely broken now, but it's nowhere close to the previous output as shown in https://github.com/perl6/whateverable/wiki/Nativecallable#basics.

I guess I should compile gccxml myself? But I'm not entirely interested in that kind of solution…

Skarsnik commented 6 years ago

Try compiling a .h not a .c I think it make gccxml or cast add stuff

2018-01-31 3:44 GMT+01:00 Aleks-Daniel Jakimenko-Aleksejev < notifications@github.com>:

OK the issue seems to be with gccxml, but that thing no longer exist in debian repos (if it existed at all). According to GPTrixie docs, it is possible to use castxml instead.

By slapping --castxml=c11 parameter I got something like this:

nativecallable6: struct s {char b[10];}; AlexDaniel, https://gist.github.com/ 6f57ec940c9e91f409d9a5e31059ef8b So it's not entirely broken now, but it's nowhere close to the previous output as shown in https://github.com/perl6/whateverable/wiki/ Nativecallable#basics. I guess I should compile gccxml myself? But I'm not entirely interested in that kind of solution… — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread .

-- Sylvain "Skarsnik" Colinet

Victory was near but the power of the ring couldn't be undone

AlexDaniel commented 6 years ago

Same result for .c and .h with castxml.

Skarsnik commented 6 years ago

Ok, I will have a look this afternoon. It seens my last commits mess up the filtering on headers. It should not display more than just the file definition and not some internal one.

2018-01-31 12:15 GMT+01:00 Aleks-Daniel Jakimenko-Aleksejev < notifications@github.com>:

Same result for .c and .h with castxml.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/perl6/whateverable/issues/281#issuecomment-361901743, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYVfxsL5-2i86XnQ0KPYbLAipkF9BWaks5tQEtSgaJpZM4RzUdg .

-- Sylvain "Skarsnik" Colinet

Victory was near but the power of the ring couldn't be undone

AlexDaniel commented 6 years ago

Thanks to @Skarsnik, the situation is much better now and the bot is almost working. Next issue: https://github.com/Skarsnik/gptrixie/issues/13