2 - name: Update apt cache.
3 apt: update_cache=yes cache_valid_time=86400
5 - name: Add snapshot soures for gcc-11-powerpc/riscv64
6 when: ansible_distribution == 'Debian'
8 - ansible.builtin.copy:
9 dest: /etc/apt/preferences.d/snapshot.pref
10 content: "Package: *\nPin: origin \"snapshot.debian.org\"\nPin-Priority: 400\n"
11 when: cross_compilers_debian_bookworm_snapshot
12 - ansible.builtin.apt_repository:
13 repo: 'deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/20230109T091852Z/ bookworm main'
14 state: "{{cross_compilers_debian_bookworm_snapshot|ternary('present', 'absent')}}"
15 - ansible.builtin.apt:
18 - name: Ensure cross-compilers packages are installed.
19 apt: "name={{ cross_compilers_packages }} state=present"
21 - name: Install legacy cross compilers
22 when: ansible_distribution == 'Debian' and ansible_architecture == 'x86_64' and compilers_legacy_install
24 # This step needs to happen after the cross compiler packages are installed
25 # so the libgcc cross libraries can be copied
26 - name: Copy gcc-cross libs
27 ansible.builtin.command:
28 argv: ['cp', '-r', "/usr/lib/gcc-cross/{{item}}/12/", "/usr/lib/gcc-cross/{{item}}/4.8.5"]
29 creates: "/usr/lib/gcc-cross/{{item}}/4.8.5"
34 - powerpc64le-linux-gnu
38 - name: Download legacy compiler binaries
39 # These binaries built from files/Containerfile
40 ansible.builtin.get_url:
41 url: https://obj.internal.efficios.com/jenkins/gcc-4.8-x86_64-linux-gnu-cross.tgz
42 dest: /root/gcc-4.8-x86_64-linux-gnu-cross.tgz
43 register: cross_download
44 - name: Extract legacy compiler binaries
45 when: cross_download.changed
46 ansible.builtin.command:
47 argv: ['tar', '-C', '/', '-xzf', '/root/gcc-4.8-x86_64-linux-gnu-cross.tgz']