Skip to content

Commit

The Windows build on Linux finds clang-cl, lld-link and llvm-lib. Debian installs none of those names: each is a mode of clang, lld and llvm-ar that the tool picks from the name it is run as, so the job links each name to its tool rather than looking for a versioned file that is not there.

syntaqxcommitted Parent8e79bb8Browse files
1 file+11−70/1 viewed
+11−7
174174 done
175175 [ "$ok" = 1 ]
176176 # 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")"
184188 done
185189 cargo install --locked cargo-xwin
186190 - uses: actions/cache@v4