Change to out-of source build, Update build instructions (#3271)

* update build instructions

Usage of "modern" CMake syntax and using specific out of source build.
Further add example on how to build in parallel, build a specific target
and how to change the compiler.

This closes #3236.
This commit is contained in:
Felix Schurk 2024-02-25 19:27:52 +02:00 committed by GitHub
parent 34c0e67469
commit 8dd29e0a8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 75 additions and 379 deletions

View file

@ -20,13 +20,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug .
RUN cmake --build build -j 8
RUN cmake --install build
RUN task --version
# Setup tests
WORKDIR /root/code/test/
WORKDIR /root/code/build/test/
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -1,36 +0,0 @@
FROM centos:7
RUN yum update -y
RUN yum install python3 git gcc gcc-c++ make libuuid-devel -y
RUN yum install epel-release centos-release-scl -y
RUN yum install which cmake3 devtoolset-7-gcc* libfaketime curl -y
RUN source scl_source enable devtoolset-7; gcc --version; cmake3 --version
RUN ln -s /usr/bin/cmake3 /usr/bin/cmake
# Setup language environment
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Add source directory
ADD . /root/code/
WORKDIR /root/code/
# Setup Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y --profile minimal --default-toolchain stable --component rust-docs
# Setup taskwarrior
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN source scl_source enable devtoolset-7; cmake -DCMAKE_BUILD_TYPE=debug .
RUN source scl_source enable devtoolset-7; make -j8
RUN source scl_source enable devtoolset-7; make install
RUN task --version
# Setup tests
WORKDIR /root/code/test/
RUN source scl_source enable devtoolset-7; make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -1,39 +0,0 @@
FROM centos:8
# Fix missing repo metadata
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
RUN dnf update -y
RUN dnf install python3 git gcc gcc-c++ make libuuid-devel glibc-langpack-en -y
RUN dnf install epel-release -y
RUN dnf install which cmake libfaketime curl -y
RUN gcc --version; cmake --version
# Setup language environment
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Add source directory
ADD . /root/code/
WORKDIR /root/code/
# Setup Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y --profile minimal --default-toolchain stable --component rust-docs
# Setup taskwarrior
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN task --version
# Setup tests
WORKDIR /root/code/test/
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -21,13 +21,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug .
RUN cmake --build build -j 8
RUN cmake --install build
RUN task --version
# Setup tests
WORKDIR /root/code/test/
WORKDIR /root/code/build/test
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -21,13 +21,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug .
RUN cmake --build build -j 8
RUN cmake --install build
RUN task --version
# Setup tests
WORKDIR /root/code/test/
WORKDIR /root/code/build/test
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -1,32 +0,0 @@
FROM fedora:32
RUN dnf update -y
RUN dnf install python3 git gcc gcc-c++ cmake make libuuid-devel libfaketime glibc-langpack-en curl -y
# Setup language environment
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Add source directory
ADD . /root/code/
WORKDIR /root/code/
# Setup Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y --profile minimal --default-toolchain stable --component rust-docs
# Setup taskwarrior
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN task --version
# Setup tests
WORKDIR /root/code/test/
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -1,32 +0,0 @@
FROM fedora:33
RUN dnf update -y
RUN dnf install python3 git gcc gcc-c++ cmake make libuuid-devel libfaketime glibc-langpack-en curl -y
# Setup language environment
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Add source directory
ADD . /root/code/
WORKDIR /root/code/
# Setup Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y --profile minimal --default-toolchain stable --component rust-docs
# Setup taskwarrior
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN task --version
# Setup tests
WORKDIR /root/code/test/
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -1,32 +0,0 @@
FROM fedora:34
RUN dnf update -y
RUN dnf install python3 git gcc gcc-c++ cmake make libuuid-devel libfaketime glibc-langpack-en curl -y
# Setup language environment
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Add source directory
ADD . /root/code/
WORKDIR /root/code/
# Setup Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y --profile minimal --default-toolchain stable --component rust-docs
# Setup taskwarrior
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN task --version
# Setup tests
WORKDIR /root/code/test/
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -1,32 +0,0 @@
FROM fedora:35
RUN dnf update -y
RUN dnf install python3 git gcc gcc-c++ cmake make libuuid-devel libfaketime glibc-langpack-en curl -y
# Setup language environment
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Add source directory
ADD . /root/code/
WORKDIR /root/code/
# Setup Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y --profile minimal --default-toolchain stable --component rust-docs
# Setup taskwarrior
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN task --version
# Setup tests
WORKDIR /root/code/test/
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -20,13 +20,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug .
RUN cmake --build build -j 8
RUN cmake --install build
RUN task --version
# Setup tests
WORKDIR /root/code/test/
WORKDIR /root/code/build/test
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -20,13 +20,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug .
RUN cmake --build build -j 8
RUN cmake --install build
RUN task --version
# Setup tests
WORKDIR /root/code/test/
WORKDIR /root/code/build/test
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -1,38 +0,0 @@
# name the portage image
FROM gentoo/portage:latest as portage
# image is based on stage3-x86
FROM gentoo/stage3-x86:latest
# copy the entire portage volume in
COPY --from=portage /usr/portage /usr/portage
RUN emerge -qv sys-libs/readline:0 sys-apps/util-linux dev-util/cmake sys-devel/make dev-vcs/git sys-libs/libfaketime net-misc/curl
# Setup language environment
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Add source directory
ADD . /root/code/
WORKDIR /root/code/
# Setup Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y --profile minimal --default-toolchain stable --component rust-docs
# Setup taskwarrior
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN task --version
# Setup tests
WORKDIR /root/code/test/
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -19,13 +19,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug .
RUN cmake --build build -j 8
RUN cmake --install build
RUN task --version
# Setup tests
WORKDIR /root/code/test/
WORKDIR /root/code/build/test
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -1,33 +0,0 @@
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y build-essential cmake git uuid-dev faketime locales python3 curl
# Setup language environment
RUN locale-gen en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Add source directory
ADD . /root/code/
WORKDIR /root/code/
# Setup Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y --profile minimal --default-toolchain stable --component rust-docs
# Setup taskwarrior
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j2
RUN make install
RUN task --version
# Setup tests
WORKDIR /root/code/test/
RUN make
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -1,33 +0,0 @@
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get install -y build-essential cmake git uuid-dev faketime locales python3 curl
# Setup language environment
RUN locale-gen en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Add source directory
ADD . /root/code/
WORKDIR /root/code/
# Setup Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y --profile minimal --default-toolchain stable --component rust-docs
# Setup taskwarrior
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN task --version
# Setup tests
WORKDIR /root/code/test/
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -21,13 +21,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug .
RUN cmake --build build -j 8
RUN cmake --install build
RUN task --version
# Setup tests
WORKDIR /root/code/test/
WORKDIR /root/code/build/test
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]

View file

@ -21,13 +21,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
RUN git clean -dfx
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN make install
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug .
RUN cmake --build build -j 8
RUN cmake --install build
RUN task --version
# Setup tests
WORKDIR /root/code/test/
WORKDIR /root/code/build/test
RUN make -j8
CMD ["bash", "-c", "./run_all -v ; cat all.log | grep 'not ok' ; ./problems"]