From ff89e58e42b1f2c5017debc6842fed204eb53dce Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 13 Jun 2023 01:59:32 +0800 Subject: [PATCH 01/24] Switch builder to ain-builder, rust to 1.70 --- contrib/dockerfiles/aarch64-linux-gnu.dockerfile | 3 ++- contrib/dockerfiles/arm-linux-gnueabihf.dockerfile | 3 ++- contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile | 3 ++- make.sh | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/contrib/dockerfiles/aarch64-linux-gnu.dockerfile b/contrib/dockerfiles/aarch64-linux-gnu.dockerfile index 4e9c7f98bb3..6cdff6528eb 100644 --- a/contrib/dockerfiles/aarch64-linux-gnu.dockerfile +++ b/contrib/dockerfiles/aarch64-linux-gnu.dockerfile @@ -1,7 +1,8 @@ ARG TARGET=aarch64-linux-gnu # ----------- -FROM --platform=linux/amd64 ubuntu:latest as builder +# https://github.com/DeFiCh/containers/blob/main/ain-builder/Dockerfile +FROM --platform=linux/amd64 docker.io/defi/ain-builder as builder ARG TARGET ARG DEBUG LABEL org.defichain.name="defichain-builder" diff --git a/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile b/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile index ae975fb5242..a4fd4299209 100644 --- a/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile +++ b/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile @@ -1,7 +1,8 @@ ARG TARGET=arm-linux-gnueabihf # ----------- -FROM --platform=linux/amd64 ubuntu:latest as builder +# https://github.com/DeFiCh/containers/blob/main/ain-builder/Dockerfile +FROM --platform=linux/amd64 docker.io/defi/ain-builder as builder ARG TARGET ARG DEBUG LABEL org.defichain.name="defichain-builder" diff --git a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile index 1f981981310..8a52729fe2c 100644 --- a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile +++ b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile @@ -1,7 +1,8 @@ ARG TARGET=x86_64-pc-linux-gnu # ----------- -FROM --platform=linux/amd64 ubuntu:latest as builder +# https://github.com/DeFiCh/containers/blob/main/ain-builder/Dockerfile +FROM --platform=linux/amd64 docker.io/defi/ain-builder as builder ARG TARGET ARG DEBUG LABEL org.defichain.name="defichain-builder" diff --git a/make.sh b/make.sh index 18aea0b4fa3..96e711e9c3a 100755 --- a/make.sh +++ b/make.sh @@ -35,7 +35,7 @@ setup_vars() { BUILD_DEPENDS_DIR="$(_canonicalize "$BUILD_DEPENDS_DIR")" CLANG_DEFAULT_VERSION=${CLANG_DEFAULT_VERSION:-"15"} - RUST_DEFAULT_VERSION=${RUST_DEFAULT_VERSION:-"1.69.0"} + RUST_DEFAULT_VERSION=${RUST_DEFAULT_VERSION:-"1.70"} MAKE_DEBUG=${MAKE_DEBUG:-"1"} From 11180ccd77653265af665879e7af90a7187db6d6 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 13 Jun 2023 02:18:20 +0800 Subject: [PATCH 02/24] Cleanup workfflow, enable more release builds --- .github/workflows/build-release.yaml | 212 +++++++++--------- ...ts-evm-rpc.yaml => tests-evm-ethlibs.yaml} | 20 +- .../test/ethlibs-fixtures.sh | 0 3 files changed, 115 insertions(+), 117 deletions(-) rename .github/workflows/{tests-evm-rpc.yaml => tests-evm-ethlibs.yaml} (83%) rename .github/scripts/fixtures.sh => ci/test/ethlibs-fixtures.sh (100%) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 6ca3ec68771..beec0293a35 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -142,11 +142,11 @@ jobs: create-release: needs: - linux-x64 - # - linux-armhf - # - linux-aarch64 - # - win-x64 - # - osx-x64 - # - osx-aarch64 + - linux-armhf + - linux-aarch64 + - win-x64 + - osx-x64 + - osx-aarch64 runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') @@ -162,12 +162,12 @@ jobs: - name: Get artifacts uses: actions/download-artifact@v3 - # - name: zip package for win-x64 - # run: | - # set -e; ver=${{ env.BUILD_VERSION }} - # cd defichain-${ver}-x86_64-w64-mingw32 - # tar xzf defichain-${ver}-x86_64-w64-mingw32.tar.gz - # zip -r "defichain-${ver}-x86_64-w64-mingw32.zip" defichain-${ver}/ + - name: zip package for win-x64 + run: | + set -e; ver=${{ env.BUILD_VERSION }} + cd defichain-${ver}-x86_64-w64-mingw32 + tar xzf defichain-${ver}-x86_64-w64-mingw32.tar.gz + zip -r "defichain-${ver}-x86_64-w64-mingw32.zip" defichain-${ver}/ - name: Get release id: get_release @@ -211,102 +211,102 @@ jobs: asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu.tar.gz.SHA256 asset_content_type: text/plain - # - name: Upload release asset - linux-armhf - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf/defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf.tar.gz - # asset_name: defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf.tar.gz - # asset_content_type: application/gzip + - name: Upload release asset - linux-armhf + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf/defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf.tar.gz + asset_name: defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf.tar.gz + asset_content_type: application/gzip - # - name: Upload checksum - linux-armhf - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf/defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf.tar.gz.SHA256 - # asset_name: defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf.tar.gz.SHA256 - # asset_content_type: text/plain + - name: Upload checksum - linux-armhf + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf/defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf.tar.gz.SHA256 + asset_name: defichain-${{ env.BUILD_VERSION }}-arm-linux-gnueabihf.tar.gz.SHA256 + asset_content_type: text/plain - # - name: Upload release asset - linux-aarch64 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu/defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu.tar.gz - # asset_name: defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu.tar.gz - # asset_content_type: application/gzip + - name: Upload release asset - linux-aarch64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu/defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu.tar.gz + asset_name: defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu.tar.gz + asset_content_type: application/gzip - # - name: Upload checksum - linux-aarch64 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu/defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu.tar.gz.SHA256 - # asset_name: defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu.tar.gz.SHA256 - # asset_content_type: text/plain - - # - name: Upload release asset - win-x64 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip - # asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip - # asset_content_type: application/zip - - # - name: Upload checksum asset - win-x64 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip.SHA256 - # asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip.SHA256 - # asset_content_type: text/plain - - # - name: Upload release asset - osx-x64 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin/defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin.tar.gz - # asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin.tar.gz - # asset_content_type: application/gzip - - # - name: Upload checksum asset - osx-x64 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin/defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin.tar.gz.SHA256 - # asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin.tar.gz.SHA256 - # asset_content_type: text/plain + - name: Upload checksum - linux-aarch64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu/defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu.tar.gz.SHA256 + asset_name: defichain-${{ env.BUILD_VERSION }}-aarch64-linux-gnu.tar.gz.SHA256 + asset_content_type: text/plain + + - name: Upload release asset - win-x64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip + asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip + asset_content_type: application/zip + + - name: Upload checksum asset - win-x64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip.SHA256 + asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip.SHA256 + asset_content_type: text/plain + + - name: Upload release asset - osx-x64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin/defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin.tar.gz + asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin.tar.gz + asset_content_type: application/gzip + + - name: Upload checksum asset - osx-x64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin/defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin.tar.gz.SHA256 + asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin.tar.gz.SHA256 + asset_content_type: text/plain - # - name: Upload release asset - osx-aarch64 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin/defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin.tar.gz - # asset_name: defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin.tar.gz - # asset_content_type: application/gzip - - # - name: Upload checksum asset - osx-aarch64 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.get_release.outputs.upload_url }} - # asset_path: ./defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin/defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin.tar.gz.SHA256 - # asset_name: defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin.tar.gz.SHA256 - # asset_content_type: text/plain + - name: Upload release asset - osx-aarch64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin/defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin.tar.gz + asset_name: defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin.tar.gz + asset_content_type: application/gzip + + - name: Upload checksum asset - osx-aarch64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin/defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin.tar.gz.SHA256 + asset_name: defichain-${{ env.BUILD_VERSION }}-aarch64-apple-darwin.tar.gz.SHA256 + asset_content_type: text/plain diff --git a/.github/workflows/tests-evm-rpc.yaml b/.github/workflows/tests-evm-ethlibs.yaml similarity index 83% rename from .github/workflows/tests-evm-rpc.yaml rename to .github/workflows/tests-evm-ethlibs.yaml index 8c2fdbb3044..9c1257c35aa 100644 --- a/.github/workflows/tests-evm-rpc.yaml +++ b/.github/workflows/tests-evm-ethlibs.yaml @@ -2,14 +2,12 @@ name: Tests - EVM on: workflow_dispatch: - pull_request: - branches: - - feature/evm push: branches: - - feature/evm - tags: - - evm + - master + pull_request: + branches: + - master env: NODE_URL: "http://127.0.0.1:19551/" @@ -21,10 +19,10 @@ jobs: - uses: actions/checkout@v3 - name: Install dependencies - run: sudo ./make.sh pkg-install-deps && sudo ./make.sh pkg-install-llvm + run: sudo ./make.sh ci-setup-deps && sudo ./make.sh ci-setup-deps-target - name: Build binaries - run: TARGET="x86_64-pc-linux-gnu" ./make.sh build + run: ./make.sh build - name: Upload binaries uses: actions/upload-artifact@v3 @@ -33,7 +31,7 @@ jobs: path: | build/src/defid build/src/defi-cli - .github/scripts/fixtures.sh + ci/test/ethlibs-fixtures.sh node-rpc-tests: runs-on: ubuntu-latest @@ -46,7 +44,7 @@ jobs: - name: Chores run: | - chmod uog+x build/src/defid build/src/defi-cli .github/scripts/fixtures.sh + chmod uog+x build/src/defid build/src/defi-cli ci/test/ethlibs-fixtures.sh - name: Run defid node run: | @@ -55,7 +53,7 @@ jobs: - name: Push fixtures run: | sleep 5 - ./.github/scripts/fixtures.sh + ./ci/test/ethlibs-fixtures.sh - name: Set up Go uses: actions/setup-go@v3 diff --git a/.github/scripts/fixtures.sh b/ci/test/ethlibs-fixtures.sh similarity index 100% rename from .github/scripts/fixtures.sh rename to ci/test/ethlibs-fixtures.sh From ede375617b247ce3a6b8d46ce169ce13cf00c038 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 13 Jun 2023 02:24:55 +0800 Subject: [PATCH 03/24] Fix tests, use apt-get in automation --- ci/test/main.sh | 3 +-- make.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ci/test/main.sh b/ci/test/main.sh index cb1832f8662..e61eb9f4b7c 100755 --- a/ci/test/main.sh +++ b/ci/test/main.sh @@ -8,8 +8,7 @@ main() { trap _cleanup 0 1 2 3 6 15 ERR cd "$_SCRIPT_DIR/../../" - sudo ./make.sh pkg-install-deps - sudo ./make.sh pkg-install-llvm + sudo ./make.sh ci-setup-deps && sudo ./make.sh ci-setup-deps-target ./make.sh build ./make.sh test } diff --git a/make.sh b/make.sh index 96e711e9c3a..3eca1d614d5 100755 --- a/make.sh +++ b/make.sh @@ -422,9 +422,9 @@ git_version() { pkg_update_base() { _fold_start "pkg-update-base" - apt update - apt install -y apt-transport-https - apt dist-upgrade -y + apt-get update + apt-get install -y apt-transport-https + apt-get upgrade -y _fold_end } @@ -435,7 +435,7 @@ pkg_install_deps() { # gcc-multilib: for cross compilations # locales: for using en-US.UTF-8 (see head of this file). - apt install -y \ + apt-get install -y \ software-properties-common build-essential git libtool autotools-dev automake \ pkg-config bsdmainutils python3 python3-pip libssl-dev libevent-dev libboost-system-dev \ libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \ @@ -449,7 +449,7 @@ pkg_install_deps() { pkg_install_deps_mingw_x86_64() { _fold_start "pkg-install-deps-mingw-x86_64" - apt install -y \ + apt-get install -y \ g++-mingw-w64-x86-64 mingw-w64-x86-64-dev _fold_end @@ -463,7 +463,7 @@ pkg_setup_mingw_x86_64() { pkg_install_deps_armhf() { _fold_start "pkg-install-deps-armhf" - apt install -y \ + apt-get install -y \ g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf libc6-dev-armhf-cross _fold_end @@ -472,7 +472,7 @@ pkg_install_deps_armhf() { pkg_install_deps_arm64() { _fold_start "pkg-install-deps-arm64" - apt install -y \ + apt-get install -y \ g++-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-dev-arm64-cross _fold_end @@ -481,7 +481,7 @@ pkg_install_deps_arm64() { pkg_install_deps_osx_tools() { _fold_start "pkg-install-deps-mac-tools" - apt install -y \ + apt-get install -y \ python3-dev libcap-dev libbz2-dev libz-dev fonts-tuffy librsvg2-bin libtiff-tools imagemagick libtinfo5 _fold_end From 320e9d5a875b610a6ef0651d6c71d2dd262f02ea Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 13 Jun 2023 10:04:21 +0800 Subject: [PATCH 04/24] Add PATH export to ci-vars --- make.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/make.sh b/make.sh index 3eca1d614d5..1ad7edc9e31 100755 --- a/make.sh +++ b/make.sh @@ -850,6 +850,7 @@ ci_export_vars() { if [[ -n "${GITHUB_ACTIONS-}" ]]; then # GitHub Actions echo "BUILD_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV" + echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV" fi } From 505f5927932d0055bbf6646f32c1b5aceda15a14 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 13 Jun 2023 10:04:56 +0800 Subject: [PATCH 05/24] Use ci-vars, cleanup --- .github/workflows/build-dev.yaml | 3 +++ .github/workflows/build-release.yaml | 20 +++++++++---------- ...ts-evm-ethlibs.yaml => tests-ethlibs.yaml} | 10 ++++++++-- .github/workflows/tests-jellyfish.yml | 2 +- .../dockerfiles/aarch64-linux-gnu.dockerfile | 2 -- .../arm-linux-gnueabihf.dockerfile | 2 -- contrib/dockerfiles/noarch.dockerfile | 2 -- .../x86_64-pc-linux-gnu.dockerfile | 2 -- 8 files changed, 22 insertions(+), 21 deletions(-) rename .github/workflows/{tests-evm-ethlibs.yaml => tests-ethlibs.yaml} (88%) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 0ebaa694231..f07860974b0 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -14,6 +14,9 @@ on: env: BUILD_VERSION: latest # Computed DOCKER_HUB_USER: defi + # Note: We use debug build on CI for dev as well, since debug builds take + # 5x the amount of space and run the GitHub CI workers out of space. make.sh + # still defaults to debug for local builds MAKE_DEBUG: 0 jobs: diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index beec0293a35..a187d9ca14c 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -180,16 +180,16 @@ jobs: set -e; ver=${{ env.BUILD_VERSION }} cd ./defichain-${ver}-x86_64-pc-linux-gnu sha256sum ./defichain-${ver}-x86_64-pc-linux-gnu.tar.gz > ./defichain-${ver}-x86_64-pc-linux-gnu.tar.gz.SHA256 - # cd ./defichain-${ver}-arm-linux-gnueabihf - # sha256sum ./defichain-${ver}-arm-linux-gnueabihf.tar.gz > ./defichain-${ver}-arm-linux-gnueabihf.tar.gz.SHA256 - # cd ./defichain-${ver}-aarch64-linux-gnu - # sha256sum ./defichain-${ver}-aarch64-linux-gnu.tar.gz > ./defichain-${ver}-aarch64-linux-gnu.tar.gz.SHA256 - # cd .. && cd ./defichain-${ver}-x86_64-w64-mingw32 - # sha256sum ./defichain-${ver}-x86_64-w64-mingw32.zip > ./defichain-${ver}-x86_64-w64-mingw32.zip.SHA256 - # cd .. && cd ./defichain-${ver}-x86_64-apple-darwin - # sha256sum ./defichain-${ver}-x86_64-apple-darwin.tar.gz > ././defichain-${ver}-x86_64-apple-darwin.tar.gz.SHA256 - # cd .. && cd ./defichain-${ver}-aarch64-apple-darwin - # sha256sum ./defichain-${ver}-aarch64-apple-darwin.tar.gz > ././defichain-${ver}-aarch64-apple-darwin.tar.gz.SHA256 + cd ./defichain-${ver}-arm-linux-gnueabihf + sha256sum ./defichain-${ver}-arm-linux-gnueabihf.tar.gz > ./defichain-${ver}-arm-linux-gnueabihf.tar.gz.SHA256 + cd ./defichain-${ver}-aarch64-linux-gnu + sha256sum ./defichain-${ver}-aarch64-linux-gnu.tar.gz > ./defichain-${ver}-aarch64-linux-gnu.tar.gz.SHA256 + cd .. && cd ./defichain-${ver}-x86_64-w64-mingw32 + sha256sum ./defichain-${ver}-x86_64-w64-mingw32.zip > ./defichain-${ver}-x86_64-w64-mingw32.zip.SHA256 + cd .. && cd ./defichain-${ver}-x86_64-apple-darwin + sha256sum ./defichain-${ver}-x86_64-apple-darwin.tar.gz > ././defichain-${ver}-x86_64-apple-darwin.tar.gz.SHA256 + cd .. && cd ./defichain-${ver}-aarch64-apple-darwin + sha256sum ./defichain-${ver}-aarch64-apple-darwin.tar.gz > ././defichain-${ver}-aarch64-apple-darwin.tar.gz.SHA256 - name: Upload release asset - linux-x64 uses: actions/upload-release-asset@v1 diff --git a/.github/workflows/tests-evm-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml similarity index 88% rename from .github/workflows/tests-evm-ethlibs.yaml rename to .github/workflows/tests-ethlibs.yaml index 9c1257c35aa..0edf4b77fba 100644 --- a/.github/workflows/tests-evm-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -1,4 +1,4 @@ -name: Tests - EVM +name: Tests - DeFiCh/go-ethlibs on: workflow_dispatch: @@ -18,8 +18,14 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Populate environment + run: GIT_VERSION=1 ./make.sh ci-export-vars + - name: Install dependencies - run: sudo ./make.sh ci-setup-deps && sudo ./make.sh ci-setup-deps-target + run: | + set -e; ./make.sh ci-export-vars + sudo ./make.sh ci-setup-deps + sudo ./make.sh ci-setup-deps-target - name: Build binaries run: ./make.sh build diff --git a/.github/workflows/tests-jellyfish.yml b/.github/workflows/tests-jellyfish.yml index b35f897d571..3155048ab80 100644 --- a/.github/workflows/tests-jellyfish.yml +++ b/.github/workflows/tests-jellyfish.yml @@ -1,4 +1,4 @@ -name: Tests - Jellyfish +name: Tests - JellyfishSDK on: workflow_dispatch: diff --git a/contrib/dockerfiles/aarch64-linux-gnu.dockerfile b/contrib/dockerfiles/aarch64-linux-gnu.dockerfile index 6cdff6528eb..f4b9d7ce89d 100644 --- a/contrib/dockerfiles/aarch64-linux-gnu.dockerfile +++ b/contrib/dockerfiles/aarch64-linux-gnu.dockerfile @@ -11,8 +11,6 @@ LABEL org.defichain.arch=${TARGET} WORKDIR /work COPY ./make.sh . -# Temporary workaround until https://github.com/DeFiCh/ain/pull/1946 lands -# with specific ci-* methods ENV PATH=/root/.cargo/bin:$PATH RUN ./make.sh ci-setup-deps RUN ./make.sh ci-setup-deps-target diff --git a/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile b/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile index a4fd4299209..50df21ceff9 100644 --- a/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile +++ b/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile @@ -11,8 +11,6 @@ LABEL org.defichain.arch=${TARGET} WORKDIR /work COPY ./make.sh . -# Temporary workaround until https://github.com/DeFiCh/ain/pull/1946 lands -# with specific ci-* methods ENV PATH=/root/.cargo/bin:$PATH RUN ./make.sh ci-setup-deps RUN ./make.sh ci-setup-deps-target diff --git a/contrib/dockerfiles/noarch.dockerfile b/contrib/dockerfiles/noarch.dockerfile index 7f74c15be47..1908a3239e2 100644 --- a/contrib/dockerfiles/noarch.dockerfile +++ b/contrib/dockerfiles/noarch.dockerfile @@ -13,8 +13,6 @@ LABEL org.defichain.arch=${TARGET} WORKDIR /work COPY ./make.sh . -# Temporary workaround until https://github.com/DeFiCh/ain/pull/1946 lands -# with specific ci-* methods ENV PATH=/root/.cargo/bin:$PATH RUN ./make.sh ci-setup-deps RUN ./make.sh ci-setup-deps-target diff --git a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile index 8a52729fe2c..8eb2fa98fd2 100644 --- a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile +++ b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile @@ -11,8 +11,6 @@ LABEL org.defichain.arch=${TARGET} WORKDIR /work COPY ./make.sh . -# Temporary workaround until https://github.com/DeFiCh/ain/pull/1946 lands -# with specific ci-* methods ENV PATH=/root/.cargo/bin:$PATH RUN ./make.sh ci-setup-deps RUN ./make.sh ci-setup-deps-target From 307426345e65deb818e71fd3087946747a523b29 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 13 Jun 2023 10:08:31 +0800 Subject: [PATCH 06/24] Remove repeated export --- .github/workflows/tests-ethlibs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index 0edf4b77fba..46a72b31de3 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -23,7 +23,7 @@ jobs: - name: Install dependencies run: | - set -e; ./make.sh ci-export-vars + set -e; sudo ./make.sh ci-setup-deps sudo ./make.sh ci-setup-deps-target From b9981896ad92eee5186c88ed2c5f5c7203082267 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 13 Jun 2023 15:32:12 +0800 Subject: [PATCH 07/24] Just install native deps --- .github/workflows/tests-ethlibs.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index 46a72b31de3..5326f983142 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -19,13 +19,10 @@ jobs: - uses: actions/checkout@v3 - name: Populate environment - run: GIT_VERSION=1 ./make.sh ci-export-vars + run: ./make.sh ci-export-vars - name: Install dependencies - run: | - set -e; - sudo ./make.sh ci-setup-deps - sudo ./make.sh ci-setup-deps-target + run: sudo ./make.sh ci-setup-deps - name: Build binaries run: ./make.sh build From 43c8c3d63df137332c241b8aebedaac00fcb6afe Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 13 Jun 2023 15:33:42 +0800 Subject: [PATCH 08/24] Update sync tests to the latest workflow --- .github/workflows/tests-sync.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests-sync.yml b/.github/workflows/tests-sync.yml index aa19af72cd8..8197b1d469b 100644 --- a/.github/workflows/tests-sync.yml +++ b/.github/workflows/tests-sync.yml @@ -26,18 +26,24 @@ jobs: with: fetch-depth: 0 - - name: Build node + - name: Populate environment + run: ./make.sh ci-export-vars + + - name: Install dependencies + run: sudo ./make.sh ci-setup-deps + # TODO: Switch this to a docker build later and this builds on the native # VM toolchain and loses disparity with the CI release builds - run: TARGET="x86_64-pc-linux-gnu" ./make.sh build + - name: Build binaries + run: ./make.sh build - name: Upload binaries uses: actions/upload-artifact@v3 with: name: defibins path: | - build/x86_64-pc-linux-gnu/src/defid - build/x86_64-pc-linux-gnu/src/defi-cli + build/src/defid + build/src/defi-cli - name: Upload shell commands uses: actions/upload-artifact@v3 From 3e24dc82c0256fad9cacf1529f43b1d51359e213 Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 16:38:27 +0800 Subject: [PATCH 09/24] Fix docker arg naming --- contrib/dockerfiles/aarch64-linux-gnu.dockerfile | 4 ++-- contrib/dockerfiles/arm-linux-gnueabihf.dockerfile | 4 ++-- contrib/dockerfiles/noarch.dockerfile | 4 ++-- contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile | 4 ++-- make.sh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/dockerfiles/aarch64-linux-gnu.dockerfile b/contrib/dockerfiles/aarch64-linux-gnu.dockerfile index f4b9d7ce89d..05cbaf7ffd8 100644 --- a/contrib/dockerfiles/aarch64-linux-gnu.dockerfile +++ b/contrib/dockerfiles/aarch64-linux-gnu.dockerfile @@ -4,7 +4,7 @@ ARG TARGET=aarch64-linux-gnu # https://github.com/DeFiCh/containers/blob/main/ain-builder/Dockerfile FROM --platform=linux/amd64 docker.io/defi/ain-builder as builder ARG TARGET -ARG DEBUG +ARG MAKE_DEBUG LABEL org.defichain.name="defichain-builder" LABEL org.defichain.arch=${TARGET} @@ -17,7 +17,7 @@ RUN ./make.sh ci-setup-deps-target COPY . . RUN ./make.sh build-deps -RUN MAKE_DEBUG=${DEBUG} ./make.sh build-conf +RUN MAKE_DEBUG=${MAKE_DEBUG} ./make.sh build-conf RUN ./make.sh build-make RUN mkdir /app && cd build/ && \ diff --git a/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile b/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile index 50df21ceff9..5f4ece77032 100644 --- a/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile +++ b/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile @@ -4,7 +4,7 @@ ARG TARGET=arm-linux-gnueabihf # https://github.com/DeFiCh/containers/blob/main/ain-builder/Dockerfile FROM --platform=linux/amd64 docker.io/defi/ain-builder as builder ARG TARGET -ARG DEBUG +ARG MAKE_DEBUG LABEL org.defichain.name="defichain-builder" LABEL org.defichain.arch=${TARGET} @@ -17,7 +17,7 @@ RUN ./make.sh ci-setup-deps-target COPY . . RUN ./make.sh build-deps -RUN MAKE_DEBUG=${DEBUG} ./make.sh build-conf +RUN MAKE_DEBUG=${MAKE_DEBUG} ./make.sh build-conf RUN ./make.sh build-make RUN mkdir /app && cd build/ && \ diff --git a/contrib/dockerfiles/noarch.dockerfile b/contrib/dockerfiles/noarch.dockerfile index 1908a3239e2..1f8b74e11c5 100644 --- a/contrib/dockerfiles/noarch.dockerfile +++ b/contrib/dockerfiles/noarch.dockerfile @@ -6,7 +6,7 @@ ARG TARGET=unknown # ----------- FROM ubuntu:latest as builder ARG TARGET -ARG DEBUG +ARG MAKE_DEBUG LABEL org.defichain.name="defichain-builder" LABEL org.defichain.arch=${TARGET} @@ -19,7 +19,7 @@ RUN ./make.sh ci-setup-deps-target COPY . . RUN ./make.sh build-deps -RUN MAKE_DEBUG=${DEBUG} ./make.sh build-conf +RUN MAKE_DEBUG=${MAKE_DEBUG} ./make.sh build-conf RUN ./make.sh build-make RUN mkdir /app && cd build/ && \ diff --git a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile index 8eb2fa98fd2..f22b8021e98 100644 --- a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile +++ b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile @@ -4,7 +4,7 @@ ARG TARGET=x86_64-pc-linux-gnu # https://github.com/DeFiCh/containers/blob/main/ain-builder/Dockerfile FROM --platform=linux/amd64 docker.io/defi/ain-builder as builder ARG TARGET -ARG DEBUG +ARG MAKE_DEBUG LABEL org.defichain.name="defichain-builder" LABEL org.defichain.arch=${TARGET} @@ -17,7 +17,7 @@ RUN ./make.sh ci-setup-deps-target COPY . . RUN ./make.sh build-deps -RUN MAKE_DEBUG=${DEBUG} ./make.sh build-conf +RUN MAKE_DEBUG=${MAKE_DEBUG} ./make.sh build-conf RUN ./make.sh build-make RUN mkdir /app && cd build/ && \ diff --git a/make.sh b/make.sh index 1ad7edc9e31..992fea8c967 100755 --- a/make.sh +++ b/make.sh @@ -261,7 +261,7 @@ docker_build() { local img="${img_prefix}-${target}:${img_version}" echo "> building: ${img}" echo "> docker build: ${img}" - docker build -f "${docker_file}" --build-arg TARGET="${target}" --build-arg DEBUG="${MAKE_DEBUG}" -t "${img}" "${docker_context}" + docker build -f "${docker_file}" --build-arg TARGET="${target}" --build-arg MAKE_DEBUG="${MAKE_DEBUG}" -t "${img}" "${docker_context}" } docker_deploy() { From b0e5aa9d0b3db5a68ce8ed26ae0433f728f5d297 Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 16:53:17 +0800 Subject: [PATCH 10/24] Fix dockerfiles --- contrib/dockerfiles/aarch64-linux-gnu.dockerfile | 2 +- contrib/dockerfiles/arm-linux-gnueabihf.dockerfile | 2 +- contrib/dockerfiles/noarch.dockerfile | 2 +- contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/dockerfiles/aarch64-linux-gnu.dockerfile b/contrib/dockerfiles/aarch64-linux-gnu.dockerfile index 05cbaf7ffd8..b6f901b229e 100644 --- a/contrib/dockerfiles/aarch64-linux-gnu.dockerfile +++ b/contrib/dockerfiles/aarch64-linux-gnu.dockerfile @@ -17,7 +17,7 @@ RUN ./make.sh ci-setup-deps-target COPY . . RUN ./make.sh build-deps -RUN MAKE_DEBUG=${MAKE_DEBUG} ./make.sh build-conf +RUN ./make.sh build-conf RUN ./make.sh build-make RUN mkdir /app && cd build/ && \ diff --git a/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile b/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile index 5f4ece77032..63789fa2409 100644 --- a/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile +++ b/contrib/dockerfiles/arm-linux-gnueabihf.dockerfile @@ -17,7 +17,7 @@ RUN ./make.sh ci-setup-deps-target COPY . . RUN ./make.sh build-deps -RUN MAKE_DEBUG=${MAKE_DEBUG} ./make.sh build-conf +RUN ./make.sh build-conf RUN ./make.sh build-make RUN mkdir /app && cd build/ && \ diff --git a/contrib/dockerfiles/noarch.dockerfile b/contrib/dockerfiles/noarch.dockerfile index 1f8b74e11c5..3e1ebcf20b5 100644 --- a/contrib/dockerfiles/noarch.dockerfile +++ b/contrib/dockerfiles/noarch.dockerfile @@ -19,7 +19,7 @@ RUN ./make.sh ci-setup-deps-target COPY . . RUN ./make.sh build-deps -RUN MAKE_DEBUG=${MAKE_DEBUG} ./make.sh build-conf +RUN ./make.sh build-conf RUN ./make.sh build-make RUN mkdir /app && cd build/ && \ diff --git a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile index f22b8021e98..f265d7518bf 100644 --- a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile +++ b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile @@ -17,7 +17,7 @@ RUN ./make.sh ci-setup-deps-target COPY . . RUN ./make.sh build-deps -RUN MAKE_DEBUG=${MAKE_DEBUG} ./make.sh build-conf +RUN ./make.sh build-conf RUN ./make.sh build-make RUN mkdir /app && cd build/ && \ From 1d12ba557cd7abada425e0db2263f516de350b2b Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 13 Jun 2023 16:49:29 +0800 Subject: [PATCH 11/24] Build arg fixes --- make.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/make.sh b/make.sh index 992fea8c967..b52aac483a9 100755 --- a/make.sh +++ b/make.sh @@ -261,7 +261,10 @@ docker_build() { local img="${img_prefix}-${target}:${img_version}" echo "> building: ${img}" echo "> docker build: ${img}" - docker build -f "${docker_file}" --build-arg TARGET="${target}" --build-arg MAKE_DEBUG="${MAKE_DEBUG}" -t "${img}" "${docker_context}" + docker build -f "${docker_file}" \ + --build-arg TARGET="${target}" \ + --build-arg MAKE_DEBUG="${MAKE_DEBUG}" \ + -t "${img}" "${docker_context}" } docker_deploy() { From b7877d564e23aae854f606023fb24fab8cf597cd Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 20:31:23 +0800 Subject: [PATCH 12/24] Fix tests-e2e workflow to export ci var, add debug logs --- .github/workflows/tests-e2e.yaml | 6 ++++++ ci/test/main.sh | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-e2e.yaml b/.github/workflows/tests-e2e.yaml index f8cd24236a8..35e231e2604 100644 --- a/.github/workflows/tests-e2e.yaml +++ b/.github/workflows/tests-e2e.yaml @@ -27,6 +27,12 @@ jobs: uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} + + - name: Populate environment + run: ./make.sh ci-export-vars + - name: Install dependencies + run: sudo ./make.sh ci-setup-deps && echo $PATH + - name: Tests run: ./ci/test/main.sh diff --git a/ci/test/main.sh b/ci/test/main.sh index e61eb9f4b7c..082da957a49 100755 --- a/ci/test/main.sh +++ b/ci/test/main.sh @@ -8,7 +8,6 @@ main() { trap _cleanup 0 1 2 3 6 15 ERR cd "$_SCRIPT_DIR/../../" - sudo ./make.sh ci-setup-deps && sudo ./make.sh ci-setup-deps-target ./make.sh build ./make.sh test } From 451e6fc8008ac7bcb5dcce0e7af83899e2c8d4ca Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 20:36:16 +0800 Subject: [PATCH 13/24] Add debug log --- .github/workflows/tests-ethlibs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index 5326f983142..d96aacbcaf7 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -22,7 +22,7 @@ jobs: run: ./make.sh ci-export-vars - name: Install dependencies - run: sudo ./make.sh ci-setup-deps + run: sudo ./make.sh ci-setup-deps && echo $PATH - name: Build binaries run: ./make.sh build From 1d1e31e7edc2b2a4d94724e00bc5615ec0acd5a0 Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 20:59:23 +0800 Subject: [PATCH 14/24] Debug logs --- .github/workflows/tests-e2e.yaml | 5 ++++- .github/workflows/tests-ethlibs.yaml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-e2e.yaml b/.github/workflows/tests-e2e.yaml index 35e231e2604..26ff87c28dc 100644 --- a/.github/workflows/tests-e2e.yaml +++ b/.github/workflows/tests-e2e.yaml @@ -32,7 +32,10 @@ jobs: run: ./make.sh ci-export-vars - name: Install dependencies - run: sudo ./make.sh ci-setup-deps && echo $PATH + run: sudo ./make.sh ci-setup-deps + + - name: Debug + run: echo $PATH - name: Tests run: ./ci/test/main.sh diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index d96aacbcaf7..56ea4616837 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -22,7 +22,10 @@ jobs: run: ./make.sh ci-export-vars - name: Install dependencies - run: sudo ./make.sh ci-setup-deps && echo $PATH + run: sudo ./make.sh ci-setup-deps + + - name: Debug + run: echo $PATH - name: Build binaries run: ./make.sh build From 7a18fc52a67442a62340b549ad8d45f024ca013a Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 21:05:16 +0800 Subject: [PATCH 15/24] Fix debug log --- .github/workflows/tests-e2e.yaml | 6 +++--- .github/workflows/tests-ethlibs.yaml | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests-e2e.yaml b/.github/workflows/tests-e2e.yaml index 26ff87c28dc..70c6d3445a8 100644 --- a/.github/workflows/tests-e2e.yaml +++ b/.github/workflows/tests-e2e.yaml @@ -31,11 +31,11 @@ jobs: - name: Populate environment run: ./make.sh ci-export-vars - - name: Install dependencies - run: sudo ./make.sh ci-setup-deps - - name: Debug run: echo $PATH + + - name: Install dependencies + run: sudo ./make.sh ci-setup-deps - name: Tests run: ./ci/test/main.sh diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index 56ea4616837..5326f983142 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -23,9 +23,6 @@ jobs: - name: Install dependencies run: sudo ./make.sh ci-setup-deps - - - name: Debug - run: echo $PATH - name: Build binaries run: ./make.sh build From d097834467625948b933a4f00e1d6c5edcd9e1e3 Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 21:31:41 +0800 Subject: [PATCH 16/24] Debug ci --- .github/workflows/tests-e2e.yaml | 3 --- make.sh | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests-e2e.yaml b/.github/workflows/tests-e2e.yaml index 70c6d3445a8..fff5fce6fdd 100644 --- a/.github/workflows/tests-e2e.yaml +++ b/.github/workflows/tests-e2e.yaml @@ -31,9 +31,6 @@ jobs: - name: Populate environment run: ./make.sh ci-export-vars - - name: Debug - run: echo $PATH - - name: Install dependencies run: sudo ./make.sh ci-setup-deps diff --git a/make.sh b/make.sh index b52aac483a9..189ce438669 100755 --- a/make.sh +++ b/make.sh @@ -538,6 +538,7 @@ pkg_setup_rust() { local target=${TARGET} local rust_target rust_target=$(get_rust_target) + find / -type d -name ".cargo" rustup target add "${rust_target}" } From fed16edbbb17ae3ff9115e927b264a628289eb3b Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 21:33:51 +0800 Subject: [PATCH 17/24] sudo permissons --- make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.sh b/make.sh index 189ce438669..6d372cf7eb8 100755 --- a/make.sh +++ b/make.sh @@ -538,7 +538,7 @@ pkg_setup_rust() { local target=${TARGET} local rust_target rust_target=$(get_rust_target) - find / -type d -name ".cargo" + sudo find / -type d -name ".cargo" rustup target add "${rust_target}" } From 7948050bee8b4650e0088729ba6b104850a8e29e Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 21:40:32 +0800 Subject: [PATCH 18/24] Change cargo dir to root --- make.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/make.sh b/make.sh index 6d372cf7eb8..d7ddff7390d 100755 --- a/make.sh +++ b/make.sh @@ -538,7 +538,6 @@ pkg_setup_rust() { local target=${TARGET} local rust_target rust_target=$(get_rust_target) - sudo find / -type d -name ".cargo" rustup target add "${rust_target}" } @@ -854,7 +853,7 @@ ci_export_vars() { if [[ -n "${GITHUB_ACTIONS-}" ]]; then # GitHub Actions echo "BUILD_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV" - echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV" + echo "PATH=/root/.cargo/bin:$PATH" >> "$GITHUB_ENV" fi } From c98a904a8ccae8b20ed720d42ce5afbd2f03de39 Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 22:01:40 +0800 Subject: [PATCH 19/24] Run set up separately --- .github/workflows/tests-e2e.yaml | 3 +++ make.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-e2e.yaml b/.github/workflows/tests-e2e.yaml index fff5fce6fdd..908a1b3e07e 100644 --- a/.github/workflows/tests-e2e.yaml +++ b/.github/workflows/tests-e2e.yaml @@ -33,6 +33,9 @@ jobs: - name: Install dependencies run: sudo ./make.sh ci-setup-deps + + - name: Setup rust + run: ./make.sh pkg_setup_rust - name: Tests run: ./ci/test/main.sh diff --git a/make.sh b/make.sh index d7ddff7390d..f6378925df0 100755 --- a/make.sh +++ b/make.sh @@ -862,7 +862,7 @@ ci_setup_deps() { DEBIAN_FRONTEND=noninteractive pkg_install_deps DEBIAN_FRONTEND=noninteractive pkg_install_llvm DEBIAN_FRONTEND=noninteractive pkg_install_rust - pkg_setup_rust + # pkg_setup_rust pkg_install_web3_deps } From 69a8c88c580d329a5de83d6d1669a0d063b6e7ae Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 22:36:13 +0800 Subject: [PATCH 20/24] Fix rustup command not found bug --- .github/workflows/tests-e2e.yaml | 6 +++--- .github/workflows/tests-ethlibs.yaml | 3 +++ make.sh | 7 ++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests-e2e.yaml b/.github/workflows/tests-e2e.yaml index 908a1b3e07e..98d7a14080f 100644 --- a/.github/workflows/tests-e2e.yaml +++ b/.github/workflows/tests-e2e.yaml @@ -33,9 +33,9 @@ jobs: - name: Install dependencies run: sudo ./make.sh ci-setup-deps - - - name: Setup rust - run: ./make.sh pkg_setup_rust + + - name: Setup target + run: sudo ./make.sh ci-setup-deps-target - name: Tests run: ./ci/test/main.sh diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index 5326f983142..a850714f784 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -24,6 +24,9 @@ jobs: - name: Install dependencies run: sudo ./make.sh ci-setup-deps + - name: Setup target + run: sudo ./make.sh ci-setup-deps-target + - name: Build binaries run: ./make.sh build diff --git a/make.sh b/make.sh index f6378925df0..ba65a5362d6 100755 --- a/make.sh +++ b/make.sh @@ -535,7 +535,6 @@ pkg_install_web3_deps() { } pkg_setup_rust() { - local target=${TARGET} local rust_target rust_target=$(get_rust_target) rustup target add "${rust_target}" @@ -853,7 +852,7 @@ ci_export_vars() { if [[ -n "${GITHUB_ACTIONS-}" ]]; then # GitHub Actions echo "BUILD_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV" - echo "PATH=/root/.cargo/bin:$PATH" >> "$GITHUB_ENV" + echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV" fi } @@ -862,7 +861,6 @@ ci_setup_deps() { DEBIAN_FRONTEND=noninteractive pkg_install_deps DEBIAN_FRONTEND=noninteractive pkg_install_llvm DEBIAN_FRONTEND=noninteractive pkg_install_rust - # pkg_setup_rust pkg_install_web3_deps } @@ -884,6 +882,9 @@ ci_setup_deps_target() { echo "error: unsupported target: ${target}" exit 1;; esac + + # setup rust target + pkg_setup_rust } get_rust_target() { From 8a8185c741f420a18b00bec4d1e93b6e7256a08f Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 22:38:03 +0800 Subject: [PATCH 21/24] Fix test-sync --- .github/workflows/tests-sync.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests-sync.yml b/.github/workflows/tests-sync.yml index 8197b1d469b..84a6e18ec2c 100644 --- a/.github/workflows/tests-sync.yml +++ b/.github/workflows/tests-sync.yml @@ -32,6 +32,9 @@ jobs: - name: Install dependencies run: sudo ./make.sh ci-setup-deps + - name: Setup target + run: sudo ./make.sh ci-setup-deps-target + # TODO: Switch this to a docker build later and this builds on the native # VM toolchain and loses disparity with the CI release builds - name: Build binaries From 1e75088f62855656d559479fd094e01f5e6d11ed Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 22:45:07 +0800 Subject: [PATCH 22/24] Remove sudo privileges --- .github/workflows/tests-e2e.yaml | 2 +- .github/workflows/tests-ethlibs.yaml | 2 +- .github/workflows/tests-sync.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests-e2e.yaml b/.github/workflows/tests-e2e.yaml index 98d7a14080f..d714a6c648b 100644 --- a/.github/workflows/tests-e2e.yaml +++ b/.github/workflows/tests-e2e.yaml @@ -35,7 +35,7 @@ jobs: run: sudo ./make.sh ci-setup-deps - name: Setup target - run: sudo ./make.sh ci-setup-deps-target + run: ./make.sh ci-setup-deps-target - name: Tests run: ./ci/test/main.sh diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index a850714f784..46af2149401 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -25,7 +25,7 @@ jobs: run: sudo ./make.sh ci-setup-deps - name: Setup target - run: sudo ./make.sh ci-setup-deps-target + run: ./make.sh ci-setup-deps-target - name: Build binaries run: ./make.sh build diff --git a/.github/workflows/tests-sync.yml b/.github/workflows/tests-sync.yml index 84a6e18ec2c..13e0432105c 100644 --- a/.github/workflows/tests-sync.yml +++ b/.github/workflows/tests-sync.yml @@ -33,7 +33,7 @@ jobs: run: sudo ./make.sh ci-setup-deps - name: Setup target - run: sudo ./make.sh ci-setup-deps-target + run: ./make.sh ci-setup-deps-target # TODO: Switch this to a docker build later and this builds on the native # VM toolchain and loses disparity with the CI release builds From 2db3324909ef660318ac5bd050104f4be540a634 Mon Sep 17 00:00:00 2001 From: Niven Date: Tue, 13 Jun 2023 22:52:58 +0800 Subject: [PATCH 23/24] Refactor setup target dependency --- make.sh | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/make.sh b/make.sh index ba65a5362d6..cc538842b4f 100755 --- a/make.sh +++ b/make.sh @@ -540,6 +540,26 @@ pkg_setup_rust() { rustup target add "${rust_target}" } +pkg_setup_deps_target() { + local target=${TARGET} + case $target in + # Nothing to do on host + x86_64-pc-linux-gnu) ;; + aarch64-linux-gnu) + DEBIAN_FRONTEND=noninteractive pkg_install_deps_arm64;; + arm-linux-gnueabihf) + DEBIAN_FRONTEND=noninteractive pkg_install_deps_armhf;; + x86_64-apple-darwin|aarch64-apple-darwin) + DEBIAN_FRONTEND=noninteractive pkg_install_deps_osx_tools;; + x86_64-w64-mingw32) + DEBIAN_FRONTEND=noninteractive pkg_install_deps_mingw_x86_64 + pkg_setup_mingw_x86_64;; + *) + echo "error: unsupported target: ${target}" + exit 1;; + esac +} + clean_pkg_local_osx_sysroot() { local build_depends_dir="${BUILD_DEPENDS_DIR}" _safe_rm_rf "$build_depends_dir/SDKs" @@ -865,26 +885,8 @@ ci_setup_deps() { } ci_setup_deps_target() { - local target=${TARGET} - case $target in - # Nothing to do on host - x86_64-pc-linux-gnu) ;; - aarch64-linux-gnu) - DEBIAN_FRONTEND=noninteractive pkg_install_deps_arm64;; - arm-linux-gnueabihf) - DEBIAN_FRONTEND=noninteractive pkg_install_deps_armhf;; - x86_64-apple-darwin|aarch64-apple-darwin) - DEBIAN_FRONTEND=noninteractive pkg_install_deps_osx_tools;; - x86_64-w64-mingw32) - DEBIAN_FRONTEND=noninteractive pkg_install_deps_mingw_x86_64 - pkg_setup_mingw_x86_64;; - *) - echo "error: unsupported target: ${target}" - exit 1;; - esac - - # setup rust target pkg_setup_rust + pkg_setup_deps_target } get_rust_target() { From 47e07c4a0f1dbd61fdc58f9349e26a3e7403274c Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Wed, 14 Jun 2023 00:38:40 +0800 Subject: [PATCH 24/24] Add comments, minor changes --- make.sh | 52 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/make.sh b/make.sh index cc538842b4f..5481f7ed3ec 100755 --- a/make.sh +++ b/make.sh @@ -422,6 +422,16 @@ git_version() { fi } +# ------------ pkg -------------------- +# Conventions: +# - pkg_* +# - pkg_install_*: for installing packages (system level) +# - pkg_update_*: distro update only +# - pkg_local_*: for pulling packages into the local dir +# - clean_pkg_local*: Make sure to have the opp. +# - pkg_setup*: setup of existing (or installed) pkgs // but not installing now + + pkg_update_base() { _fold_start "pkg-update-base" @@ -540,26 +550,6 @@ pkg_setup_rust() { rustup target add "${rust_target}" } -pkg_setup_deps_target() { - local target=${TARGET} - case $target in - # Nothing to do on host - x86_64-pc-linux-gnu) ;; - aarch64-linux-gnu) - DEBIAN_FRONTEND=noninteractive pkg_install_deps_arm64;; - arm-linux-gnueabihf) - DEBIAN_FRONTEND=noninteractive pkg_install_deps_armhf;; - x86_64-apple-darwin|aarch64-apple-darwin) - DEBIAN_FRONTEND=noninteractive pkg_install_deps_osx_tools;; - x86_64-w64-mingw32) - DEBIAN_FRONTEND=noninteractive pkg_install_deps_mingw_x86_64 - pkg_setup_mingw_x86_64;; - *) - echo "error: unsupported target: ${target}" - exit 1;; - esac -} - clean_pkg_local_osx_sysroot() { local build_depends_dir="${BUILD_DEPENDS_DIR}" _safe_rm_rf "$build_depends_dir/SDKs" @@ -884,9 +874,29 @@ ci_setup_deps() { pkg_install_web3_deps } +_ci_setup_deps_target() { + local target=${TARGET} + case $target in + # Nothing to do on host + x86_64-pc-linux-gnu) ;; + aarch64-linux-gnu) + DEBIAN_FRONTEND=noninteractive pkg_install_deps_arm64;; + arm-linux-gnueabihf) + DEBIAN_FRONTEND=noninteractive pkg_install_deps_armhf;; + x86_64-apple-darwin|aarch64-apple-darwin) + DEBIAN_FRONTEND=noninteractive pkg_install_deps_osx_tools;; + x86_64-w64-mingw32) + DEBIAN_FRONTEND=noninteractive pkg_install_deps_mingw_x86_64 + pkg_setup_mingw_x86_64;; + *) + echo "error: unsupported target: ${target}" + exit 1;; + esac +} + ci_setup_deps_target() { + _ci_setup_deps_target pkg_setup_rust - pkg_setup_deps_target } get_rust_target() {