# ccache after pkg2ng



## Martillo1 (Sep 1, 2012)

Well, it seems that, at least for me, devel/ccache does not work for ports after changing to ports-mgmt/pkg. I use ports-mgmt/portupgrade-devel

It works for world.


----------



## kpa (Sep 1, 2012)

Where does it fail when compiling a port with ccache(1)? Or is just not used? PKGNG has no effect on the build process itself, only on the packaging stage. Verify that the ports build or ccache works without package registration by installing them with NO_PACKAGE_REGISTER variable set (will leave orphaned files, install something very small that is easy to clean up).


----------



## Martillo1 (Sep 1, 2012)

`# cd /usr/ports/x11-wm/fvwm2 && make`

It does not modify ccache stats.

If I remove the line WITH_PKGNG=yes from /etc/make.conf it does not change the stats either.

`# cd /usr/ports/sysutils/lsof && make install NO_PACKAGE_REGISTER="YES"`

Same result.


----------



## kpa (Sep 1, 2012)

It doesn't look like PKGNG is the problem.

There's a better and more reliable way to use ccache(1) with port builds. Update your ports tree and set this variable in /etc/make.conf:


```
WITH_CCACHE_BUILD="yes"
```

That should make the ports builds use ccache(1) without any need to set other variables or modifying PATH.

This is a new feature that was available as an experimental patch for a short while and it's now imported to SVN.


----------



## Martillo1 (Sep 1, 2012)

It works, thanks


----------

