# ASM setup in Ansible playbook - name: Install cmr via lxup get as used by r.fish tags: s4,asm args: creates: "~/.config/fish/functions/{{ item }}.fish" command: fish -c 'lxup get {{ item }}' loop: - cmr - asm - name: Install all DNF dependencies for labs tags: s4,asm become: true when: ansible_facts['os_family'] == "RedHat" ansible.builtin.dnf: name: # Just by precaution - gcc - gdb # Others - gdb-gdbserver # We need the GDB server to enable debugging in Eclipse - glibc-devel.i686 # fixes "/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory 7 | # include " - libpng12 # fixes "qemu/arm-softmmu/qemu-system-arm: error while loading shared libraries: libpng12.so.0 [...]" - ncurses-compat-libs # Used for ./st and ./st86 - sdl2-compat # qemu/i386-softmmu/qemu-system-i386: error while loading shared libraries: libSDL2-2.0.so.0: cannot open shared object file - dtc - seabios # to fix "qemu-system-i386: warning: TCG doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]" # Note: no need for qemu as special binary qemu-system-i386 is used and present in the repos - socat # for asm.fish - net-tools # for netstat in asm.fish - ImageMagick # for lab 5 with image diffing (compare command) and display (display command) - gtk3 # to avoid Eclipse issue with Fedora WSL: SWT OS.java Error: Failed to load swt-pi3, loading swt-pi4 as fallback. - clangd # so clang VSCode extension doesn't prompt to install it - name: Install all APT dependencies for labs tags: s4,asm become: true when: ansible_facts['os_family'] == "Debian" ansible.builtin.apt: name: # Just by precaution - gcc - gdb-multiarch - bzip2 # to extract the .bz2 archive in asm.x86-i686.sh # Others - gdbserver # We need the GDB server to enable debugging in Eclipse - gcc-multilib # GPT mentionned this, but I don't know if this is really useful: libc6-dev-i386 # fixes fatal error: bits/wordsize.h: No such file or directory # Used for ./st and ./st86 - libpulse0 # qemu/i386-softmmu/qemu-system-i386: error while loading shared libraries: libpulse.so.0: cannot open shared object file - libsdl2-2.0-0 # qemu/i386-softmmu/qemu-system-i386: error while loading shared libraries: libSDL2-2.0.so.0: cannot open shared object file - device-tree-compiler - seabios - socat # for asm.fish - net-tools # for netstat in asm.fish - imagemagick # for lab 5 with image diffing (compare command) and display (display command) # DO not install clangd here # Here is the issue according to copilot. # libllvm18 requires libffi7, but Ubuntu 24.04 only has libffi8. The focal-security libncurses5 from SYE isn't directly causing this—it's a version mismatch between LLVM packages and the system's libffi. # # This happens because: # # SYE installs libncurses5 from focal-security (Ubuntu 20.04) # ASM tries to install clangd, which depends on libllvm18 # libllvm18 was built expecting libffi7 (from older Ubuntu versions) # Ubuntu 24.04 only ships libffi8, creating an unsatisfiable dependency # - clangd # so clang VSCode extension doesn't prompt to install it # asm run arm/hello_world.bin # Starting arm/hello_world.bin in Qemu... # qemu/arm-softmmu/qemu-system-arm: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory # -> we need to install libpng12 # # libpng12 is not shipped anymore (version 16 currently) # Installation from ppa:linuxuprising/libpng12 https://launchpad.net/%7Elinuxuprising/+archive/ubuntu/libpng12 # It is not working with apt install libpng12-0 # # sudo add-apt-repository ppa:linuxuprising/libpng12 # sudo apt update # # Is causing the following errors # E: The repository 'https://ppa.launchpadcontent.net/linuxuprising/libpng12/ubuntu noble Release' does not have a Release file. # N: Updating from such a repository can't be done securely, and is therefore disabled by default. # N: See apt-secure(8) manpage for repository creation and user configuration details. # # Thus, I decided to just download the useful DEB directly # An alternative would be to install from source with this working script. # https://askubuntu.com/a/1412236 - name: Install DEB of old libpng12 from PPA tags: s4,asm become: true when: ansible_facts['os_family'] == "Debian" # It this that libpng12-dev is actually not necessary ! # curl -LO 'http://ppa.launchpad.net/linuxuprising/libpng12/ubuntu/pool/main/libp/libpng/libpng12-dev_1.2.54-1ubuntu1.1+1~ppa0~jammy0_amd64.deb' # # It is even causing issues maybe # # The following packages have unmet dependencies: # libgtk2.0-dev : Depends: libgdk-pixbuf-2.0-dev (>= 2.21.0) but it is not going to be installed or # libgdk-pixbuf2.0-dev (>= 2.21.0) but it is not going to be installed # Recommends: debhelper but it is not going to be installed ansible.builtin.shell: | cd /tmp curl -LO 'http://ppa.launchpad.net/linuxuprising/libpng12/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1+1~ppa0~jammy0_amd64.deb' sudo apt install -y ./libpng12-0_1.2.54-1ubuntu1.1+1~ppa0~jammy0_amd64.deb # COMPILEDB installation - name: Install compiledb to generate compile_commands.json for all Makefile tags: s4,asm when: ansible_facts['os_family'] == "RedHat" community.general.pipx: name: compiledb - name: Install compiledb via pipx to generate compile_commands.json for all Makefile tags: s4,asm when: ansible_facts['os_family'] == "Debian" community.general.pipx: name: compiledb - name: Download and setup the x86-i686 and ARM toolchain under /opt/toolchains tags: s4,asm become: true # because some commands are touching /opt/toolchains ansible.builtin.command: bash {{ item.script }} args: creates: "{{ item.creates }}" loop: - { script: "./s4/asm.x86-arm.sh", creates: "/opt/toolchains/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf", } - { script: "./s4/asm.x86-i686.sh", creates: "/opt/toolchains/i686-linux_6.4.0", } - name: Add toolchains path to Fish PATH tags: s4,asm # Note: -m with --append is used to move the given path at the end. # For people who run it without those flags, it would update it to make sure it is at the end. ansible.builtin.shell: fish -c 'fish_add_path -m --append {{ item }} || true' loop: - /opt/toolchains/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin - /opt/toolchains/i686-linux_6.4.0/bin # Example: Create symlink arm-linux-gnueabihf-gcc that points to arm-none-linux-gnueabihf-gcc - name: Create symlinks to access ARM toolchain binaries without the -none tags: s4,asm ansible.builtin.shell: | cd /opt/toolchains/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/; fish -c 'for i in (ls); set link (string replace -- "-none-" "-" $i); if ! test -L $link; sudo ln -s $i $link; end; end' # https://snapcraft.io/docs/tutorials/install-the-daemon/fedora/ - name: Install Snap on Fedora tags: s4,asm become: true when: ansible_facts['os_family'] == "RedHat" ansible.builtin.dnf: name: - snapd - name: Create snap symlink on Fedora tags: s4,asm become: true when: ansible_facts['os_family'] == "RedHat" ansible.builtin.command: ln -s /var/lib/snapd/snap /snap args: creates: "/snap" # The easy way to install eclipse without any manual intervention is through snap - name: Install Eclipse IDE via Snap tags: s4,asm become: true community.general.snap: classic: true name: - eclipse # Disabled installation of Eclipse as not fully working because of Flatpak version, and I gave up on using it for debugging natively # - name: Install Eclipse IDE via Flatpak # tags: s4,asm # flatpak: # state: present # method: user # name: # - org.eclipse.Java # This is NOT WORKING attempt to install the CDT plugin, I lost several hours trying to do it. Copilot helped me to figure out these commands and I cannot understand how to install this plugin globally without any specific workspace, and see it under "Installed" tab. # - name: Extract the list of plugins installed on Eclipse # tags: s4,asm # register: eclipse_plugins # shell: flatpak run org.eclipse.Java -nosplash -application org.eclipse.equinox.p2.director -listInstalledRoots # # - name: Install the plugin "CDT" for C/C++ support in Eclipse IDE - 1-2minutes # tags: s4,asm # when: "'org.eclipse.cdt.feature.group' not in eclipse_plugins.stdout" # shell: # cmd: | # flatpak run org.eclipse.Java \ # -application org.eclipse.equinox.p2.director \ # -noSplash \ # -repository https://download.eclipse.org/releases/latest \ # -profile DefaultProfile \ # -profileProperties org.eclipse.update.install.features=true \ # -destination ~/.config/eclipse-workspace/ \ # -installIUs org.eclipse.cdt.feature.group \ # -installIUs org.eclipse.cdt.autotools.feature.group \ # -installIUs org.eclipse.cdt.cmake.feature.group \ # -installIUs org.eclipse.cdt.meson.feature.group \ # # Diffing the list of plugins before and after manual installation in GUI # org.eclipse.cdt.autotools.feature.group/11.6.1.202406241230 # org.eclipse.cdt.cmake.feature.group/11.6.1.202406241230 # org.eclipse.cdt.feature.group/11.6.1.202407022008 # org.eclipse.cdt.meson.feature.group/11.6.1.202406241230 # Note # -profileProperties org.eclipse.update.install.features=true \ # This is necessary to wait on the end of the setup # -destination ~/.config/eclipse-workspace/ \ # More sensible location that the default ~/eclipse-workspace/ # This list of Installation Unit has been extracted from the list generated by -listInstalledRoots flag before and after installing the plugin "Eclipse C/C++ IDE CDT" as required in PDF and leaving all checkboxes checked ## Installer Binsider ? # apt install libxcb-cursor0 libxcb-cursor-dev