Thanks to all for the comments/suggestions so far.
To be sure that I have been clear, when I talk about the Geany build system I am only talking about the ability of Geany to invoke builders, not the system used to build Geany and nor am I talking about incorporating any specific system into Geany nor about incorporating specific support for any system(s) into Geany, just general support for any command that can be run. As Enrico said, simple is better.
Our approach to build tools is that they vary in performance, capabilities and system requirements and individual projects make their decisions based on technical, practical and philosophical grounds. When we then use their pachage we arn't going to change the build system since we would have to re-do it each time a new release happened. So we end up using lots of different systems.
On a specific note, the developer who told me about the -o simply stopped using the facility when he had problems, and so didn't notice it had been fixed. He has been sent to read the release notes 50 times ;-).
Having now had a chance to read the code and talk to my developers some more, I am in a better position to discuss how the system currently works and how we might like it to work.
To ensure I understand it, the current system works as:
1. Compile, build and run are filetype specific and get their command from the filetype config (question what is runcmd2 config for?) 2. Make all. Make Object and Make custom are not file specific but add different targets to the make command stored in preferences or default a. since Make Object needs to find a target name it uses the current file name + '.o' (seems to be hard coded irrespective of platform) b. 'all' is hard coded c. custom reads from a dialog 3. %e and %f are substituted in the build command 4. directory to run the resulting command is project file directory or source file directory depending on preference 5. output is parsed for errors based on filetype, not sure how it works if there are mixed languages or compiler types, which filetype does it use? 6. output is parsed for "Entering directory" messages to find the source file with errors (since the error message doesn't have the full path and the same filename could occur be in several directories)
The problems with this system are: 1. potential confusion from two ways of building without it being obvious that this is the case 2. make command taken from the preferences means the user has to change the commands when moving from software with on one system to software with another 3. there are a couple of hard coded pieces
The solution to 2. and 3. is to store everything make related with the source tree, not with the preferences, and the suggested place to store it is the project file.
In terms of the compile command, it *may* be useful for a quick syntax check but since the user would have to remember what options and symbols need defining, it could be risky, and I certainly would not use the result of such a compile, and the object file would have to be removed so that the builder would re-build the file properly. All in all I see small gain but lots of potential for pain and would agree with Enrico that it may be best to remove the compile command. (however see my second thoughts later)
I suggest the following changes for the three 'make' commands:
1. to keep the menu size the same and so not have to fiddle with the latex stuff that replaces the build menu, add a fourth 'make' command to replace the compile command, longer term the latex stuff should be in its own menu 2. each of the four 'make' commands should have its own menu label and complete command string stored in the project file 3. one of the 'make' commands should retain the behavior of asking with a dialog for targets/options to be added to the command stored in the project file
This system has several advantages:
1. it looks relatively simple to implement 2. if can be set up to work exactly as now (well, except for no compile and an extra make) 3. it gains a degree of platform independence, eg 'make object' could have the command 'make %e.o' on unix or 'nmake %e.obj' on windows, and those of us using both targets just have two project files: 'my_proj_win.geany' and 'my_proj_lin.geany' with the appropriate settings. Note it makes the target platform independent of the platform geany is running on, without complicating geany's life. 4. by having variable menu item names we remove the need to remember that, in the 'newt_adventures' project, the 'make all' menu actually means 'jabberwok the gingrich' This is why I think that this is something that goes in the base product not in a plugin, from what I can see plugins can't modify these menus.
Variable numbers of commands and submenus I'd postpone until later, if at all, and agree with Nick that project type templates are plugin territory, anyone out there want to code one.
That just leaves the file type specific build and run commands to consider.
The file type dependent behavior is correct for single file type systems where there is no build system.
However consider developing a 'c' extension to python, the compile/build should indeed be dependent on the c file open for editing, but the run command is the python script that imports and tests my c extension, and that command should not be stored against the c file type. This potential conflict exists for any mixed language system. (No I wouldn't remember to switch to the python file before running)
Also consider the behavior of the build menu item in the presence of a build system, either the menu item does something independent of the build system :-( or it invokes the build system, in which case it should be project dependent not file dependent for all the reasons outlined above.
You will note that the problems develop in a project specific context, so I propose a solution in that context, if a build and run command is present in the project file then that command takes precedence over the filetype specific commands. In fact based on this solution I may even go back on my previous thought and might allow a simple compile command again for syntax check, especially if it didn't actually save its output file or did a lint or similar ;-).
For completeness the "entering directory" string should be made configurable, again just put it in the project file.
The only other code needed would be a tab in the preferences for these project specific commands and settings, but as the tab is fixed layout it should be easy to do with glade.
And then the documentation needs to be updated to explain the operation of the system, it is simple, can have defaults so simple systems work out of the box, but is not obvious without some explanation.
Finally one other suggestion, while looking for where the filetype specific commands are set, I had to look in the code because the menu "set includes and arguments" was not obvious, perhaps it should be changed to "set build & run commands" or something similar.
Best Regards Lex
On Fri, 3 Oct 2008 17:32:26 +1000 "Lex Trotman" elextr@gmail.com wrote:
- Compile, build and run are filetype specific and get their command
from the filetype config (question what is runcmd2 config for?)
It's only used for the LaTeX filetype so you can view a .dvi and view .pdf files.
- Make all. Make Object and Make custom are not file specific but add
different targets to the make command stored in preferences or default a. since Make Object needs to find a target name it uses the current file name + '.o' (seems to be hard coded irrespective of platform) b. 'all' is hard coded
I know some windows compilers use .obj, but as you said it's currently hard coded. Also perhaps 'make' would be a more flexible default than 'make all'.
c. custom reads from a dialog
- %e and %f are substituted in the build command
- directory to run the resulting command is project file directory or
source file directory depending on preference 5. output is parsed for errors based on filetype, not sure how it works if there are mixed languages or compiler types, which filetype does it use?
Yes, I recently added support for a custom error regex per filetype. But you're right that for projects there should be a way to tell Geany what filetype is in use.
It defaults to a GNU-style error, "filename:line: message".
- output is parsed for "Entering directory" messages to find the
source file with errors (since the error message doesn't have the full path and the same filename could occur be in several directories)
Yes, I guess ideally this would be a configurable regex also (unlikely to be standard, even for Make implementations).
The problems with this system are:
- potential confusion from two ways of building without it being
obvious that this is the case 2. make command taken from the preferences means the user has to change the commands when moving from software with on one system to software with another 3. there are a couple of hard coded pieces
The solution to 2. and 3. is to store everything make related with the source tree, not with the preferences, and the suggested place to store it is the project file.
Yes.
...
I suggest the following changes for the three 'make' commands:
- to keep the menu size the same and so not have to fiddle with the
latex stuff that replaces the build menu, add a fourth 'make' command to replace the compile command, longer term the latex stuff should be in its own menu
We want to 'standardize' the latex commands and only have one build menu. The 'Make Object' command is like a compile command, not sure how a fourth make command would change this.
Variable numbers of commands and submenus I'd postpone until later,
Well, each of the commands is essentially the same to Geany, substitute some wildcards and execute the command. Maybe a variable list of commands would be worth implementing, with usable defaults.
The submenus for the make custom command could well be postponed.
...
That just leaves the file type specific build and run commands to consider.
The file type dependent behavior is correct for single file type systems where there is no build system.
However consider developing a 'c' extension to python, the compile/build should indeed be dependent on the c file open for editing, but the run command is the python script that imports and tests my c extension, and that command should not be stored against the c file type. This potential conflict exists for any mixed language system. (No I wouldn't remember to switch to the python file before running)
So have user-configurable per-filetype commands, in this case 'Test Python Module' as a C build command.
Also consider the behavior of the build menu item in the presence of a build system, either the menu item does something independent of the build system :-( or it invokes the build system, in which case it should be project dependent not file dependent for all the reasons outlined above.
Geany has to be usable without projects. Some users don't like them and they can get in the way for single files.
... I think broadly I agree with these ideas, thanks for taking the time to look at this. These changes will be quite substantial, I guess they could be done in an SVN branch.
Finally one other suggestion, while looking for where the filetype specific commands are set, I had to look in the code because the menu "set includes and arguments" was not obvious, perhaps it should be changed to "set build & run commands" or something similar.
Yes, something like "Configure Commands".
Regards, Nick
On Fri, 3 Oct 2008 15:40:23 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Fri, 3 Oct 2008 17:32:26 +1000 "Lex Trotman" elextr@gmail.com wrote:
- Compile, build and run are filetype specific and get their
command from the filetype config (question what is runcmd2 config for?)
It's only used for the LaTeX filetype so you can view a .dvi and view .pdf files.
And should be removed sometime in the future... Bad enough I actually introduced these, we really should remove them. Probably Frank and other LaTeX users will complain but we already have a GeanyLatex plugin which could replace some of the functionality to remove. But that's another topic.
- Make all. Make Object and Make custom are not file specific but
add different targets to the make command stored in preferences or default a. since Make Object needs to find a target name it uses the current file name + '.o' (seems to be hard coded irrespective of platform) b. 'all' is hard coded
I know some windows compilers use .obj, but as you said it's currently hard coded. Also perhaps 'make' would be a more flexible default than 'make all'.
Long time ago, something about 3 years, I thought the default target when executing only 'make' was the target 'all', so I added the menu item 'Make all' for convenience. But obviously this was wrong. The default target is the first one found in the Makefile. I wanted to change the hardcoded 'make all' for the last two years but I never ever got to it :(. And since we already announced the string freeze for Geany 0.15, it has to wait again (or replaced by configurable commands or whatever).
That just leaves the file type specific build and run commands to consider.
The file type dependent behavior is correct for single file type systems where there is no build system.
However consider developing a 'c' extension to python, the compile/build should indeed be dependent on the c file open for editing, but the run command is the python script that imports and tests my c extension, and that command should not be stored against the c file type. This potential conflict exists for any mixed language system. (No I wouldn't remember to switch to the python file before running)
But this is not what the Build system was designed for. It should provide an easy and basic way to compile/build files, mainly for testing purposes while developing (simple) code.
Your test case is something more advanced, IMO.
Nevertheless, things can be improved but in any way, I want to keep a subset of the current functionality which enables users to quickly compile and test short pieces of code.
... I think broadly I agree with these ideas, thanks for taking the time to look at this. These changes will be quite substantial, I guess they could be done in an SVN branch.
Finally one other suggestion, while looking for where the filetype specific commands are set, I had to look in the code because the menu "set includes and arguments" was not obvious, perhaps it should be changed to "set build & run commands" or something similar.
Yes, something like "Configure Commands".
Let's change this after 0.15, translators probably won't like it to see changed strings again :).
Regards, Enrico
On Mon, Oct 6, 2008 at 11:57 PM, Enrico Tröger enrico.troeger@uvena.dewrote:
On Fri, 3 Oct 2008 15:40:23 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Fri, 3 Oct 2008 17:32:26 +1000 "Lex Trotman" elextr@gmail.com wrote:
- Compile, build and run are filetype specific and get their
command from the filetype config (question what is runcmd2 config for?)
It's only used for the LaTeX filetype so you can view a .dvi and view .pdf files.
And should be removed sometime in the future... Bad enough I actually introduced these, we really should remove them. Probably Frank and other LaTeX users will complain but we already have a GeanyLatex plugin which could replace some of the functionality to remove. But that's another topic.
I was looking to keep the changes small enough that I can help with implementation, so I didn't (and still don't) want to touch that bit.
- Make all. Make Object and Make custom are not file specific but
add different targets to the make command stored in preferences or default a. since Make Object needs to find a target name it uses the current file name + '.o' (seems to be hard coded irrespective of platform) b. 'all' is hard coded
I know some windows compilers use .obj, but as you said it's currently hard coded. Also perhaps 'make' would be a more flexible default than 'make all'.
Long time ago, something about 3 years, I thought the default target when executing only 'make' was the target 'all', so I added the menu item 'Make all' for convenience. But obviously this was wrong. The default target is the first one found in the Makefile. I wanted to change the hardcoded 'make all' for the last two years but I never ever got to it :(. And since we already announced the string freeze for Geany 0.15, it has to wait again (or replaced by configurable commands or whatever).
These modifications need some time to sort out the best solution and to code so I wouldn't suggest quickly forcing changes into the 0.15 release. What I will do over the next few days is to write a proposed Build System section for the manual which can be discussed, agreed and act as a specification.
That just leaves the file type specific build and run commands to consider.
The file type dependent behavior is correct for single file type systems where there is no build system.
However consider developing a 'c' extension to python, the compile/build should indeed be dependent on the c file open for editing, but the run command is the python script that imports and tests my c extension, and that command should not be stored against the c file type. This potential conflict exists for any mixed language system. (No I wouldn't remember to switch to the python file before running)
But this is not what the Build system was designed for. It should provide an easy and basic way to compile/build files, mainly for testing purposes while developing (simple) code.
Your test case is something more advanced, IMO.
But the problem is that I still have to invoke the builder from Geany, or I lose the ability to have Geany parse the compile output and jump to the source file where the error occurred. It is easy to invoke a builder in another xterm, but then I have to manually deduce the compile error locations, a loss of functionality for bigger systems just when it is needed :-(.
Although Geany is small and lightweight, that shouldn't stop it being used on big programs. In fact to give an an unsolicited complement, it is the very lightness and flexibility of Geany that make it usable in these situations. Other IDEs such as Anjuta and Kdevelop may provide more support in some areas but are too tightly tied to their way of doing things, making it difficult to support other tools and especially to support cross platform development unless you do it their way. In fact Kdevelop 3 can't even configure the make command, their solution is to write a makefile calling the other builder, but just try to get that to pass targets and options from the command line to the other builder!! So the intention is to allow Geany to be used with our big/complex/different applications while not imposing any restrictions on simple uses. A large/complex project can afford to spend time configuring commands and projects but sane usefull defaults should be available out of the box for simple uses. UMMM I'll climb down off my soap box now :-).
Please note I'm not intending to criticise past design decisions, all tools evolve over time to address more and different uses, and no one can forsee where future evolution will go.
Nevertheless, things can be improved but in any way, I want to keep a subset of the current functionality which enables users to quickly compile and test short pieces of code.
The intention is that the default configurations should do just that, after all, I also use it for simple programs as well ;-).
... I think broadly I agree with these ideas, thanks for taking the time to look at this. These changes will be quite substantial, I guess they could be done in an SVN branch.
Finally one other suggestion, while looking for where the filetype specific commands are set, I had to look in the code because the menu "set includes and arguments" was not obvious, perhaps it should be changed to "set build & run commands" or something similar.
Yes, something like "Configure Commands".
Let's change this after 0.15, translators probably won't like it to see changed strings again :).
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Cheers Lex
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
configurable commands or whatever).
These modifications need some time to sort out the best solution and to code so I wouldn't suggest quickly forcing changes into the 0.15 release. What I will do over the next few days is to write a proposed Build System section for the manual which can be discussed, agreed and act as a specification.
As promised, attached is a Geany.html with my first cut at documenting the proposed changes to the build system. To help you find the changes which are in several places I have attached an OpenOffice document version of the geany.txt file with changes marked using writers change marking facility. You may want to mark this up further with your comments so we can keep track.
Hope this helps define the best way forward.
Cheers Lex
On Thu, 9 Oct 2008 15:35:12 +1100 "Lex Trotman" elextr@gmail.com wrote:
These modifications need some time to sort out the best solution and to code so I wouldn't suggest quickly forcing changes into the 0.15 release.
We're discussing how to manage the proposed changes, and it's likely that we'll give you SVN write access so you can start working in a branch. Does this sound OK? We'll need a sf.net username.
What I will do over the next few days is to write a proposed Build System section for the manual which can be discussed, agreed and act as a specification.
As promised, attached is a Geany.html with my first cut at documenting the proposed changes to the build system. To help you find the changes which are in several places I have attached an OpenOffice document version of the geany.txt file with changes marked using writers change marking facility. You may want to mark this up further with your comments so we can keep track.
Maybe it's just me but working through OpenOffice is not a good option. OpenOffice is a big suite of software and many people using and developing Geany don't have it installed. For discussing changes I would prefer we did it on the ML.
Could you send the geany.txt file so I can diff it?
Regards, Nick
On Thu, Oct 9, 2008 at 10:24 PM, Nick Treleaven < nick.treleaven@btinternet.com> wrote:
On Thu, 9 Oct 2008 15:35:12 +1100 "Lex Trotman" elextr@gmail.com wrote:
These modifications need some time to sort out the best solution and to code so I wouldn't suggest quickly forcing changes into the 0.15 release.
We're discussing how to manage the proposed changes, and it's likely that we'll give you SVN write access so you can start working in a branch. Does this sound OK? We'll need a sf.net username.
That sounds ok (as soon as our system administrators can find why the firewall doesn't like SVN (or git)). For the attached I started with a geany.txt from a tarball I got a couple of days ago.
What I will do over the next few days is to write a proposed Build System section for the manual which can be discussed, agreed and act as a specification.
As promised, attached is a Geany.html with my first cut at documenting the proposed changes to the build system. To help you find the changes which are in several places I have attached an OpenOffice document version of the geany.txt file with changes marked using writers change marking facility. You may want to mark this up further with your comments so we can keep track.
Maybe it's just me but working through OpenOffice is not a good option. OpenOffice is a big suite of software and many people using and developing Geany don't have it installed. For discussing changes I would prefer we did it on the ML.
Could you send the geany.txt file so I can diff it?
Ok,I was just looking for a way of making changes visible easily, personally I have trouble reading diffs of any substantial size. No problem, we can each use our own method for finding the changes and exchange the .txt file, attached. Once we get over the hurdle of this first set of changes we can also discuss individual items in the ML without the whole .txt file but the initial changes were IMO too big to just put the diffs here.
Regards Lex
Regards, Nick _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On Thu, 9 Oct 2008 23:43:16 +1100, "Lex Trotman" elextr@gmail.com wrote:
What I will do over the next few days is to write a proposed Build System section for the manual which can be discussed, agreed and act as a specification.
As promised, attached is a Geany.html with my first cut at documenting the proposed changes to the build system. To help you find the changes which are in several places I have attached an OpenOffice document version of the geany.txt file with changes marked using writers change marking facility. You may want to mark this up further with your comments so we can keep track.
Maybe it's just me but working through OpenOffice is not a good option. OpenOffice is a big suite of software and many people using
Full ACK.
and developing Geany don't have it installed. For discussing changes I would prefer we did it on the ML.
Could you send the geany.txt file so I can diff it?
Ok,I was just looking for a way of making changes visible easily, personally I have trouble reading diffs of any substantial size.
It's just a matter of training :).
No problem, we can each use our own method for finding the changes and exchange the .txt file, attached. Once we get over the hurdle of this first set of changes we can also discuss individual items in the ML without the whole .txt file but the initial changes were IMO too big to just put the diffs here.
And what about moving this discussion to geany-devel?
Regards, Enrico
2008/10/9 Enrico Tröger enrico.troeger@uvena.de
On Thu, 9 Oct 2008 23:43:16 +1100, "Lex Trotman" elextr@gmail.com wrote:
What I will do over the next few days is to write a proposed Build System section for the manual which can be discussed, agreed and act as a specification.
As promised, attached is a Geany.html with my first cut at documenting the proposed changes to the build system. To help you find the changes which are in several places I have attached an OpenOffice document version of the geany.txt file with changes marked using writers change marking facility. You may want to mark this up further with your comments so we can keep track.
Maybe it's just me but working through OpenOffice is not a good option. OpenOffice is a big suite of software and many people using
Full ACK.
and developing Geany don't have it installed. For discussing changes I would prefer we did it on the ML.
Could you send the geany.txt file so I can diff it?
Ok,I was just looking for a way of making changes visible easily, personally I have trouble reading diffs of any substantial size.
It's just a matter of training :).
Well ummm, since I havn't learned it after 30+ years software development I figured my brain isn't wired that way & went looking for tools to support me (novel thought, computers helping people ;-)
No problem, we can each use our own method for finding the changes and exchange the .txt file, attached. Once we get over the hurdle of this first set of changes we can also discuss individual items in the ML without the whole .txt file but the initial changes were IMO too big to just put the diffs here.
And what about moving this discussion to geany-devel?
Ok, subscribed, looking forward to comments on the doc.
My sf.net username is elextr
Regards Lex
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany