RosettaCommons / binder

Binder, tool for automatic generation of Python bindings
MIT License
321 stars 66 forks source link

Unstable `make -j`. #231

Closed zwimer closed 1 year ago

zwimer commented 2 years ago

I've noticed that if I make -j binder when cmake was run with tests enabled, it might sometimes fail with

#22 7.131 make[2]: Leaving directory '/build'
#22 7.138 [ 18%] Built target binder
#22 7.140 make[1]: Leaving directory '/build'
#22 7.141 make: *** [Makefile:144: all] Error 2
#22 ERROR: executor failed running [/bin/sh -c make "-j$(nproc)"]: exit code: 2

I ran it with binder checked out from the current master branch, specifically this commit: https://github.com/RosettaCommons/binder/commit/7ac60d98ac95ab2d2b47bb46212f54d55f8face0 I have not debugged this or checked other commits. I would recommend using git bisect to isolate where the issue came from.

Here is the dockerfile I used:

FROM ubuntu:20.04 as base

# Config
ARG BRANCH="master"
ARG CLANG_VERSION=14

# General dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
 && apt-get install -yq wget gnupg \
 && rm -rf /var/lib/apt/lists/*

# Add llvm repo
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${CLANG_VERSION} main" >> /etc/apt/sources.list

# Run dependencies
RUN apt-get update \
 && apt-get install -yq "clang-${CLANG_VERSION}" \
 && rm -rf /var/lib/apt/lists/*

FROM base as build

# Build dependencies
RUN apt-get update
RUN apt-get install -yq \
    "libclang-${CLANG_VERSION}-dev" \
    cmake \
    git

# pybind11
RUN git clone https://github.com/pybind/pybind11 /pybind11
RUN apt-get install -yq python3-pip python3-dev
RUN pip3 install pytest
WORKDIR "/py-build"
RUN cmake \
    -DCMAKE_CXX_COMPILER="$(which clang++-"${CLANG_VERSION}")" \
    /pybind11
RUN make "-j$(nproc)"
RUN make install

# Clone binder source
ARG REPO="https://github.com/RosettaCommons/binder.git"
COPY ./binder /binder

# Binder
WORKDIR "/build"
RUN cmake \
    -DCMAKE_CXX_COMPILER="$(which clang++-"${CLANG_VERSION}")" \
    -DBINDER_ENABLE_TEST=ON \
    /binder
RUN make "-j$(nproc)"
lyskov commented 2 years ago

tagging @andriish

andriish commented 2 years ago

Hi @zwimer ,

I've tried to reproduce it with singularity and the #245 fixed the issue. Please try it with docker.

Best regards,

Andrii