Merge branch 'master' into update_scripts_2

This commit is contained in:
Bensuperpc 2022-05-25 09:03:44 +02:00 committed by GitHub
commit 6a0fe7b500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 106 additions and 47 deletions

View File

@ -18,26 +18,35 @@ jobs:
name: base name: base
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - name: checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 1
- name: build - name: build
run: make base run: make base
- name: test - name: test
run: make base.test run: make base.test
- name: archive base - name: archive base
run: | run: |
mkdir -p cache mkdir -p cache
docker save dockcross/base:latest | xz -e9 -T0 > ./cache/base.tar.xz docker save dockcross/base:latest | xz -e9 -T0 > ./cache/base.tar.xz
- name: save base - name: save base
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: cache name: cache
path: ./cache path: ./cache
retention-days: 1 retention-days: 1
- name: deploy - name: deploy
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
run: | run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }} docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
docker image push dockcross/base --all-tags docker image push dockcross/base --all-tags
image: image:
name: ${{ matrix.arch_name.image }} name: ${{ matrix.arch_name.image }}
@ -833,39 +842,50 @@ jobs:
cpython_arg: "", cpython_arg: "",
} }
steps: steps:
- uses: actions/checkout@v3 - name: checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 1
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: cache name: cache
path: ./cache path: ./cache
- name: load base - name: load base
run: xz -d -k < ./cache/base.tar.xz | docker load run: xz -d -k < ./cache/base.tar.xz | docker load
- name: build - name: build
run: make ${{ matrix.arch_name.image }} run: make ${{ matrix.arch_name.image }}
- name: basic test - name: basic test
run: make ${{ matrix.arch_name.image }}.test run: make ${{ matrix.arch_name.image }}.test
# Updated on 28/08/2021
# Updated on 19/05/2022
- name: stockfish build test - name: stockfish build test
if: ${{ matrix.arch_name.stockfish == 'yes' }} if: ${{ matrix.arch_name.stockfish == 'yes' }}
run: | run: |
git clone --depth 1 --branch sf_14 https://github.com/official-stockfish/Stockfish.git git clone --depth 1 --branch sf_15 https://github.com/official-stockfish/Stockfish.git
cd Stockfish/src cd Stockfish/src
./../../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} net ./../../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} net
./../../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} build ${{ matrix.arch_name.stockfish_arg }} -j2 ./../../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} build ${{ matrix.arch_name.stockfish_arg }} -j2
cd ../.. cd ../..
rm -rf Stockfish rm -rf Stockfish
# Updated on 28/08/2021 # Updated on 19/05/2022
- name: ninja build test - name: ninja build test
if: ${{ matrix.arch_name.ninja == 'yes' }} if: ${{ matrix.arch_name.ninja == 'yes' }}
run: | run: |
git clone --depth 1 --branch v1.10.2 https://github.com/ninja-build/ninja.git git clone --depth 1 --branch v1.11.0 https://github.com/ninja-build/ninja.git
cd ninja cd ninja
./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.ninja_arg }} ./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.ninja_arg }}
# Updated on 28/08/2021
# Updated on 19/05/2022
- name: openssl build test - name: openssl build test
if: ${{ matrix.arch_name.openssl == 'yes' }} if: ${{ matrix.arch_name.openssl == 'yes' }}
run: | run: |
git clone --depth 1 --branch OpenSSL_1_1_1k https://github.com/openssl/openssl.git git clone --depth 1 --branch OpenSSL_1_1_1o https://github.com/openssl/openssl.git
cd openssl cd openssl
wget https://raw.githubusercontent.com/mavlink/MAVSDK/main/third_party/openssl/dockcross-android.patch wget https://raw.githubusercontent.com/mavlink/MAVSDK/main/third_party/openssl/dockcross-android.patch
patch -p 0 < dockcross-android.patch patch -p 0 < dockcross-android.patch
@ -873,47 +893,52 @@ jobs:
./../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} -j2 ./../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} -j2
cd .. cd ..
rm -rf openssl rm -rf openssl
# Updated on 28/08/2021
# Updated on 19/05/2022
- name: C build test - name: C build test
if: ${{ matrix.arch_name.C == 'yes' }} if: ${{ matrix.arch_name.C == 'yes' }}
run: | run: |
git clone https://github.com/TheAlgorithms/C.git git clone https://github.com/TheAlgorithms/C.git
cd C cd C
git checkout cc241f58c253c533ac94e07151ef91a5ef7e5719 git checkout 2314a195862243e09c485a66194866517a6f8c31
./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.C_arg }} ./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.C_arg }}
cd .. cd ..
rm -rf C rm -rf C
# Updated on 28/08/2021
# Updated on 19/05/2022
- name: C-Plus-Plus build test - name: C-Plus-Plus build test
if: ${{ matrix.arch_name.C-Plus-Plus == 'yes' }} if: ${{ matrix.arch_name.C-Plus-Plus == 'yes' }}
run: | run: |
git clone https://github.com/TheAlgorithms/C-Plus-Plus.git git clone https://github.com/TheAlgorithms/C-Plus-Plus.git
cd C-Plus-Plus cd C-Plus-Plus
git checkout c3b07aed2240e5364e1a49d091a00b61f520e653 git checkout 37a29008e6b77921a97a89ca8b7fd9e700aeccd0
./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.C-Plus-Plus_arg }} ./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.C-Plus-Plus_arg }}
cd .. cd ..
rm -rf C-Plus-Plus rm -rf C-Plus-Plus
# Updated on 28/08/2021
# Updated on 19/05/2022
- name: fmt build test - name: fmt build test
if: ${{ matrix.arch_name.fmt == 'yes' }} if: ${{ matrix.arch_name.fmt == 'yes' }}
run: | run: |
git clone --depth 1 --branch 8.0.1 https://github.com/fmtlib/fmt.git git clone --depth 1 --branch 8.1.1 https://github.com/fmtlib/fmt.git
cd fmt cd fmt
./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.fmt_arg }} -DFMT_DOC=OFF ./../tools/dockcross-cmake-builder.sh ${{ matrix.arch_name.image }} ${{ matrix.arch_name.fmt_arg }} -DFMT_DOC=OFF
cd .. cd ..
rm -rf fmt rm -rf fmt
# Updated on 05/10/2021
# Updated on 19/05/2022
- name: cpython build test - name: cpython build test
if: ${{ matrix.arch_name.cpython == 'yes' }} if: ${{ matrix.arch_name.cpython == 'yes' }}
run: | run: |
git clone --depth 1 --branch v3.9.2 https://github.com/python/cpython.git git clone --depth 1 --branch v3.9.13 https://github.com/python/cpython.git
cd cpython cd cpython
./../tools/dockcross-command.sh ${{ matrix.arch_name.image }} ./configure ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no --disable-ipv6 ${{ matrix.arch_name.cpython_arg }} --build=x86_64-linux-gnu --enable-shared ./../tools/dockcross-command.sh ${{ matrix.arch_name.image }} ./configure ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no --disable-ipv6 ${{ matrix.arch_name.cpython_arg }} --build=x86_64-linux-gnu --enable-shared
./../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} -j2 ./../tools/dockcross-make-builder.sh ${{ matrix.arch_name.image }} -j2
cd .. cd ..
rm -rf cpython rm -rf cpython
- name: deploy - name: deploy
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
run: | run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }} docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
docker image push dockcross/${{ matrix.arch_name.image }} --all-tags docker image push dockcross/${{ matrix.arch_name.image }} --all-tags

