| 174 | 174 | | done |
| 175 | 175 | | [ "$ok" = 1 ] |
| 176 | 176 | | # cargo-xwin compiles C (ring's, among others) with clang-cl and |
| 177 | | − | # links with lld-link and llvm-lib, which Debian installs under |
| 178 | | − | # versioned names only (clang-cl-19 in /usr/lib/llvm-19/bin). |
| 179 | | − | for tool in clang-cl lld-link llvm-lib; do |
| 180 | | − | command -v "$tool" >/dev/null && continue |
| 181 | | − | found="$(ls /usr/lib/llvm-*/bin/"$tool" 2>/dev/null | sort -V | tail -1)" |
| 182 | | − | [ -n "$found" ] || { echo "::error::$tool is not installed"; exit 1; } |
| 183 | | − | sudo ln -sf "$found" "/usr/local/bin/$tool" |
| 177 | + | # links with lld-link and llvm-lib. Each is a mode of a tool |
| 178 | + | # Debian does install, chosen by the name it is run as: clang-cl |
| 179 | + | # is clang, lld-link is lld, and llvm-lib is llvm-ar. Debian ships |
| 180 | + | # none of the three names, so each is linked to its tool. |
| 181 | + | for pair in clang-cl:clang lld-link:lld llvm-lib:llvm-ar; do |
| 182 | + | name="${pair%%:*}" tool="${pair##*:}" |
| 183 | + | command -v "$name" >/dev/null && continue |
| 184 | + | found="$(command -v "$tool" || ls /usr/lib/llvm-*/bin/"$tool" 2>/dev/null | sort -V | tail -1)" |
| 185 | + | [ -n "$found" ] || { echo "::error::$tool is not installed, so there is no $name"; exit 1; } |
| 186 | + | sudo ln -sf "$(readlink -f "$found")" "/usr/local/bin/$name" |
| 187 | + | echo "$name: $(readlink -f "$found")" |
| 184 | 188 | | done |
| 185 | 189 | | cargo install --locked cargo-xwin |
| 186 | 190 | | - uses: actions/cache@v4 |