colorgcc should replace default gcc

Bug #30734 reported by Manuel López-Ibáñez
54
This bug affects 10 people
Affects Status Importance Assigned to Milestone
colorgcc (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

colorgcc should replace default gcc, so when I call gcc the output is colorised (otherwise which was my intention when I installed the package).

Currently, it is neccesary to call colorgcc directly. Also, it doesn't work if gcc is symlinked to colorgcc.

This Just Works (TM) in Mandriva 2006. I think they use /etc/alternatives.

Revision history for this message
Barry deFreese (bddebian) wrote :

Thanks for your suggestion. The changes you are requesting require more discussion, which should be done on an appropriate mailing list or forum. <http://www.ubuntu.com/community/forums/> might be a good start.

Changed in colorgcc:
status: Unconfirmed → Rejected
Revision history for this message
Guillaume Desmottes (cassidy) wrote :

I reopen this bug as I don't see the point to discuss about a RFE on forums instead of on our bug tracker.

Changed in colorgcc:
status: Invalid → New
Revision history for this message
ironstorm (ironstorm-gmail) wrote :

I agree with this RFE, I installed colorgcc in the hopes it would colourize my gcc output.

Just installing it doesn't appear to be enough

So far I'm trying:
alias gcc='colorgcc'
export CC="gcc"

I'm not sure if this is the "right" way to go though...

Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote :

The right way is for colorgcc to use the alternatives system in the same way that other packages do (for example gs, gs-eps, gs-gpl, etc, or the very same gcc-4.1, gcc-3.4, etc).

This way, colorgcc gets installed as an alternative of gcc with higher priority. Then, colorgcc itself needs to be configured to find the actual gcc (which will probably be the second highest priority alternative to gcc).

Revision history for this message
Aleksander Morgado (aleksander-m) wrote :

I also agree with the proposed change here.

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

this is wishlist, confirmed

Changed in colorgcc (Ubuntu):
importance: Low → Wishlist
status: New → Confirmed
Revision history for this message
Dimitrios Symeonidis (azimout) wrote :
Revision history for this message
kit (kitrule) wrote :

I find the instructions at http://blog.emptycrate.com/node/429 work fine. Specifically issuing the following commands manually once after installation. The fact these sym-links aren't automatically created during installation seems, to me, a defect in the installation package which could easily be fixed.

sudo ln -s /usr/bin/colorgcc /usr/local/bin/gcc
sudo ln -s /usr/bin/colorgcc /usr/local/bin/g++
sudo ln -s /usr/bin/colorgcc /usr/local/bin/cc
sudo ln -s /usr/bin/colorgcc /usr/local/bin/c++

or when run with root privileges during installation, the following single line would accomplish the same thing.

ln -s /usr/bin/colorgcc /usr/local/bin/gcc; ln -s /usr/bin/colorgcc /usr/local/bin/g++; ln -s /usr/bin/colorgcc /usr/local/bin/cc; ln -s /usr/bin/colorgcc /usr/local/bin/c++

Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote :

Debian/Ubuntu have a system to handle alternatives for programs. In any case, parsing the output of gcc is prone to errors. It would be better if gcc implemented colors

Revision history for this message
kit (kitrule) wrote :

To clarify, colorgcc is just a wrapper for the real gcc, etc. The above symlinks in /usr/local/bin/* are found before the real gcc, etc. in /usr/bin/* (owing to the default path variable - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games). The title and description of this bug should be ammended.

If my previous suggestion can be integrated in to the repository package, the sym-links should automatically get removed during uninstallation so that when the path is traversed to execute gcc, etc. the original ones are then found.

Revision history for this message
kit (kitrule) wrote :

Ah ok, sorry. I didn't refresh the page before my last message and missed what you said about the debian/ubuntu alternatives system. It would be nice if the gcc system implemented colors and I don't know much about the alternatives system. I'll read about the alternatives system and see if the colour functionality can just be patched directly in to gcc. Thanks for your quick reply.

Revision history for this message
Pander (pander) wrote :

As most of what is seen in the terminal is colored (ls, vim, etc.) by default gcc's output may also be in color.

Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote :

#11

The current maintainers of GCC have already said that they do not want to implement color output in GCC.

http://gcc.gnu.org/PR45850

http://gcc.gnu.org/PR36150

I have a preliminary patch, so if Ubuntu would be willing to carry the patch, I would finish it. However, most distributions are very conservative about patching GCC.

Revision history for this message
Pander (pander) wrote :

Addition to #12: I'm referring to gcc as it gets shipped by Ubuntu.

Revision history for this message
Amir Taaki (genjix) wrote :

I agree. Please make colorgcc the default. Most of the development tools like git, Python or whatever have colourised output nowadays. It's ludicrous that gcc is stuck in the past - especially with such huge output that often spans 2 pages worth of template errors.

Pander (pander)
tags: added: 12.10
Pander (pander)
tags: added: development
tags: added: color
Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote :

GCC 4.9 supports colors out of the box, thus the current colorgcc is not needed anymore.

Ubuntu should just enable GCC colors by default. See https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1324901 for a possible way to do this.

Changed in colorgcc (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.