Learning BIRD source
Developer team: I’d like to get better with the source. Due to being an inferior specimen and/or too many other projects, I need help from tools like CLion to make sense of source trees within weeks instead of years. Are others working on BIRD source within IDEs? I know "real programmers use vim and emacs”, etc, but please refer to previous paragraph in that case… For all it matters, I am not a bush league developer, I have written code using bison and flex and am super stoked to get my hands dirty here. One option that presents itself to me is converting the build from Autotools to CMake. That’s sure to make someone’s blood boil. But if not (or there is a similarly worthy tool folks would accept), would such a transition be PR-worthy? Because it’s declarative vs. procedural, CMake is possible for IDEs to ingest and make sensible semantic presentations with. That leads to better productivity and more possible contributors in the long run. I’m just poking the bear here with ideas and being as lazy as possible, but not afraid of the work at the same time. Grateful for any and all ideas! B
Brian Topping <brian.topping@gmail.com> writes:
Developer team:
I’d like to get better with the source. Due to being an inferior specimen and/or too many other projects, I need help from tools like CLion to make sense of source trees within weeks instead of years.
Are others working on BIRD source within IDEs? I know "real programmers use vim and emacs”, etc, but please refer to previous paragraph in that case… For all it matters, I am not a bush league developer, I have written code using bison and flex and am super stoked to get my hands dirty here.
One option that presents itself to me is converting the build from Autotools to CMake. That’s sure to make someone’s blood boil. But if not (or there is a similarly worthy tool folks would accept), would such a transition be PR-worthy? Because it’s declarative vs. procedural, CMake is possible for IDEs to ingest and make sensible semantic presentations with. That leads to better productivity and more possible contributors in the long run.
I’m just poking the bear here with ideas and being as lazy as possible, but not afraid of the work at the same time.
Grateful for any and all ideas! B
I'd suggest starting with 'make tags' or 'make cscope' - I tend to prefer the latter; will probably depend on what your IDE supports, though :) -Toke
On April 12, 2019 8:52:47 PM GMT+02:00, Brian Topping <brian.topping@gmail.com> wrote:
Developer team:
I’d like to get better with the source. Due to being an inferior specimen and/or too many other projects, I need help from tools like CLion to make sense of source trees within weeks instead of years.
Are others working on BIRD source within IDEs? I know "real programmers use vim and emacs”, etc, but please refer to previous paragraph in that case… For all it matters, I am not a bush league developer, I have written code using bison and flex and am super stoked to get my hands dirty here.
I think any IDE with C support you like should work, maybe except for Visual Studio which has no real C compiler anyway so it won't build there at all.
One option that presents itself to me is converting the build from Autotools to CMake. That’s sure to make someone’s blood boil. But if not (or there is a similarly worthy tool folks would accept), would such a transition be PR-worthy? Because it’s declarative vs. procedural, CMake is possible for IDEs to ingest and make sensible semantic presentations with. That leads to better productivity and more possible contributors in the long run.
If you convince me to merge it, no problem. Which is more dangerous that it seems to be -- I'm quite a strong opponent against almost any generator of makefiles. What I accept is how it is done now – the configure script generates only a little part of one of the Makefiles, all others being autoincluded. One of the main reasons is simply that it adds another layer of indirection which should have really good reasons. BTW almost any IDE I know about has an option to set what to run to rebuild so I don't understand much what about IDE compatibility should improve with conversion to CMake. Maria
* Maria Matějka <jan.matejka@nic.cz> [190413 17:17 +0200]:
On April 12, 2019 8:52:47 PM GMT+02:00, Brian Topping <brian.topping@gmail.com> wrote:
Developer team:
I’d like to get better with the source. Due to being an inferior specimen and/or too many other projects, I need help from tools like CLion to make sense of source trees within weeks instead of years.
Are others working on BIRD source within IDEs? I know "real programmers use vim and emacs”, etc, but please refer to previous paragraph in that case… For all it matters, I am not a bush league developer, I have written code using bison and flex and am super stoked to get my hands dirty here.
I think any IDE with C support you like should work, maybe except for Visual Studio which has no real C compiler anyway so it won't build there at all.
How do you figure? Visual Studio has an ANSI C compiler.
I think any IDE with C support you like should work, maybe except for Visual Studio which has no real C compiler anyway so it won't build there at all.
How do you figure? Visual Studio has an ANSI C compiler.
Oh, sorry, I always thought that the compiler was buggy even in ANSI C features, however I can't find any source now; my last (painful) experience with VS is several years old. Which still doesn't mean that it will compile BIRD smoothly: * we use C11 (not fully supported in VS) and we should also check this in the configure script (now there is C99 check, which is not enough due to anonymous unions and structs) * we don't have any sysdep for windows (the event loop and other system dependent routines), * we also use some GNU C extensions If anybody wanted to make BIRD build under VS, try it, patches are welcome. I'm just issuing a warning about that, maybe with not enough respect. (If you feel I was too rude, sorry for that.) Maria
Hello!
How do you figure? Visual Studio has an ANSI C compiler.
If the situation has not changed recently, it has a compiler for the old ANSI C, but not for anything modern like ISO C99 or C11. Have a nice fortnight -- Martin `MJ' Mareš <mares@kam.mff.cuni.cz> http://mj.ucw.cz/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth Why is it called "common sense" when nobody seems to have any?
On Apr 13, 2019, at 9:17 AM, Maria Matějka <jan.matejka@nic.cz> wrote:
If you convince me to merge it, no problem. Which is more dangerous that it seems to be -- I'm quite a strong opponent against almost any generator of makefiles. What I accept is how it is done now – the configure script generates only a little part of one of the Makefiles, all others being autoincluded.
Thanks, challenge made. I’ll see if I can come up with something that works, and then others like. It’s a process, I just didn’t want to put much effort in if it wasn’t even an option. If I get there and you and the team like it, we’ll take it from there.
One of the main reasons is simply that it adds another layer of indirection which should have really good reasons.
I wasn’t aware that CMake was a makefile generator, I thought it did everything natively. TIL. The good reasons will hopefully be IDE compatibility…
BTW almost any IDE I know about has an option to set what to run to rebuild so I don't understand much what about IDE compatibility should improve with conversion to CMake.
… but this part may be the subjective. The last 20 years of my own experience are working in IDEs that have full semantics and pup-up menus accessible through a modifier-click sequence. To say I am dependent on them is an analog to say I am dependent on a chain saw in a secluded cabin. It would be much nicer than cutting wood by hand, but if I am going to die because I have no gasoline for the saw, I would certainly get on with the manual saw… :-) In many cases, it’s sufficient to do a build and then load the directory of built sources. Generated source out of something like bison or flex would then be parsed as normal. But for some reason, it’s not doing that with the BIRD tree. So this inquiry was really about whether I would be the only consumer of the CMake results or there was potentially a bigger audience. best, Brian
In many cases, it’s sufficient to do a build and then load the directory of built sources. Generated source out of something like bison or flex would then be parsed as normal. But for some reason, it’s not doing that with the BIRD tree. So this inquiry was really about whether I would be the only consumer of the CMake results or there was potentially a bigger audience.
And couldn't you just share what IDE you are trying to setup with BIRD and what exact problems you have? It should take me less time helping you setup BIRD in that specific IDE than merging CMake, not even counting your time needed for the rewrite. The other reason is – I suspect there is another problem (as the bison input is also itself generated by M4 which may confuse the IDE) and you are trying to use a universal solution instead of fixing that little problem. Adding to that – there will be another big part of code generated by M4 after merging the new filter interpreter in. That may confuse the IDEs even more. Which is why I think the problem should be addressed first specifically (to find out how to tell the IDE the real source), before trying to apply a big hammer just because this looks like a nail. And we can also put the IDE manual to our little wiki to be some start point for others. What I'm trying to say – let's first try to find a quick and easy way to fix your problem before doing a project-wide change. Maria
On Apr 14, 2019, at 11:07 PM, Maria Matějka <jan.matejka@nic.cz> wrote:
And couldn't you just share what IDE you are trying to setup with BIRD and what exact problems you have? It should take me less time helping you setup BIRD in that specific IDE than merging CMake, not even counting your time needed for the rewrite.
Indeed, I was trying to avoid creating work for others. It’s with CLion. The problem is the symbol tracing and syntax highlighting, it’s clear that the headers and sources are not being read correctly. As I mentioned, I built the sources cleanly with Autotools and then imported the project. It generates CMakeLists.txt, but they are incorrect (even though this often works). I’m open to using other IDEs that work out of the box, I simply have a license for CLion. Anyone can get a 30 day license for CLion when it opens, just download the enterprise version and use it. Also, open source contributors can get a free license that can only be used for open source projects.
What I'm trying to say – let's first try to find a quick and easy way to fix your problem before doing a project-wide change.
Yes, I agree that would be a more appropriate first step, much appreciated. I just typically assume the best way to get something done is to not expect someone to be there to help. So maybe I went too far with that this time :) Brian
On April 15, 2019 3:03:38 PM GMT+02:00, Brian Topping <brian.topping@gmail.com> wrote:
On Apr 14, 2019, at 11:07 PM, Maria Matějka <jan.matejka@nic.cz> wrote:
And couldn't you just share what IDE you are trying to setup with BIRD and what exact problems you have? It should take me less time helping you setup BIRD in that specific IDE than merging CMake, not even counting your time needed for the rewrite.
Indeed, I was trying to avoid creating work for others. It’s with CLion. The problem is the symbol tracing and syntax highlighting, it’s clear that the headers and sources are not being read correctly. As I mentioned, I built the sources cleanly with Autotools and then imported the project. It generates CMakeLists.txt, but they are incorrect (even though this often works). I’m open to using other IDEs that work out of the box, I simply have a license for CLion.
Anyone can get a 30 day license for CLion when it opens, just download the enterprise version and use it. Also, open source contributors can get a free license that can only be used for open source projects.
I'll try it in several days, please kick me if I don't respond until Thursday.
What I'm trying to say – let's first try to find a quick and easy way to fix your problem before doing a project-wide change.
Yes, I agree that would be a more appropriate first step, much appreciated. I just typically assume the best way to get something done is to not expect someone to be there to help. So maybe I went too far with that this time :)
You didn't count the time needed to merge your change. :) Maria
On 4/15/19 3:17 PM, Maria Matějka wrote:
On April 15, 2019 3:03:38 PM GMT+02:00, Brian Topping <brian.topping@gmail.com> wrote:
On Apr 14, 2019, at 11:07 PM, Maria Matějka <jan.matejka@nic.cz> wrote:
And couldn't you just share what IDE you are trying to setup with BIRD and what exact problems you have? It should take me less time helping you setup BIRD in that specific IDE than merging CMake, not even counting your time needed for the rewrite.
Indeed, I was trying to avoid creating work for others. It’s with CLion. The problem is the symbol tracing and syntax highlighting, it’s clear that the headers and sources are not being read correctly. As I mentioned, I built the sources cleanly with Autotools and then imported the project. It generates CMakeLists.txt, but they are incorrect (even though this often works). I’m open to using other IDEs that work out of the box, I simply have a license for CLion.
Anyone can get a 30 day license for CLion when it opens, just download the enterprise version and use it. Also, open source contributors can get a free license that can only be used for open source projects.
I'll try it in several days, please kick me if I don't respond until Thursday.
Fine, I have checked it myself and I'm also probably unable to make it work correctly. What I have managed is to force CLion to run the makefile using the attached CMakeLists.txt file after running autoreconf -i && ./configure by hand As I'm not familiar with IDEs (too many options at once and no manpage), could you please check whether this may be a useful way? Maria
participants (6)
-
Brian Topping -
Maria Jan Matejka -
Maria Matějka -
Martin Mareš -
Matt Griswold -
Toke Høiland-Jørgensen