Skip to content

Commit ace709a

Browse files
author
George Adams
committed
add ccache for macos
1 parent bfc7605 commit ace709a

File tree

2 files changed

+25
-103
lines changed

2 files changed

+25
-103
lines changed

ansible/roles/baselayout/tasks/main.yml

+14
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,20 @@
8484
- "{{ packages[os|stripversion]|default('[]') }}"
8585
- "{{ common_packages|default('[]') }}"
8686

87+
- name: Check whether /etc/paths contains "/usr/localopt/ccache/libexec" (macos)
88+
when: os|startswith("macos")
89+
command: grep -Fxq "/usr/localopt/ccache/libexec" /etc/paths
90+
register: ccache_mac
91+
check_mode: no
92+
ignore_errors: yes
93+
changed_when: no
94+
95+
- name: add ccache to the path (macos)
96+
when: ccache_mac.rc == 1
97+
lineinfile: dest=/etc/paths
98+
insertbefore=BOF
99+
line='/usr/localopt/ccache/libexec'
100+
87101
- name: ubuntu1404 | update package alternatives
88102
when: os == "ubuntu1404"
89103
alternatives: link=/usr/bin/{{ gcc }} name={{ gcc }} path=/usr/bin/{{ gcc }}-4.9

ansible/roles/baselayout/vars/main.yml

+11-103
Original file line numberDiff line numberDiff line change
@@ -27,111 +27,46 @@ ntp_service: {
2727
}
2828

2929
common_packages: [
30-
<<<<<<< HEAD
31-
'automake,bash,libtool,sudo',
32-
=======
33-
'automake',
34-
'bash',
35-
'libtool',
36-
>>>>>>> Initial macOS ansible scripts
30+
'automake,bash,libtool',
3731
]
3832

3933
# you can either add os family or os to this list (see smartos)
4034
# but the playbook chooses os over family - not both
4135
packages: {
42-
<<<<<<< HEAD
4336
centos6_x64: ['centos-release-scl'], # only available on x86_64, 32-bit is from https://copr.fedorainfracloud.org/coprs/mlampe
4437
centos6: [
45-
'ccache,git2u,gcc-c++,devtoolset-6', # even need gcc on centos6 so ccache has symlinks
46-
=======
47-
alpine: [
48-
'autoconf',
49-
'ccache',
50-
'g++',
51-
'gcc',
52-
'git',
53-
'linux-headers',
54-
'm4',
55-
'make',
56-
'procps',
57-
'xz',
58-
'sudo',
59-
],
60-
61-
centos: [
62-
'ccache',
63-
'git',
64-
'sudo',
65-
>>>>>>> Initial macOS ansible scripts
38+
'ccache,git2u,gcc-c++,devtoolset-6,sudo', # even need gcc on centos6 so ccache has symlinks
6639
],
6740

6841
centos7_arm64: ['git'], # git2u not available for aarch64 (yet)
69-
centos7_x64: ['git2u','centos-release-scl'], # centos-release-scl is required to enable SCLo
42+
centos7_x64: ['git2u','centos-release-scl',], # centos-release-scl is required to enable SCLo
7043
# but we do it manually in partials/repo/centos7.yml for arm64
7144
centos7: [
72-
<<<<<<< HEAD
73-
'ccache,gcc-c++,devtoolset-6',
45+
'ccache,gcc-c++,devtoolset-6,sudo',
7446
],
7547

7648
debian7: [
77-
'gcc-4.8,g++-4.8',
49+
'gcc-4.8,g++-4.8,sudo',
7850
],
7951

8052
debian8: [
81-
'ccache,git,gcc-4.9,g++-4.9,libfontconfig1',
53+
'ccache,git,gcc-4.9,g++-4.9,libfontconfig1,sudo',
8254
],
8355

8456
debian9: [
85-
'gcc-6,g++-6,ccache,git,curl,libfontconfig1,apt-transport-https,ca-certificates',
57+
'gcc-6,g++-6,ccache,git,curl,libfontconfig1,apt-transport-https,ca-certificates,sudo',
8658
],
8759

8860
fedora: [
89-
'bzip2,ccache,gcc-c++,git,fontconfig',
61+
'bzip2,ccache,gcc-c++,git,fontconfig,sudo',
9062
],
9163

9264
freebsd: [
93-
'ccache,git,gmake'
94-
=======
95-
'gcc-c++',
96-
'sudo',
97-
],
98-
99-
debian7: [
100-
'gcc-4.8',
101-
'g++-4.8',
102-
'sudo',
103-
],
104-
105-
debian8: [
106-
'ccache',
107-
'git',
108-
'libfontconfig1',
109-
'sudo',
110-
],
111-
112-
fedora: [
113-
'ccache',
114-
'gcc-c++',
115-
'git',
116-
'fontconfig',
117-
'sudo',
118-
],
119-
120-
freebsd: [
121-
'ccache',
122-
'git',
123-
'gmake',
124-
'sudo',
125-
],
126-
127-
macos: [
128-
'curl',
129-
'python2',
130-
>>>>>>> Initial macOS ansible scripts
65+
'ccache,git,gmake,sudo'
13166
],
13267

13368
rhel72: [
134-
'gcc-c++',
69+
'gcc-c++,sudo',
13570
],
13671

13772
smartos: [
@@ -149,21 +84,11 @@ packages: {
14984

15085
smartos15: [
15186
'gcc49',
152-
<<<<<<< HEAD
15387
'gcc49-libs'
154-
=======
155-
'gcc49-libs',
156-
'gccmakedep',
157-
'git',
158-
'gmake',
159-
'xz',
160-
'sudo',
161-
>>>>>>> Initial macOS ansible scripts
16288
],
16389

16490
smartos16: [
16591
'gcc49',
166-
<<<<<<< HEAD
16792
'gcc49-libs'
16893
],
16994

@@ -172,24 +97,7 @@ packages: {
17297
],
17398

17499
ubuntu: [
175-
'ccache,g++,gcc,git,libfontconfig1',
176-
=======
177-
'gcc49-libs',
178-
'gccmakedep',
179-
'git',
180-
'gmake',
181-
'xz',
182-
'sudo',
183-
],
184-
185-
ubuntu: [
186-
'ccache',
187-
'g++',
188-
'gcc',
189-
'git',
190-
'libfontconfig1',
191-
'sudo',
192-
>>>>>>> Initial macOS ansible scripts
100+
'ccache,g++,gcc,git,libfontconfig1,sudo',
193101
],
194102

195103
ubuntu1404: [

0 commit comments

Comments
 (0)