View File

@ -189,7 +189,7 @@ Once this part is finished, there must be 3 files in the **linux-arm64** folder:
- **Dockerfile.in**, the docker file. - **Dockerfile.in**, the docker file.
- **Toolchain.cmake**, the CMake file for the toolchains. - **Toolchain.cmake**, the CMake file for the toolchains.
### Makefile and CI ### Makefile
For this last part, we will see how to add the image to the [Makefile](Makefile) and to a github action. For this last part, we will see how to add the image to the [Makefile](Makefile) and to a github action.
@ -198,14 +198,14 @@ You need to add the image/folder name (**linux-arm64**) to the **STANDARD_IMAGES
```make ```make
# These images are built using the "build implicit rule" # These images are built using the "build implicit rule"
STANDARD_IMAGES = android-arm android-arm64 android-x86 android-x86_64 \ STANDARD_IMAGES = android-arm android-arm64 android-x86 android-x86_64 \
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \ linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-m68k-uclibc linux-s390x linux-x64-tinycc \ linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-m68k-uclibc linux-s390x linux-x64-tinycc \
linux-armv6 linux-armv6-lts linux-armv6-musl linux-arm64-lts \ linux-armv6 linux-armv6-lts linux-armv6-musl linux-arm64-lts \
linux-armv7l-musl linux-armv7 linux-armv7a linux-armv7-lts linux-x86_64-full \ linux-armv7l-musl linux-armv7 linux-armv7a linux-armv7-lts linux-x86_64-full \
linux-mips linux-ppc64le linux-riscv64 linux-riscv32 linux-xtensa-uclibc \ linux-mips linux-ppc64le linux-riscv64 linux-riscv32 linux-xtensa-uclibc \
web-wasi \ web-wasi \
windows-static-x86 windows-static-x64 windows-static-x64-posix windows-armv7 \ windows-static-x86 windows-static-x64 windows-static-x64-posix windows-armv7 \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix windows-arm64 windows-shared-x86 windows-shared-x64 windows-shared-x64-posix windows-arm64
``` ```
You need to add the image/folder name (**linux-arm64**) to the **GEN_IMAGES** variable in the [Makefile](Makefile): You need to add the image/folder name (**linux-arm64**) to the **GEN_IMAGES** variable in the [Makefile](Makefile):
@ -213,18 +213,54 @@ You need to add the image/folder name (**linux-arm64**) to the **GEN_IMAGES** va
```make ```make
# Generated Dockerfiles. # Generated Dockerfiles.
GEN_IMAGES = android-arm android-arm64 \ GEN_IMAGES = android-arm android-arm64 \
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \ linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
manylinux2014-x64 manylinux2014-x86 \ manylinux2014-x64 manylinux2014-x86 \
manylinux2014-aarch64 linux-arm64-lts \ manylinux2014-aarch64 linux-arm64-lts \
web-wasm web-wasi linux-mips windows-arm64 windows-armv7 \ web-wasm web-wasi linux-mips windows-arm64 windows-armv7 \
windows-static-x86 windows-static-x64 windows-static-x64-posix \ windows-static-x86 windows-static-x64 windows-static-x64-posix \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix \ windows-shared-x86 windows-shared-x64 windows-shared-x64-posix \
linux-armv7 linux-armv7a linux-armv7l-musl linux-armv7-lts linux-x86_64-full \ linux-armv7 linux-armv7a linux-armv7l-musl linux-armv7-lts linux-x86_64-full \
linux-armv6 linux-armv6-lts linux-armv6-musl \ linux-armv6 linux-armv6-lts linux-armv6-musl \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-ppc64le linux-s390x \ linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-ppc64le linux-s390x \
linux-riscv64 linux-riscv32 linux-m68k-uclibc linux-x64-tinycc linux-xtensa-uclibc linux-riscv64 linux-riscv32 linux-m68k-uclibc linux-x64-tinycc linux-xtensa-uclibc
``` ```
### Image building and testing
You can now start building the image:
```bash
make linux-arm64
```
When finished, you can test it:
```bash
make linux-arm64.test
```
If you want to go a little further in the tests:
```bash
docker run --rm linux-arm64 > ./linux-arm64
chmod +x ./linux-arm64
```
And then run the commands to build a project (you must be in the directory of your project to build):
```bash
./linux-arm64 make
```
With CMake + Ninja:
```bash
./linux-arm64 cmake -Bbuild -S. -GNinja
./linux-arm64 ninja -Cbuild
```
### CI (github action)
To finish, you have to add to [Github Action](.github/workflows/main.yml) the image/folder name: To finish, you have to add to [Github Action](.github/workflows/main.yml) the image/folder name:
```yml ```yml

