GNOME Bugzilla – Bug 566704
Better UI for environment variables
Last modified: 2011-09-11 13:27:54 UTC
Nor any other environment variable. Like CC, DISTCC_HOSTS, etc. All are quite important if you never want to leave your IDE. Perhaps make it possible in the dialog to start adding environment variables and their values? Note that I have files that contain my cflags for a given project. So I do things like: export CFLAGS=`cat ~/.code/cflags.tracker` EXPORT PKG_CONFIG_PATH=`cat ~/.code/pkg.tracker` ./autogen.sh --prefix=... For that reason would making back-ticks possible be nice :)
You can do this. Just enter "CFLAGS=..." in "Project->Configure" as options. Probably now great UI but it works and I would tell this an advanced feature.
Philip, is this OK for you? I don't think an UI for this is absolutely necessary.
Philip, I'm closing this as NOTABUG as per the last comment. Feel free to revert though.
(In reply to comment #1) > You can do this. Just enter "CFLAGS=..." in "Project->Configure" as options. > Probably now great UI but it works and I would tell this an advanced feature. (In reply to comment #2) > Philip, is this OK for you? I don't think an UI for this is absolutely > necessary. (In reply to comment #3) > Philip, I'm closing this as NOTABUG as per the last comment. Feel free to > revert though. I'm not really in agreement that such a often needed feature like CFLAGS and PKG_CONFIG_PATH doesn't need a UI. It feels a bit like MS's old Visual C++ UI then. And surely we can do better than that? I'd rather set this as a feature request than notabug. But I'll leave it in the hands of the Anjuta developers, what to do.
This is a difficult problem. When we make it to easy and obvious to set CFLAGS when configuring, people will add CFLAGS there instead of putting the right pkg-config macros in configure.ac. Currently, the UI allows it so set the most common CFLAGS using the combo box (namely, debug e.g. -O0 -g). I don't think setting other CFLAGS or setting other environment variables is often needed. Of course, for advanced people that build things using jhbuild or whatever it might be necessary and they can do it the same way they would on the command-line but I don't think it needs a special UI. But we might consider a small dialog that comes up when a "Set environment variables..."-button is clicked that allows you to set the variables in column view like this: CFLAGS | -O0 -g LDFLAGS | PKG_CONIFIG_PATH | /home/pvanhoof/jhbuild/share/pkg-config This would make it easier for people to set things when they know what they do.
(In reply to comment #5) > But we might consider a small dialog that comes up when a "Set environment > variables..."-button is clicked that allows you to set the variables in column > view like this: > > CFLAGS | -O0 -g > LDFLAGS | > PKG_CONIFIG_PATH | /home/pvanhoof/jhbuild/share/pkg-config > > This would make it easier for people to set things when they know what they do. This sounds perfect to me
Where do you want to add such button ? I have thought to add a environment list, like we already have in the run dialog, in the build preference.
The dialog should be in the "Configure project" dialog (where you can set DEBUG, etc.). The run dialog might another place where this might be useful though.
(In reply to comment #8) > The dialog should be in the "Configure project" dialog (where you can set > DEBUG, etc.). I'm not sure. You can already pass all flags you need as arguments of the configure script. Moreover, the configure dialog is not available if you have only a makefile. > The run dialog might another place where this might be useful though. It's already here.
> I'm not sure. You can already pass all flags you need as arguments of the > configure script. Moreover, the configure dialog is not available if you have > only a makefile. > But things like PKG_CONFIG_PATH are mostly interesting if you have configure. Currently, you can set these of course but it is a plain entry and a bit difficult to handle. See comment #5 for my proposal to improve that.
Do you think that adding the same thing than on the run dialog is fine? So an expander with environment variable, allowing add/change/remove environment variables? If something different is needed, while we are here, we can do it. Do you think I should use environment variable to pass CFLAGS, CXXFLAGS, JFLAGS and FFLAGS, instead of using the command line? My remark about makefile still stand. But the work of Lucas will probably need some additional widgets here too. Those widgets could be useful even with a make project. So, perhaps I can keep the configure step even with makefile project, if I'm using environment variable to pass argument like CFLAGS this makes sense even for a makefile project.
Hi! > Do you think that adding the same thing than on the run dialog is fine? > So an expander with environment variable, allowing add/change/remove > environment variables? I think that should be fine, at least I don't see why we would need something different here. > Do you think I should use environment variable to pass CFLAGS, CXXFLAGS, JFLAGS > and FFLAGS, instead of using the command line? Maybe my knowledge about the shell is a bit limited, but doesn't passing variables on the command-line just set environment variables for this single command? > My remark about makefile still stand. But the work of Lucas will probably need > some additional widgets here too. Those widgets could be useful even with a > make project. So, perhaps I can keep the configure step even with makefile > project, if I'm using environment variable to pass argument like CFLAGS this > makes sense even for a makefile project. I think we can invistigate this later as the makefile backend isn't our primary target.
(In reply to comment #12) > I think that should be fine, at least I don't see why we would need something > different here. Ok, I will try to do it. > > Do you think I should use environment variable to pass CFLAGS, CXXFLAGS, > > JFLAGS and FFLAGS, instead of using the command line? > Maybe my knowledge about the shell is a bit limited, but doesn't passing > variables on the command-line just set environment variables for this single > command? I think the shell doesn't do take arguments as environment variables. It is rather the configure script that it defining some arguments as environment variables.
I have added a new widget (the same one that is already existing in the program parameter dialog) in the configure dialog to allow changing environment variables. Thanks for your report.
*** Bug 567597 has been marked as a duplicate of this bug. ***