pantsbuild / binaries

A temporary home for pants static binaries and scripts
16 stars 37 forks source link

add compiler package script #57

Closed cosmicexplorer closed 6 years ago

cosmicexplorer commented 6 years ago

The new script ./build-compiler-5.0.1.sh will package an archive named compiler.tar.gz for both MacOS and Linux when executed in a Linux environment. This archive currently contains the clang compiler and the C standard library, which is sufficient to compile the python_dist() test project -- this can be tested by running ./pants run testprojects/src/python/python_distribution/fasthello_with_install_requires:main_with_no_conflict.

Notes

  1. This script pulls down a binary release of clang+llvm from the llvm downloads page for MacOS, but we have to build the Linux package from a source release (downloaded from the same page). This means that the script should be executed in a Linux environment to produce both MacOS and Linux packages.
  2. LLVM really likes .tar.xz files for some reason, so xz is needed to unpack their archives -- you will need to run yum install -y xz if using the CentOS Dockerfile available in the pants codebase.
  3. This script executes the build-cmake-3.9.5.sh script already available in this repo to produce a cmake binary that can be used to build LLVM from source. This is necessary because LLVM requires cmake >= 3.4, which is otherwise not available in the CentOS Dockerfile from the pants codebase. Because build-cmake-3.9.5.sh only builds for Linux x86_64, this script only builds a compiler for 64-bit Linux hosts. If 32-bit support becomes necessary, I can probably modify both scripts to do so, but I haven't investigated whether this is supported for either cmake or LLVM yet.