ansible: fix cross compilers role on armhf/arm64
[lttng-ci.git] / automation / ansible / roles / cross-compilers / tasks / setup-Debian.yml
CommitLineData
601db8ee
MJ
1---
2- name: Update apt cache.
3 apt: update_cache=yes cache_valid_time=86400
4
a862e336 5- name: Add snapshot soures for gcc-11-powerpc/riscv64
7bfd4464 6 when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '12'
a862e336
KS
7 block:
8 - ansible.builtin.copy:
9 dest: /etc/apt/preferences.d/snapshot.pref
10 content: "Package: *\nPin: origin \"snapshot.debian.org\"\nPin-Priority: 400\n"
ece5559f 11 when: cross_compilers_debian_bookworm_snapshot
a862e336
KS
12 - ansible.builtin.apt_repository:
13 repo: 'deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/20230109T091852Z/ bookworm main'
ece5559f 14 state: "{{cross_compilers_debian_bookworm_snapshot|ternary('present', 'absent')}}"
a862e336
KS
15 - ansible.builtin.apt:
16 update_cache: true
17
0eb6d73e 18- name: Ensure cross-compilers packages are installed.
99c8cda3 19 ansible.builtin.apt:
5813f004 20 name: "{{ cross_compilers_packages | difference(lookup('vars', 'cross_compilers_packages_exclude_{{ansible_userspace_architecture|default(ansible_architecture)}}', default=[]))}}"
e261a28e
KS
21
22- name: Install legacy cross compilers
ece5559f 23 when: ansible_distribution == 'Debian' and ansible_architecture == 'x86_64' and compilers_legacy_install
e261a28e
KS
24 block:
25 # This step needs to happen after the cross compiler packages are installed
26 # so the libgcc cross libraries can be copied
27 - name: Copy gcc-cross libs
28 ansible.builtin.command:
29 argv: ['cp', '-r', "/usr/lib/gcc-cross/{{item}}/12/", "/usr/lib/gcc-cross/{{item}}/4.8.5"]
30 creates: "/usr/lib/gcc-cross/{{item}}/4.8.5"
31 with_items:
32 - aarch64-linux-gnu
33 - arm-linux-gnueabihf
34 - i686-linux-gnu
35 - powerpc64le-linux-gnu
36 - powerpc-linux-gnu
37 - riscv64-linux-gnu
38 - s390x-linux-gnu
4f6c1ba9 39 - name: Download gcc-4.8 cross compiler binaries
e261a28e
KS
40 # These binaries built from files/Containerfile
41 ansible.builtin.get_url:
42 url: https://obj.internal.efficios.com/jenkins/gcc-4.8-x86_64-linux-gnu-cross.tgz
43 dest: /root/gcc-4.8-x86_64-linux-gnu-cross.tgz
4f6c1ba9
KS
44 register: cross_gcc48_download
45 - name: Extract gcc-4.8 cross compiler binaries
46 when: cross_gcc48_download.changed
e261a28e
KS
47 ansible.builtin.command:
48 argv: ['tar', '-C', '/', '-xzf', '/root/gcc-4.8-x86_64-linux-gnu-cross.tgz']
4f6c1ba9
KS
49
50 - name: Download gcc-5.5 cross compiler binaries
51 ansible.builtin.get_url:
52 url: https://obj.internal.efficios.com/jenkins/gcc-5.5-x86_64-linux-gnu-cross.tgz
53 dest: /root/gcc-5.5-x86_64-linux-gnu-cross.tgz
54 register: cross_gcc55_download
55 - name: Extract gcc-5.5 cross compiler binaries
56 when: cross_gcc55_download.changed
57 ansible.builtin.command:
58 argv: ['tar', '-xzf', '/root/gcc-5.5-x86_64-linux-gnu-cross.tgz', '-C', '/']
This page took 0.033053 seconds and 4 git commands to generate.