Skip to content

Commit

Permalink
Merge pull request #497 from mapbox/llvm-6.x
Browse files Browse the repository at this point in the history
llvm 6.x / current unreleased HEAD
  • Loading branch information
springmeyer authored Oct 30, 2017
2 parents 87be082 + 6681704 commit 638e35e
Show file tree
Hide file tree
Showing 17 changed files with 224 additions and 3 deletions.
11 changes: 11 additions & 0 deletions scripts/clang++/6.0.0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: generic

matrix:
include:
- os: osx
- os: linux
sudo: false

script:
- ./mason build ${MASON_NAME} ${MASON_VERSION}
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
17 changes: 17 additions & 0 deletions scripts/clang++/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

# dynamically take name of package from directory
MASON_NAME=$(basename $(dirname $HERE))
# dynamically take the version of the package from directory
MASON_VERSION=$(basename $HERE)
MASON_LIB_FILE=bin/${MASON_NAME}

. ${MASON_DIR}/mason.sh

# inherit all functions from base
source ${HERE}/../../${MASON_NAME}/base/common.sh

mason_run "$@"
11 changes: 11 additions & 0 deletions scripts/clang-format/6.0.0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: generic

matrix:
include:
- os: osx
- os: linux
sudo: false

script:
- ./mason build ${MASON_NAME} ${MASON_VERSION}
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
17 changes: 17 additions & 0 deletions scripts/clang-format/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

# dynamically take name of package from directory
MASON_NAME=$(basename $(dirname $HERE))
# dynamically take the version of the package from directory
MASON_VERSION=$(basename $HERE)
MASON_LIB_FILE=bin/${MASON_NAME}

. ${MASON_DIR}/mason.sh

# inherit all functions from base
source ${HERE}/../../${MASON_NAME}/base/common.sh

mason_run "$@"
11 changes: 11 additions & 0 deletions scripts/clang-tidy/6.0.0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: generic

matrix:
include:
- os: osx
- os: linux
sudo: false

script:
- ./mason build ${MASON_NAME} ${MASON_VERSION}
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
17 changes: 17 additions & 0 deletions scripts/clang-tidy/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

# dynamically take name of package from directory
MASON_NAME=$(basename $(dirname $HERE))
# dynamically take the version of the package from directory
MASON_VERSION=$(basename $HERE)
MASON_LIB_FILE=bin/${MASON_NAME}

. ${MASON_DIR}/mason.sh

# inherit all functions from base
source ${HERE}/../../${MASON_NAME}/base/common.sh

mason_run "$@"
11 changes: 11 additions & 0 deletions scripts/include-what-you-use/6.0.0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: generic

matrix:
include:
- os: osx
- os: linux
sudo: false

script:
- ./mason build ${MASON_NAME} ${MASON_VERSION}
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
17 changes: 17 additions & 0 deletions scripts/include-what-you-use/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

# dynamically take name of package from directory
MASON_NAME=$(basename $(dirname $HERE))
# dynamically take the version of the package from directory
MASON_VERSION=$(basename $HERE)
MASON_LIB_FILE=bin/${MASON_NAME}

. ${MASON_DIR}/mason.sh

# inherit all functions from base
source ${HERE}/../../${MASON_NAME}/base/common.sh

mason_run "$@"
11 changes: 11 additions & 0 deletions scripts/lldb/6.0.0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: generic

matrix:
include:
- os: osx
- os: linux
sudo: false

script:
- ./mason build ${MASON_NAME} ${MASON_VERSION}
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
17 changes: 17 additions & 0 deletions scripts/lldb/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

# dynamically take name of package from directory
MASON_NAME=$(basename $(dirname $HERE))
# dynamically take the version of the package from directory
MASON_VERSION=$(basename $HERE)
MASON_LIB_FILE=bin/${MASON_NAME}

. ${MASON_DIR}/mason.sh

# inherit all functions from base
source ${HERE}/../../${MASON_NAME}/base/common.sh

mason_run "$@"
11 changes: 11 additions & 0 deletions scripts/llvm-cov/6.0.0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: generic

matrix:
include:
- os: osx
- os: linux
sudo: false

script:
- ./mason build ${MASON_NAME} ${MASON_VERSION}
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
17 changes: 17 additions & 0 deletions scripts/llvm-cov/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"

# dynamically take name of package from directory
MASON_NAME=$(basename $(dirname $HERE))
# dynamically take the version of the package from directory
MASON_VERSION=$(basename $HERE)
MASON_LIB_FILE=bin/${MASON_NAME}

. ${MASON_DIR}/mason.sh

# inherit all functions from base
source ${HERE}/../../${MASON_NAME}/base/common.sh

mason_run "$@"
4 changes: 4 additions & 0 deletions scripts/llvm/6.0.0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: generic

script:
- echo "nothing to do since travis cannot compile something as large as llvm"
3 changes: 3 additions & 0 deletions scripts/llvm/6.0.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### llvm v4.x

