Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-11 through clang-16 fail to install on ubuntu-24.04 #329

Open
KrystalDelusion opened this issue Jan 19, 2025 · 9 comments · Fixed by #331 or #333 · May be fixed by #334
Open

clang-11 through clang-16 fail to install on ubuntu-24.04 #329

KrystalDelusion opened this issue Jan 19, 2025 · 9 comments · Fixed by #331 or #333 · May be fixed by #334
Labels
bug Something isn't working

Comments

@KrystalDelusion
Copy link

When trying to install clang-11 through clang-16 on ubuntu-24.04 it looks like it's trying to install from source, and as part of that attempts to install libtinfo-dev which is not available in distros newer than jammy (22.04). For clang<=10 it looks like there it uses libtinfo5 which has a valid fallback.

Should it be changed to install libtinfo6 for clang>10? That is available on noble (24.04), while libtinfo-dev on jammy says

This is a transitional package that can safely be removed.

@aminya aminya added the bug Something isn't working label Jan 20, 2025
@aminya
Copy link
Owner

aminya commented Jan 20, 2025

Thanks for the report. Do you have logs for this that could speed up the debugging?

@KrystalDelusion
Copy link
Author

KrystalDelusion commented Jan 20, 2025

https://github.com/KrystalDelusion/yosys/actions/runs/12857796412 has a step:

      - name: Setup Cpp
        uses: aminya/setup-cpp@v1
        with:
          compiler: ${{ matrix.compiler }}

Which I ran with clang-10 through clang-19 under ubuntu-latest (instanced as 24.04).
It gives the following for the failing builds:

Error: Failed to install apt packages: Command failed with exit code 100: sudo 'apt-get' 'update' '-y' '-o' 'Dpkg::Lock::Timeout=300'
Error: Command failed with exit code 100: sudo 'apt-get' 'update' '-y' '-o' 'Dpkg::Lock::Timeout=300'
    at Vi (file:///home/runner/work/_actions/aminya/setup-cpp/v1/dist/modern/setup-cpp.mjs:2:208894)
    at b (file:///home/runner/work/_actions/aminya/setup-cpp/v1/dist/modern/setup-cpp.mjs:2:26442)
    at file:///home/runner/work/_actions/aminya/setup-cpp/v1/dist/modern/setup-cpp.mjs:2:29976
    at A (file:///home/runner/work/_actions/aminya/setup-cpp/v1/dist/modern/setup-cpp.mjs:2:29985)
    at file:///home/runner/work/_actions/aminya/setup-cpp/v1/dist/modern/setup-cpp.mjs:2:254203
    at Gc.T (file:///home/runner/work/_actions/aminya/setup-cpp/v1/dist/modern/setup-cpp.mjs:2:43819)
    at ot (file:///home/runner/work/_actions/aminya/setup-cpp/v1/dist/modern/setup-cpp.mjs:2:112896)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///home/runner/work/_actions/aminya/setup-cpp/v1/dist/modern/setup-cpp.mjs:2:112095
    at async rt (file:///home/runner/work/_actions/aminya/setup-cpp/v1/dist/modern/setup-cpp.mjs:2:112060)

@aminya
Copy link
Owner

aminya commented Jan 20, 2025

Thanks. We can fix this by removing the non-existent LLVM ppa after the failed installation.

info(`Failed to install llvm via system package manager ${err}`)

Then installation will fallback to the normal binary downloads.

@aminya
Copy link
Owner

aminya commented Jan 25, 2025

I've made a PR that tries to fix this. Can you try it in your repo and see if it is fixed?

      - name: Setup Cpp
        uses: aminya/setup-cpp@llvm-remove-repo
        with:
          compiler: ${{ matrix.compiler }}

#331

@KrystalDelusion
Copy link
Author

This appears to have fixed some, but has introduced failures in others.
clang-13:

/home/runner/llvm/bin/clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Error: Process completed with exit code 127.

clang-15, clang-16:

/home/runner/work/_temp/4378a1fc-2903-4db1-bd3b-a0e1dc1e87ab.sh: line 1: /home/runner/llvm/bin/clang: cannot execute binary file: Exec format error
Error: Process completed with exit code 126.

These are both in response to calling $CC --version

@aminya
Copy link
Owner

aminya commented Jan 29, 2025

I have merged a fix for this. Could you test with the master branch? @KrystalDelusion

@KrystalDelusion
Copy link
Author

KrystalDelusion commented Jan 29, 2025

Pinning to c08b751 did fix the clang-13 error, but clang-15 and clang-16 are still getting the same Exec format error.

Comparing with clang-14 which downloads https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-x86_64-linux-gnu-rhel-8.4.tar.xz, clang-16 downloads https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/clang+llvm-16.0.6-powerpc64le-linux-rhel-8.7.tar.xz.

Looking at the llvm-project releases, there doesn't seem to be an x86_64 binary for the selected versions. 15.0.6 does, but 15.0.7 doesn't.

@aminya
Copy link
Owner

aminya commented Jan 29, 2025

Thanks for the info. The matching algorithm seems to have a bug that prefers PowerPC binaries in the latest release instead of going back to 15.0.6. I will have to look into the scoring algorithm and find a way to force one of the x86 keywords.

For now, you can fix this by being more precise with the version like clang-15.0.6

optionalKeywords.push("x86_64", "X64")

// rate the candidates based on the number of optional keywords they contain

@aminya aminya reopened this Jan 29, 2025
@KrystalDelusion
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment