swift icon indicating copy to clipboard operation
swift copied to clipboard

build: enable handling of alpine-linux-musl triple

Open MaxDesiatov opened this issue 2 years ago • 5 comments

Currently, when building LLVM/clang on Alpine Linux, CMake toolchain file specifies incorrect <cpu_arch>-unknown-linux-musl target, which makes the build immediately fail. Correct target that allows building on Alpine should be specified as <cpu_arch>-alpine-linux-musl, with <cpu_arch> replaced with respective CPU platform, e.g. aarch64.

MaxDesiatov avatar Sep 29 '22 22:09 MaxDesiatov

@swift-ci please smoke test

MaxDesiatov avatar Sep 29 '22 22:09 MaxDesiatov

@swift-ci please smoke test

MaxDesiatov avatar Sep 30 '22 12:09 MaxDesiatov

the general fix makes sense. is a more elegant way to detect it than shelling out to clang? how does clang do it?

tomerd avatar Sep 30 '22 15:09 tomerd

AFAIU, clang implements distro-specific parsing of /proc/version and /etc/*release files when running on Linux. Here we delegate to that logic, an alternative would be to reimplement it in our Python build scripts.

MaxDesiatov avatar Sep 30 '22 15:09 MaxDesiatov

@swift-ci please smoke test

MaxDesiatov avatar Sep 30 '22 19:09 MaxDesiatov

@swift-ci test

MaxDesiatov avatar Jul 13 '23 14:07 MaxDesiatov

@swift-ci build toolchain

MaxDesiatov avatar Jul 13 '23 14:07 MaxDesiatov