<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 9, 2013 at 1:43 PM, Dave Reisner <span dir="ltr"><<a href="mailto:d@falconindy.com" target="_blank">d@falconindy.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">On Fri, Aug 09, 2013 at 09:38:27AM +0200, Dominik Heidler wrote:<br>
> Users can set a ccache directory (which must be writeable by<br>
> the user nobody) to be mapped to /build/.ccache (which is the<br>
> directory, that ccache will use in the chroot)<br>
><br>
> Signed-off-by: Dominik Heidler <<a href="mailto:dheidler@gmail.com">dheidler@gmail.com</a>><br>
> ---<br>
<br>
</div>Looks fine, but I still have trouble grok'ing the usefulness of this. If<br>
you "import" the ccache directory, there's no telling what's in it --<br>
there might be object files compiled using CFLAGS incompatible with the<br>
final output (resulting in a package that won't necessarily work as you<br>
expect). For example, my local builds (not using devtools) add<br>
-march=native and (sometimes) -flto. Building with devtools, there's no<br>
way these should be added.<br>
<br>
Is ccache smart enough to recompile the .o files in this case?<br></blockquote><div> </div><div>According to the manpage, it is.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div class=""><div class="h5"><br>
>  <a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a> | 8 +++++++-<br>
>  1 file changed, 7 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/<a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a> b/<a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a><br>
> index 1cd08fb..7cf0031 100644<br>
> --- a/<a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a><br>
> +++ b/<a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a><br>
> @@ -21,6 +21,7 @@ run_namcap=false<br>
>  temp_chroot=false<br>
>  chrootdir=<br>
>  passeddir=<br>
> +ccachedir=<br>
>  declare -a install_pkgs<br>
>  declare -i ret=0<br>
><br>
> @@ -58,10 +59,11 @@ usage() {<br>
>       echo "           Default: $copy"<br>
>       echo '-n         Run namcap on the package'<br>
>       echo '-T         Build in a temporary directory'<br>
> +     echo '-C <dir>   The ccache directory to use'<br>
>       exit 1<br>
>  }<br>
><br>
> -while getopts 'hcur:I:l:nT' arg; do<br>
> +while getopts 'hcur:I:l:C:nT' arg; do<br>
>       case "$arg" in<br>
>               h) usage ;;<br>
>               c) clean_first=true ;;<br>
> @@ -71,6 +73,7 @@ while getopts 'hcur:I:l:nT' arg; do<br>
>               l) copy="$OPTARG" ;;<br>
>               n) run_namcap=true; makepkg_args="$makepkg_args -i" ;;<br>
>               T) temp_chroot=true; copy+="-$$" ;;<br>
> +             C) ccachedir="$OPTARG" ;;<br>
>               *) makepkg_args="$makepkg_args -$arg $OPTARG" ;;<br>
>       esac<br>
>  done<br>
> @@ -84,6 +87,8 @@ chrootdir=$(readlink -e "$passeddir")<br>
>  [[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir"<br>
>  [[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir"<br>
><br>
> +[[ -n $ccachedir && ! -d $ccachedir ]] && die "Invalid path '%s' given for ccache directory" "$ccachedir"<br>
> +<br>
>  # Detect chrootdir filesystem type<br>
>  chroottype=$(stat -f -c %T "$chrootdir")<br>
><br>
> @@ -349,6 +354,7 @@ download_sources<br>
>  if arch-nspawn "$copydir" \<br>
>       --bind-ro="$PWD:/startdir_host" \<br>
>       --bind-ro="$SRCDEST:/srcdest_host" \<br>
> +     ${ccachedir:+"--bind=$ccachedir:/build/.ccache"} \<br>
>       /chrootbuild<br>
>  then<br>
>       move_products<br>
> --<br>
> 1.8.3.4<br>
><br>
</div></div></blockquote></div><br></div></div>