Logo

Troubleshooting

Muse couldn’t understand my build system / complained about not being able to produce a compilation database

Because Muse includes advanced program analysis tools, it has to be able to build the application. There are three common cases:

  1. Building the code requires Java 11 (Muse defaults to JDK 1.8). In this case, add a .muse.toml file in the root directory of your repository containing
    jdk11 = true
    
  2. Analyzing the code requires a non-standard build target. When possible, it is best to use a build target that doesn’t invoke tests, perform benchmarks, or pull in non-code resources such as images or binaries. This will make the analysis faster and more robust. To specify the build target, add a .muse.toml file containing the following:
    build = "<build command>"
    

    For example,

    build = "./gradlew assembleAndroid"
    
  3. Some dependencies are needed before build and analysis can proceed. Add a .muse.toml file that contains the following:
    setup = ".muse/setup.sh"
    

    Now add a .muse/setup.sh file that contains commands to download any needed dependencies. You can apt install packages or git clone public GitHub repositories. This script will be run from the root directory of the repository prior to the build and analyze steps.

I have a multi-project repository and I want Muse to only run on one particular project

Normally, Muse will do its best to autodetect your projects and analyze them. In the case that you had something else in mind, simply place a .muse.toml configuration file in the directory containing the project you want analyzed.

For more information, see subprojects.

My custom build script has the error “E: Unable to locate package ‘packagename’”

First ensure your script runs apt update to get the latest package definitions before attempting adding another package.

Muse uses Ubuntu 20.04 “focal” as the base image for all analysis builds. Check if it is a valid “focal” package using the ubuntu package search

My Android project is not building in Muse

Android projects in Muse will require some special configuration. See this guide for instructions and an example.

I don’t have my own repository, but I still want to try Muse

In this case here is an example repository you can fork to see the power of Muse for yourself.

For this tutorial, we are going to analyze a C project that uses the ‘make’ build system. Fork our example repo at https://github.com/Muse-Dev/hello_muse.

NOTE: if you didn’t give the Muse app permissions to all repositories then you’ll need to give it permission to this new repository. It’s easy, just go to https://github.com/apps/muse-dev, click configure and include this new repository by selecting it under ‘repository access’.

The develop branch has had multiple bugs introduced. Muse can analyze the changed code and call out any bugs that have appeared. You can start the analysis process by making a pull request. Navigate to the URL below and click Create pull request. Again, replace $USER with your GitHub username.

https://github.com/$USER/hello_use/compare/master...develop

After a few minutes Muse will respond with its discoveries through pull request comments such as the one below.

image

Muse will also take advantage of GitHub’s status API to let you know if there were any new bugs introduced by the pull request:

image

The full set of comments can be seen at the following URL.

https://github.com/$USER/hello_muse/pull/1

I am wondering what utilities are available to Muse analysis by default

Great! You are in the right place. The Muse analysis image is based on Ubuntu 20.04. Here is a list of packages installed by default:

apt-get install --yes --no-install-recommends \
    autoconf \
    automake \
    awscli \
    curl \
    git \
    software-properties-common \
    gcc-7 \
    gcc-9 \
    g++-9 \
    g++-multilib \
    libc6-dev \
    libgmp-dev \
    libsqlite3-dev \
    opam \
    libtool \
    libtool-bin \
    autotools-dev \
    openjdk-8-jdk-headless \
    openjdk-11-jdk-headless \
    pkg-config \
    ruby \
    libsqlite3-dev \
    gawk \
    tzdata \
    maven \
    libpcre3-dev \
    netbase \
    npm \
    locales \
    libcurl4-gnutls-dev \
    libssl-dev \
    ant \
    jq \
    vim \
    zlib1g-dev \
    python3 \
    python3-dev \
    python3-pip \
    python-setuptools

I have a problem that is not addressed here

Whether it’s a cryptic build error or just confusing results, don’t hesitate to contact our support for personalized assistance.