View File

@ -1,4 +1,4 @@
Copyright (c) 2015, 2016, 2017, 2018 Steeve Morin, Rob Burns, Matthew McCormick, Jean-Christophe-Fillion-Robin Copyright (c) 2015, 2016, 2017, 2018, 2021 Steeve Morin, Rob Burns, Matthew McCormick, Jean-Christophe-Fillion-Robin, Bensuperpc
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -25,7 +25,7 @@ Cross compiling toolchains in Docker images.
## Examples ## Examples
1. `dockcross make`: Build the *Makefile* in the current directory. 1. `dockcross make`: Build the *Makefile* in the current directory.
2. `dockcross cmake -Bbuild -H. -GNinja`: Run CMake with a build directory `./build` for a *CMakeLists.txt* file in the current directory and generate `ninja` build configuration files. 2. `dockcross cmake -Bbuild -S. -GNinja`: Run CMake with a build directory `./build` for a *CMakeLists.txt* file in the current directory and generate `ninja` build configuration files.
3. `dockcross ninja -Cbuild`: Run ninja in the `./build` directory. 3. `dockcross ninja -Cbuild`: Run ninja in the `./build` directory.
4. `dockcross bash -c '$CC test/C/hello.c -o hello'`: Build the *hello.c* file with the compiler identified with the `CC` environmental variable in the build environment. 4. `dockcross bash -c '$CC test/C/hello.c -o hello'`: Build the *hello.c* file with the compiler identified with the `CC` environmental variable in the build environment.
5. `dockcross bash`: Run an interactive shell in the build environment. 5. `dockcross bash`: Run an interactive shell in the build environment.

