Summary: | bsd.gcc.mk: Fixing dependency not to pick ccache stubs | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Akinori MUSHA <knu> | ||||
Component: | Individual Port(s) | Assignee: | Gerald Pfeifer <gerald> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | ||||||
Priority: | Normal | ||||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Akinori MUSHA
![]() ![]() Responsible Changed From-To: freebsd-ports-bugs->gerald bsd.gcc.mk is gerald territory (via the GNATS Auto Assign Tool) Responsible Changed From-To: gerald->ehaupt Thanks for the fine analysis and the patch. I thought about this thrice now, and something has been making me feel uneasy about the suggested change which I finally managed to nail down now. Basically my concern is that we "lie" to the system and the patch only works around that. Rather than going this direction, and breaking cases where someone has installed a version of GCC (or CLang) in some different location, but with the right name, can we tighten up ccache? What I have in mind is this: 1. During installation, ccache only creates those links for executables it actually finds on the system. 2. It does so via a script that the user can manually invoke at any time in case she makes changes to the system. For extra bonus points: 3. This script, if present, is also called by the post-install and post-deinstall targets of the lang/gcc* ports. Gerald, I like the idea. I'll follow up a patch for ccache within a few hours. The following patch implements the idea gerald suggested: http://people.freebsd.org/~ehaupt/misc/ccache.diff The script 'ccache-update-links' is executed when the port is installed. If a user installs an additional compiler after the installation of ccache he can simply run the script manually. Another possibilty would be a hook in ports/Mk/bsd.gcc.mk that will run the script if ccache is installed. Feedback would be gratefully apreciated. Emanuel On Mon, 28 Mar 2011, Emanuel Haupt wrote: > The following patch implements the idea gerald suggested: > > http://people.freebsd.org/~ehaupt/misc/ccache.diff Nice! I love it. > Feedback would be gratefully apreciated. In the messages I think "Creating" and "Removing" are more customary for a script to describe its ongoing actions. Perhaps the -h option of the script could print a line or two of what it's doing? Is this really sbin material, or just bin? I'll readily admit I wouldn't know. Do you want to consult $LOCALBASE in addition to $PREFIX (and the hardcoded /usr/bin)? Right now it seems the link is always created to $PREFIX/bin, even if the desired executable may have been found under /usr/bin, or am I reading this incorrectly? And I will confess that I don't really understand that world thingie. :-) Thanks for jumping on this so readily (and quickly, even)! Gerald > In the messages I think "Creating" and "Removing" are more customary > for a script to describe its ongoing actions. Corrected. > Perhaps the -h option of the script could print a line or two of > what it's doing? Also corrected. > Is this really sbin material, or just bin? I'll readily admit I > wouldn't know. Good point. I moved it to bin. > Do you want to consult $LOCALBASE in addition to $PREFIX (and the > hardcoded /usr/bin)? I don't know, all the ports compiler seem to get installed to $PREFIX the hardcoded /usb/bin is for the base compiler. > Right now it seems the link is always created to $PREFIX/bin, even > if the desired executable may have been found under /usr/bin, or am > I reading this incorrectly? The links always point to 'ccache': # ls -laR /usr/local/libexec/ccache total 6 drwxr-xr-x 3 root wheel 512 Mar 29 14:27 . drwxr-xr-x 5 root wheel 512 Mar 29 14:27 .. lrwxr-xr-x 1 root wheel 21 Mar 29 14:27 c++ -> /usr/local/bin/ccache lrwxr-xr-x 1 root wheel 21 Mar 29 14:27 cc -> /usr/local/bin/ccache lrwxr-xr-x 1 root wheel 21 Mar 29 14:27 g++ -> /usr/local/bin/ccache lrwxr-xr-x 1 root wheel 21 Mar 29 14:27 g++34 -> /usr/local/bin/ccache lrwxr-xr-x 1 root wheel 21 Mar 29 14:27 gcc -> /usr/local/bin/ccache lrwxr-xr-x 1 root wheel 21 Mar 29 14:27 gcc34 -> /usr/local/bin/ccache drwxr-xr-x 2 root wheel 512 Mar 29 14:27 world /usr/local/libexec/ccache/world: total 6 drwxr-xr-x 2 root wheel 512 Mar 29 14:27 . drwxr-xr-x 3 root wheel 512 Mar 29 14:27 .. lrwxr-xr-x 1 root wheel 6 Mar 29 14:27 c++ -> ccache lrwxr-xr-x 1 root wheel 6 Mar 29 14:27 cc -> ccache -r-xr-xr-x 1 root wheel 257 Mar 29 14:27 ccache lrwxr-xr-x 1 root wheel 6 Mar 29 14:27 g++ -> ccache lrwxr-xr-x 1 root wheel 6 Mar 29 14:27 g++34 -> ccache lrwxr-xr-x 1 root wheel 6 Mar 29 14:27 gcc -> ccache lrwxr-xr-x 1 root wheel 6 Mar 29 14:27 gcc34 -> ccache > And I will confess that I don't really understand that world > thingie. :-) The whole 'world' thingie was introduced with: http://www.freebsd.org/cgi/query-pr.cgi?pr=155008 Discussion on ports: http://www.mail-archive.com/freebsd-ports@freebsd.org/msg31095.html For now I'll commit the patch. Thanks for the ideas and the feedback. Emanuel ehaupt 2011-03-29 14:15:03 UTC FreeBSD ports repository Modified files: devel/ccache Makefile devel/ccache/files ccache-howto-freebsd.txt.in pkg-message.in Added files: devel/ccache/files ccache-update-links.sh.in Log: Only create symlinks for existing compiler. This functionality is outsourced into a script which can be run manually after installing or deinstalling additional compiler. PR: 155568 (based on) Revision Changes Path 1.60 +16 -44 ports/devel/ccache/Makefile 1.15 +3 -5 ports/devel/ccache/files/ccache-howto-freebsd.txt.in 1.1 +56 -0 ports/devel/ccache/files/ccache-update-links.sh.in (new) 1.5 +1 -1 ports/devel/ccache/files/pkg-message.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" Responsible Changed From-To: ehaupt->gerald Back to gerald, feel free to implement additional Mk hooks. gerald 2011-09-10 13:36:48 UTC FreeBSD ports repository Modified files: lang/gcc46 pkg-plist Log: Also update ccache links (when appropriate) in case of package installation and deinstallation. My code for handling the port installation case sneaked in via the previous commit. PR: 155568 Submitted by: ehaupt Revision Changes Path 1.114 +3 -1 ports/lang/gcc46/pkg-plist _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" State Changed From-To: open->closed Last piece to address this applied to lang/gcc46 in addition to earlier adjustments to ccache. lang/gcc47 shall follow, the other lang/gcc ports are in the process of being more and more deemphasized. gerald 2011-09-10 20:03:45 UTC FreeBSD ports repository Modified files: lang/gcc47 Makefile distinfo pkg-plist Log: Update to the 20110903 snapshot of GCC 4.7. On the way update ccache links (when appropriate) when installing and deinstalling this port/package. [1] PR: 155568 [1] Submitted by: ehaupt [1] Revision Changes Path 1.503 +4 -1 ports/lang/gcc47/Makefile 1.368 +2 -2 ports/lang/gcc47/distinfo 1.115 +3 -1 ports/lang/gcc47/pkg-plist _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" |