I need to use gcc-5 and g+±5 so I have the following circle.yml file which installs them and uses update-alternatives to make them the default version:
dependencies:
pre:
- sudo apt-get update; sudo apt-get install gcc-5; sudo apt-get install g+±5
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g+±5 100
test:
pre:
- gcc --version
- g++ --version
- make
post:
- ./helloworld
This works well, but it takes about 50 seconds to install gcc-5 and g++5 .
Is there a way to cache them so they don’t have to be manually installed each build?
4 Likes
levlaz
November 18, 2015, 12:57am
2
Hello!
Unfortunately there is no good way to currently cache anything installed with apt. If you would like to see this as a feature I would encourage you to make this a feature request .
mochja
December 1, 2015, 7:35am
3
I use “simple way” to achieve this.
Just find correspondent .deb packages, download, cache, and install them in post dependencies task with dpkg.
Below is simple circle.yml
to demostrate
dependencies:
override:
- /bin/true
cache_directories:
- "~/.local"
pre:
- >-
if [[ ! -d "$HOME/.local/debs" ]]; then \
mkdir -p "$HOME/.local/debs"; cd "$HOME/.local/debs" \
&& curl -LOs http://launchpadlibrarian.net/198723929/libc6-dbg_2.19-0ubuntu6.6_amd64.deb \
; fi
post:
- sudo dpkg -i $HOME/.local/debs/libc6-dbg_2.19-0ubuntu6.6_amd64.deb
3 Likes
Eric
July 1, 2016, 11:46am
4
For anyone who’s doing this, you can use apt-get download <library>
instead of hunting around for the urls.
zzak
December 23, 2016, 12:55pm
5
Hello!
I’ve just published a guide which helps improve apt-get installs on CCI, please try it out and let me know how we can improve it!
Many of you have asked about caching apt-get installs.
I’m here to tell you that there’s a way!
Basically it involves downloading the apt packages and caching that directory between builds.
Additionally, I will show you how to use a custom sources.list to speed up apt-get update for your builds.
A full example
We’ll start out with a full, commented, example and then walk through the what and why after.
dependencies:
cache_directories:
# We will store packages in this directory
- "…