# Clang-9 build not working after migration from travis-ci.org to travis-ci.com

**URL:** <https://travis-ci.community/t/clang-9-build-not-working-after-migration-from-travis-ci-org-to-travis-ci-com/12271>\
**Category:** Xenial\
**Created:** [October 16, 2021, 3:02am UTC](https://travis-ci.community/t/clang-9-build-not-working-after-migration-from-travis-ci-org-to-travis-ci-com/12271 "2021-10-16T03:02:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![esabol](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/esabol/32/7302_2.png) [@esabol](https://travis-ci.community/u/esabol)\
**Post date:** [October 16, 2021, 3:02am UTC](https://travis-ci.community/t/clang-9-build-not-working-after-migration-from-travis-ci-org-to-travis-ci-com/12271/1 "2021-10-16T03:02:18Z")

</div>

_Finally_ migrated OSS repo from [travis-ci.org](http://travis-ci.org) to [travis-ci.com](http://travis-ci.com), but our clang-9 build isn’t working after the migration. How do we fix it? Please help!

This is what we’ve been using:

```auto
dist: xenial

    - compiler: clang
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
            - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
              key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
          packages:
            - clang-9
        artifacts: true
      env:
        - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9"

```

Job output shows clang-9 is installed, but then this happens:

```auto
Setting environment variables from .travis.yml
$ export MATRIX_EVAL="CC=clang-9 && CXX=clang++-9"
$ export TRAVIS_COMPILER=clang
$ export CXX=${CXX:-clang++}
$ export CXX_FOR_BUILD=${CXX_FOR_BUILD:-clang++}
$ export CC=${CC:-clang}
$ export CC_FOR_BUILD=${CC_FOR_BUILD:-clang}
$ clang --version
clang version 7.0.0 (tags/RELEASE_700/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-7.0.0/bin
before_install.1
0.00s$ eval "${MATRIX_EVAL}"
2.68s$ . scripts/travis-$TRAVIS_OS_NAME.sh
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python-clang-9' for regex 'clang++-9'
Note, selecting 'clang-9' for regex 'clang++-9'
Note, selecting 'clang-9-examples' for regex 'clang++-9'
Note, selecting 'libclang-9-dev' for regex 'clang++-9'
Note, selecting 'clang-9-doc' for regex 'clang++-9'
Note, selecting 'python3-clang-9' for regex 'clang++-9'
uuid-dev is already the newest version (2.27.1-6ubuntu3.10).
clang-9 is already the newest version (1:9~+20210314105943+c1a0a213378a-1~exp1~20210314220516.107).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 python3-clang-9 : Breaks: python-clang-9 (< 1:9.0.1-3) but 1:9~+20210314105943+c1a0a213378a-1~exp1~20210314220516.107 is to be installed
E: Unable to correct problems, you have held broken packages.
The command ". scripts/travis-$TRAVIS_OS_NAME.sh" failed and exited with 100 during .
Your build has been stopped.

```

`scripts/travis-$TRAVIS_OS_NAME.sh` should be `scripts/travis-linux.sh`, which contains the following commands:

```auto
sudo apt-get update -qq
COMPILER_PACKAGE=$CXX
sudo apt-get install -y libboost-all-dev gperf libevent-dev uuid-dev python-sphinx libhiredis-dev $COMPILER_PACKAGE

```

---

<div class="post-metadata">

**Author:** ![esabol](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/esabol/32/7302_2.png) [@esabol](https://travis-ci.community/u/esabol)\
**Post date:** [October 16, 2021, 4:06am UTC](https://travis-ci.community/t/clang-9-build-not-working-after-migration-from-travis-ci-org-to-travis-ci-com/12271/2 "2021-10-16T04:06:39Z")

</div>

Ended up changing our `travis-linux.sh` script to the following:

```auto
sudo apt-get update -qq
COMPILER_PACKAGE=$CXX
if echo "$COMPILER_PACKAGE" | grep -q '^clang++-'; then
    COMPILER_PACKAGE=$CC
fi
sudo apt-get install -y libboost-all-dev gperf libevent-dev uuid-dev python-sphinx libhiredis-dev $COMPILER_PACKAGE

```

And that seemed to fix the problem. apt-get was interpreting ‘clang+±9’ as a regex and it matched some python package. Clearly not what was intended. Not sure why this wasn’t a problem with our clang 4.9, 5, 6, 7, and 8 builds…

If anyone has a better solution, feel free to make a suggestion.