Development package of llvm git head
27 changes: 27 additions & 0 deletions scripts/llvm/6.0.0/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

# dynamically determine the path to this package
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
# dynamically take name of package from directory
MASON_NAME=$(basename $(dirname $HERE))
# dynamically take the version of the package from directory
MASON_VERSION=$(basename $HERE)
# inherit all functions from llvm base
source ${HERE}/../../${MASON_NAME}/base/common.sh

function setup_release() {
get_llvm_project "http://llvm.org/git/llvm.git" ${MASON_BUILD_PATH}
get_llvm_project "http://llvm.org/git/clang.git" ${MASON_BUILD_PATH}/tools/clang
get_llvm_project "http://llvm.org/git/compiler-rt.git" ${MASON_BUILD_PATH}/projects/compiler-rt
if [[ ${BUILD_AND_LINK_LIBCXX} == true ]]; then
get_llvm_project "http://llvm.org/git/libcxx.git" ${MASON_BUILD_PATH}/projects/libcxx
get_llvm_project "http://llvm.org/git/libcxxabi.git" ${MASON_BUILD_PATH}/projects/libcxxabi
get_llvm_project "http://llvm.org/git/libunwind.git" ${MASON_BUILD_PATH}/projects/libunwind
fi
get_llvm_project "http://llvm.org/git/lld.git" ${MASON_BUILD_PATH}/tools/lld
get_llvm_project "http://llvm.org/git/clang-tools-extra.git" ${MASON_BUILD_PATH}/tools/clang/tools/extra
get_llvm_project "http://llvm.org/git/lldb.git" ${MASON_BUILD_PATH}/tools/lldb
get_llvm_project "https://github.com/include-what-you-use/include-what-you-use.git" ${MASON_BUILD_PATH}/tools/clang/tools/include-what-you-use
}

mason_run "$@"
5 changes: 4 additions & 1 deletion scripts/llvm/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ They are built locally by a Mason contributor, rather than on https://travis-ci.

On MacOS we build for OS X 10.12 as the minimum target. We link llvm against the apple system libc++.

On OS X you additionally have to set up code signing once on the machine that builds llvm: https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt

### Linux details

On Linux we build using an Ubuntu Precise docker image in order to ensure that binaries can be run on Ubuntu Precise and newer platforms.
Expand All @@ -68,6 +70,7 @@ If you would like to create a new llvm package, when a new version is created, y
- At least 1 hour free to run builds locally
- A fast internet connection for large uploads (> 1.6 GB)
- A host machine of either Linux or OS X
- If using OS X then the machine needs to be set up for signing (https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt)

Here are the steps to create a new llvm version:

Expand Down Expand Up @@ -158,7 +161,7 @@ We run the docker image to build the package on linux. We map volumes such that
```
LLVM_VERSION="4.0.2"
docker run -it --volume $(pwd):/home/travis/build/mapbox/mason mason-llvm \
./mason build llvm ${LLVM_VERSION} && ./utils/llvm.sh build ${LLVM_VERSION}
/bin/bash -c "./mason build llvm ${LLVM_VERSION} && ./utils/llvm.sh build ${LLVM_VERSION}"
```

C. Authenticate your shell with the mason AWS KEYS
Expand Down
20 changes: 18 additions & 2 deletions scripts/llvm/base/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ function get_llvm_project() {
git clone --depth ${DEPTH} ${URL} ${local_file_or_checkout}
else
mason_substep "already cloned ${URL}, pulling to update"
(cd ${local_file_or_checkout} && git pull)
(cd ${local_file_or_checkout} && echo "pulling ${local_file_or_checkout}" && git pull)
fi
if [[ ${CUSTOM_GITSHA:-false} == false ]]; then
if [[ ${CUSTOM_GITSHA:-false} != false ]]; then
(cd ${local_file_or_checkout} && git fetch && git checkout ${CUSTOM_GITSHA})
fi
mason_step "moving ${local_file_or_checkout} into place at ${TO_DIR}"
Expand Down Expand Up @@ -131,6 +131,22 @@ function mason_prepare_compile {
}

function mason_compile {
if [[ $(uname -s) == 'Darwin' ]]; then
# ensure codesigning is working before starting
# this logic borrowed from homebrew llvm.rb formula
TMPDIR=$(mktemp -d)
(cd $TMPDIR && \
cp /usr/bin/false llvm_check && \
RESULT=0 &&
/usr/bin/codesign -f -s lldb_codesign --dryrun llvm_check || RESULT=$? &&
if [[ ${RESULT} != 0 ]]; then
echo "lldb_codesign identity must be available to build with LLDB."
echo "See: https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt"
exit 1
fi
)
fi

export CXX="${CXX:-${MASON_CLANG}/bin/clang++}"
export CC="${CC:-${MASON_CLANG}/bin/clang}"
# knock out lldb doc building, to remove doxygen dependency
Expand Down

0 comments on commit 638e35e

Please sign in to comment.