View File

@ -5,7 +5,7 @@ ARG GIT_VERSION=2.36.1
ARG CMAKE_VERSION=3.23.1 ARG CMAKE_VERSION=3.23.1
ARG NINJA_VERSION=1.11.0 ARG NINJA_VERSION=1.11.0
ARG FLATCC_VERSION=d90ed18ad09824297ffd5fbc578ccb1666d13890 ARG FLATCC_VERSION=0.6.1
ARG OPENSSL_VERSION=openssl-1.1.1o ARG OPENSSL_VERSION=openssl-1.1.1o
ARG OPENSSL_HASH=9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f ARG OPENSSL_HASH=9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f

View File

@ -14,12 +14,10 @@ fi
cd /usr/src cd /usr/src
git clone https://github.com/dvidelabs/flatcc.git git clone https://github.com/dvidelabs/flatcc.git -b v$FLATCC_VERSION
cd flatcc cd flatcc
git reset --hard $FLATCC_COMMIT
cmake -DFLATCC_INSTALL=on && make install > /dev/null cmake -DFLATCC_INSTALL=on && make install > /dev/null
./scripts/cleanall.sh ./scripts/cleanall.sh

View File

@ -6,7 +6,7 @@ ENV XCC_PREFIX /usr/xcc
ENV CROSS_TRIPLE aarch64-w64-mingw32 ENV CROSS_TRIPLE aarch64-w64-mingw32
ENV CROSS_ROOT ${XCC_PREFIX}/${CROSS_TRIPLE}-cross ENV CROSS_ROOT ${XCC_PREFIX}/${CROSS_TRIPLE}-cross
ARG DOWNLOAD_URL=https://github.com/mstorsjo/llvm-mingw/releases/download/20210423/llvm-mingw-20210423-msvcrt-ubuntu-18.04-x86_64.tar.xz ARG DOWNLOAD_URL=https://github.com/mstorsjo/llvm-mingw/releases/download/20220323/llvm-mingw-20220323-msvcrt-ubuntu-18.04-x86_64.tar.xz
ENV DOWNLOAD_URL=${DOWNLOAD_URL} ENV DOWNLOAD_URL=${DOWNLOAD_URL}
RUN mkdir -p ${CROSS_ROOT} && wget -qO- "${DOWNLOAD_URL}" | tar xJvf - --strip 1 -C ${CROSS_ROOT}/ > /dev/null RUN mkdir -p ${CROSS_ROOT} && wget -qO- "${DOWNLOAD_URL}" | tar xJvf - --strip 1 -C ${CROSS_ROOT}/ > /dev/null

View File

@ -6,7 +6,7 @@ ENV XCC_PREFIX /usr/xcc
ENV CROSS_TRIPLE armv7-w64-mingw32 ENV CROSS_TRIPLE armv7-w64-mingw32
ENV CROSS_ROOT ${XCC_PREFIX}/${CROSS_TRIPLE}-cross ENV CROSS_ROOT ${XCC_PREFIX}/${CROSS_TRIPLE}-cross
ARG DOWNLOAD_URL=https://github.com/mstorsjo/llvm-mingw/releases/download/20210423/llvm-mingw-20210423-msvcrt-ubuntu-18.04-x86_64.tar.xz ARG DOWNLOAD_URL=https://github.com/mstorsjo/llvm-mingw/releases/download/20220323/llvm-mingw-20220323-msvcrt-ubuntu-18.04-x86_64.tar.xz
ENV DOWNLOAD_URL=${DOWNLOAD_URL} ENV DOWNLOAD_URL=${DOWNLOAD_URL}
RUN mkdir -p ${CROSS_ROOT} && wget -qO- "${DOWNLOAD_URL}" | tar xJvf - --strip 1 -C ${CROSS_ROOT}/ > /dev/null RUN mkdir -p ${CROSS_ROOT} && wget -qO- "${DOWNLOAD_URL}" | tar xJvf - --strip 1 -C ${CROSS_ROOT}/ > /dev/null