Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aur-build: ccache support #334

Closed
cyrinux opened this issue Mar 25, 2018 · 5 comments
Closed

aur-build: ccache support #334

cyrinux opened this issue Mar 25, 2018 · 5 comments
Labels
Milestone

Comments

@cyrinux
Copy link

cyrinux commented Mar 25, 2018

I'm not sure if ccache is supported.
I think from chroot build cache is lost?
Is it planned to support it?
https://wiki.archlinux.org/index.php/Ccache

Regards

@AladW
Copy link
Member

AladW commented Mar 25, 2018

https://wiki.archlinux.org/index.php/Ccache#makechrootpkg

Which brings us to more end-of-options abuse:

aur build -c -- -d /path/to/your/cachedir:/ccache -cu -- CCACHE_DIR=/path/to/your/cachedir

With aur-sync you'd use --bind but the CCACHE_DIR env isn't passed. The above command line depends on makepkg's ability to take environment variables from the command line, see https://git.archlinux.org/pacman.git/tree/scripts/makepkg.sh.in#n1287

@AladW AladW changed the title Is ccache supported? aur-build: ccache support Apr 22, 2018
@AladW
Copy link
Member

AladW commented Apr 22, 2018

#370 should cover this issue and #369

@AladW AladW closed this as completed Apr 22, 2018
@AladW AladW added feature and removed enhancement labels Apr 22, 2018
@AladW AladW added this to the 2.0.0 milestone Apr 22, 2018
@bartoszek
Copy link
Contributor

With aur-sync you'd use --bind

Won't work, as aur sync ... --bind=${ccache_dir} creates a read-only bind (perhaps add --bind-rw switch alongside --bind).

bartoszek pushed a commit to bartoszek/aurutils that referenced this issue Jul 18, 2018
AladW pushed a commit that referenced this issue Jul 19, 2018
* add bind-rw switch to aur-sync for ccache handling

address discrepancy in #334
@bartoszek
Copy link
Contributor

Here's my current invocation for ccache build with aurutils.

aur chroot -B -D /tmp/$(uname -m) -M /etc/makepkg.conf.ccache -d aur-local-repo; arch-nspawn /tmp/$(uname -m)/root pacman --noconfirm -S ccache; aur vercmp-devel|vipe|cut -d: -f1|aur sync -c -D /tmp/$(uname -m) -T --bind-rw=/home/_ccache:/build/.ccache --makepkg-conf=/etc/makepkg.conf.ccache --no-ver-shallow --no-view -; sudo rm -rf /tmp/x86_64/

One things i would consider to include in aurutils to make it nicer
⏫ detecting ccache/distcc in makepkag.conf@BUILDENV and insert those to deps.

  • Could be done in aur-sync with querying makepkg.conf and appending ccache to deps array
  • Alternatively could be included in aur-chroot by also querying makepkg.conf and appending cache to mkarchroot invocation.
  • Eventulay i could be added as extra ops to aur-sync, something like -(I)nstall: ${pkgname} for user to pass additional packages that is needed for build procedure.
  • Lastly, as most dirty/simplest resort: just append ccacke distcc to https://github.com/AladW/aurutils/blob/3e89f9eb829f6d031ab19d4b92054d7c89aed26b/lib/aur-chroot#L111

Btw. the last solution seems most resonable to me 😏

@AladW AladW reopened this Jul 20, 2018
@Earnestly
Copy link
Contributor

@bartoszek Since there already exists a fairly clean(?) way to arrange the command-line to do what you want, have you considered simply creating a little aur-foobar tool instead? Or even creating a personal shell function to avoid typing it all out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants