From 74ebb5b57e70fcc748bb2701a6a2e8821cfebeba Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 16 Oct 2024 21:12:17 +0200 Subject: [PATCH 01/12] Fix Nim version 2 and update key namings to better fit. --- .github/actions/install_nim/action.yml | 6 +++--- .github/workflows/ci.yml | 15 +++++++++------ .github/workflows/daily_amd64.yml | 2 +- .github/workflows/daily_common.yml | 6 +++--- .github/workflows/daily_devel.yml | 2 +- .github/workflows/daily_i386.yml | 2 +- .github/workflows/daily_sat.yml | 2 +- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/actions/install_nim/action.yml b/.github/actions/install_nim/action.yml index 83de4f313a..96bdcec2aa 100644 --- a/.github/actions/install_nim/action.yml +++ b/.github/actions/install_nim/action.yml @@ -6,7 +6,7 @@ inputs: cpu: description: "CPU to build for" default: "amd64" - nim_branch: + nim_ref: description: "Nim version" default: "version-1-6" shell: @@ -117,7 +117,7 @@ runs: uses: actions/cache@v4 with: path: '${{ github.workspace }}/nim' - key: ${{ inputs.os }}-${{ inputs.cpu }}-nim-${{ inputs.nim_branch }}-cache-${{ env.cache_nonce }} + key: ${{ inputs.os }}-${{ inputs.cpu }}-nim-${{ inputs.nim_ref }}-cache-${{ env.cache_nonce }} - name: Build Nim and Nimble shell: ${{ inputs.shell }} @@ -126,6 +126,6 @@ runs: # We don't want partial matches of the cache restored rm -rf nim curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh - env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} NIM_COMMIT=${{ inputs.nim_branch }} \ + env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} NIM_COMMIT=${{ inputs.nim_ref }} \ QUICK_AND_DIRTY_COMPILER=1 QUICK_AND_DIRTY_NIMBLE=1 CC=gcc \ bash build_nim.sh nim csources dist/nimble NimBinaries diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3187c55027..48817b7686 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,9 +30,12 @@ jobs: - os: windows cpu: amd64 nim: - - branch: version-1-6 + - ref: version-1-6 memory_management: refc - - branch: version-2-0 + # The ref below corresponds to the branch "version-2-0". + # Right before an update from Nimble 0.16.1 to 0.16.2. + # That update breaks our dependency resolution. + - ref: 8754469f4947844c5938f56e1fba846c349354b5 memory_management: refc include: - platform: @@ -56,7 +59,7 @@ jobs: run: shell: ${{ matrix.shell }} - name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.branch }})' + name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.ref }})' runs-on: ${{ matrix.builder }} steps: - name: Checkout @@ -70,7 +73,7 @@ jobs: os: ${{ matrix.platform.os }} cpu: ${{ matrix.platform.cpu }} shell: ${{ matrix.shell }} - nim_branch: ${{ matrix.nim.branch }} + nim_ref: ${{ matrix.nim.ref }} - name: Setup Go uses: actions/setup-go@v5 @@ -86,9 +89,9 @@ jobs: uses: actions/cache@v3 with: path: nimbledeps - # Using nim.branch as a simple way to differentiate between nimble using the "pkgs" or "pkgs2" directories. + # Using nim.ref as a simple way to differentiate between nimble using the "pkgs" or "pkgs2" directories. # The change happened on Nimble v0.14.0. - key: nimbledeps-${{ matrix.nim.branch }}-${{ hashFiles('.pinned') }} # hashFiles returns a different value on windows + key: nimbledeps-${{ matrix.nim.ref }}-${{ hashFiles('.pinned') }} # hashFiles returns a different value on windows - name: Install deps if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} diff --git a/.github/workflows/daily_amd64.yml b/.github/workflows/daily_amd64.yml index d1fc560bde..7e2e76570a 100644 --- a/.github/workflows/daily_amd64.yml +++ b/.github/workflows/daily_amd64.yml @@ -10,5 +10,5 @@ jobs: name: Daily amd64 uses: ./.github/workflows/daily_common.yml with: - nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}]" + nim: "[{'ref': 'version-1-6', 'memory_management': 'refc'}, {'ref': '8754469f4947844c5938f56e1fba846c349354b5', 'memory_management': 'refc'}]" cpu: "['amd64']" diff --git a/.github/workflows/daily_common.yml b/.github/workflows/daily_common.yml index a5ae19c5aa..687dd4af16 100644 --- a/.github/workflows/daily_common.yml +++ b/.github/workflows/daily_common.yml @@ -7,7 +7,7 @@ on: nim: description: 'Nim Configuration' required: true - type: string # Following this format: [{"branch": ..., "memory_management": ...}, ...] + type: string # Following this format: [{"ref": ..., "memory_management": ...}, ...] cpu: description: 'CPU' required: true @@ -58,7 +58,7 @@ jobs: run: shell: ${{ matrix.platform.shell }} - name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.branch }})' + name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.ref }})' runs-on: ${{ matrix.platform.builder }} steps: - name: Checkout @@ -69,7 +69,7 @@ jobs: with: os: ${{ matrix.platform.os }} shell: ${{ matrix.platform.shell }} - nim_branch: ${{ matrix.nim.branch }} + nim_ref: ${{ matrix.nim.ref }} cpu: ${{ matrix.cpu }} - name: Setup Go diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index d2481f43b6..ca31349f9a 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -10,5 +10,5 @@ jobs: name: Daily Nim Devel uses: ./.github/workflows/daily_common.yml with: - nim: "[{'branch': 'devel', 'memory_management': 'orc'}]" + nim: "[{'ref': 'devel', 'memory_management': 'orc'}]" cpu: "['amd64']" diff --git a/.github/workflows/daily_i386.yml b/.github/workflows/daily_i386.yml index cdbec7f956..f6adf490b0 100644 --- a/.github/workflows/daily_i386.yml +++ b/.github/workflows/daily_i386.yml @@ -10,6 +10,6 @@ jobs: name: Daily i386 (Linux) uses: ./.github/workflows/daily_common.yml with: - nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}, {'branch': 'devel', 'memory_management': 'orc'}]" + nim: "[{'ref': 'version-1-6', 'memory_management': 'refc'}, {'ref': '8754469f4947844c5938f56e1fba846c349354b5', 'memory_management': 'refc'}, {'ref': 'devel', 'memory_management': 'orc'}]" cpu: "['i386']" exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" diff --git a/.github/workflows/daily_sat.yml b/.github/workflows/daily_sat.yml index f9bb9d7ff0..a3bcc14a53 100644 --- a/.github/workflows/daily_sat.yml +++ b/.github/workflows/daily_sat.yml @@ -10,6 +10,6 @@ jobs: name: Daily SAT uses: ./.github/workflows/daily_common.yml with: - nim: "[{'branch': 'version-2-0', 'memory_management': 'refc'}]" + nim: "[{'ref': '8754469f4947844c5938f56e1fba846c349354b5', 'memory_management': 'refc'}]" cpu: "['amd64']" use_sat_solver: true From d11b4b8647740f38e7f76492dfdef08aa7ec219c Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 18 Oct 2024 19:37:42 +0200 Subject: [PATCH 02/12] Revert nim version to version-2-0 but use legacy solver. --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48817b7686..0e48fe9580 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: # The ref below corresponds to the branch "version-2-0". # Right before an update from Nimble 0.16.1 to 0.16.2. # That update breaks our dependency resolution. - - ref: 8754469f4947844c5938f56e1fba846c349354b5 + - ref: version-2-0 memory_management: refc include: - platform: @@ -95,8 +95,9 @@ jobs: - name: Install deps if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} + # The reason for using solver:legacy is to avoid an error in Nimble 0.16.2 where SAT is not able to check the dependencies. run: | - nimble install_pinned + nimble --nimbleDir:nimbledeps --solver:legacy install_pinned - name: Use gcc 14 if : ${{ matrix.platform.os == 'linux-gcc-14'}} From 10a844807a3526952bc7d85633d061d96bbaa301 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 21 Oct 2024 10:34:53 +0200 Subject: [PATCH 03/12] Add missing legacy solver flag. --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e48fe9580..856f71bee3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: - name: Install deps if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} - # The reason for using solver:legacy is to avoid an error in Nimble 0.16.2 where SAT is not able to check the dependencies. + # The reason for using solver:legacy is to avoid an error in Nimble 0.16.2 where SAT is not able to check the dependencies. run: | nimble --nimbleDir:nimbledeps --solver:legacy install_pinned @@ -109,9 +109,10 @@ jobs: sudo update-alternatives --set gcc /usr/bin/gcc-14 - name: Run tests + # The reason for using solver:legacy is to avoid an error in Nimble 0.16.2 where SAT is not able to check the dependencies. run: | nim --version nimble --version gcc --version - NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" + NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }} --solver:legacy" nimble test From 0a8f1011da120ac63d98dbbc2d6b7abb29050284 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 21 Oct 2024 12:54:51 +0200 Subject: [PATCH 04/12] Update pinned test deps --- .pinned | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pinned b/.pinned index d996ac9cd9..9f31a694f8 100644 --- a/.pinned +++ b/.pinned @@ -13,7 +13,7 @@ results;https://github.com/arnetheduck/nim-results@#f3c666a272c69d70cb41e7245e7f secp256k1;https://github.com/status-im/nim-secp256k1@#7246d91c667f4cc3759fdd50339caa45a2ecd8be serialization;https://github.com/status-im/nim-serialization@#4bdbc29e54fe54049950e352bb969aab97173b35 stew;https://github.com/status-im/nim-stew@#3159137d9a3110edb4024145ce0ba778975de40e -testutils;https://github.com/status-im/nim-testutils@#dfc4c1b39f9ded9baf6365014de2b4bfb4dafc34 -unittest2;https://github.com/status-im/nim-unittest2@#2300fa9924a76e6c96bc4ea79d043e3a0f27120c +testutils;https://github.com/status-im/nim-testutils@#4d37244f9f5e1acd8592a4ceb5c3fc47bc160181 +unittest2;https://github.com/status-im/nim-unittest2@#845b6af28b9f68f02d320e03ad18eccccea7ddb9 websock;https://github.com/status-im/nim-websock@#f8ed9b40a5ff27ad02a3c237c4905b0924e3f982 zlib;https://github.com/status-im/nim-zlib@#38b72eda9d70067df4a953f56b5ed59630f2a17b \ No newline at end of file From 863ea79b2b8acc597ea3a3b29154d41a762c7733 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 21 Oct 2024 13:17:17 +0200 Subject: [PATCH 05/12] Make solver flag only used in Nim 2+ --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 856f71bee3..17d57a1b15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,11 @@ jobs: if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} # The reason for using solver:legacy is to avoid an error in Nimble 0.16.2 where SAT is not able to check the dependencies. run: | - nimble --nimbleDir:nimbledeps --solver:legacy install_pinned + if [[ "${{ matrix.nim.ref }}" == "version-2-0" ]]; then + nimble --solver:legacy install_pinned + else + nimble install + fi - name: Use gcc 14 if : ${{ matrix.platform.os == 'linux-gcc-14'}} @@ -114,5 +118,10 @@ jobs: nim --version nimble --version gcc --version - NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }} --solver:legacy" + + NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" + if [[ "${{ matrix.nim.ref }}" == "version-2-0" ]]; then + NIMFLAGS="${NIMFLAGS} --solver:legacy" + fi + nimble test From b2b1da6696ea45d82282b097f2c8241f3c36821f Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 21 Oct 2024 13:26:47 +0200 Subject: [PATCH 06/12] Fix install task --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17d57a1b15..16e44a6a3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,7 +100,7 @@ jobs: if [[ "${{ matrix.nim.ref }}" == "version-2-0" ]]; then nimble --solver:legacy install_pinned else - nimble install + nimble install_pinned fi - name: Use gcc 14 From ba783f38ba03a8dc5a3134fbaf92b75179587261 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 21 Oct 2024 14:29:47 +0200 Subject: [PATCH 07/12] Revert test dependencies' versions --- .pinned | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pinned b/.pinned index 9f31a694f8..d996ac9cd9 100644 --- a/.pinned +++ b/.pinned @@ -13,7 +13,7 @@ results;https://github.com/arnetheduck/nim-results@#f3c666a272c69d70cb41e7245e7f secp256k1;https://github.com/status-im/nim-secp256k1@#7246d91c667f4cc3759fdd50339caa45a2ecd8be serialization;https://github.com/status-im/nim-serialization@#4bdbc29e54fe54049950e352bb969aab97173b35 stew;https://github.com/status-im/nim-stew@#3159137d9a3110edb4024145ce0ba778975de40e -testutils;https://github.com/status-im/nim-testutils@#4d37244f9f5e1acd8592a4ceb5c3fc47bc160181 -unittest2;https://github.com/status-im/nim-unittest2@#845b6af28b9f68f02d320e03ad18eccccea7ddb9 +testutils;https://github.com/status-im/nim-testutils@#dfc4c1b39f9ded9baf6365014de2b4bfb4dafc34 +unittest2;https://github.com/status-im/nim-unittest2@#2300fa9924a76e6c96bc4ea79d043e3a0f27120c websock;https://github.com/status-im/nim-websock@#f8ed9b40a5ff27ad02a3c237c4905b0924e3f982 zlib;https://github.com/status-im/nim-zlib@#38b72eda9d70067df4a953f56b5ed59630f2a17b \ No newline at end of file From 2ac173dcb82a5756348b03f1cc3d021867b11e17 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 21 Oct 2024 15:50:55 +0200 Subject: [PATCH 08/12] Test with previous version-2-0 ref --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16e44a6a3a..f0b4e36c8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: # The ref below corresponds to the branch "version-2-0". # Right before an update from Nimble 0.16.1 to 0.16.2. # That update breaks our dependency resolution. - - ref: version-2-0 + - ref: 8754469f4947844c5938f56e1fba846c349354b5 memory_management: refc include: - platform: From 97e17531b7d28691360cece42af6b16d742aaf45 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 21 Oct 2024 18:37:03 +0200 Subject: [PATCH 09/12] update nim revision --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0b4e36c8a..166ad8c9d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,13 +29,13 @@ jobs: cpu: amd64 - os: windows cpu: amd64 - nim: + nim: - ref: version-1-6 memory_management: refc # The ref below corresponds to the branch "version-2-0". # Right before an update from Nimble 0.16.1 to 0.16.2. # That update breaks our dependency resolution. - - ref: 8754469f4947844c5938f56e1fba846c349354b5 + - ref: cc4c9251f0fbf5e2c93e6815db402a0e27e1110d memory_management: refc include: - platform: From 09660772f3926ed800078af6fe8315cdf46b19c4 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 21 Oct 2024 18:43:33 +0200 Subject: [PATCH 10/12] add flag --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 166ad8c9d5..94727edbc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} # The reason for using solver:legacy is to avoid an error in Nimble 0.16.2 where SAT is not able to check the dependencies. run: | - if [[ "${{ matrix.nim.ref }}" == "version-2-0" ]]; then + if [[ "${{ matrix.nim.ref }}" == "cc4c9251f0fbf5e2c93e6815db402a0e27e1110d" ]]; then nimble --solver:legacy install_pinned else nimble install_pinned @@ -120,7 +120,7 @@ jobs: gcc --version NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" - if [[ "${{ matrix.nim.ref }}" == "version-2-0" ]]; then + if [[ "${{ matrix.nim.ref }}" == "cc4c9251f0fbf5e2c93e6815db402a0e27e1110d" ]]; then NIMFLAGS="${NIMFLAGS} --solver:legacy" fi From bedbbced860e3423602dd230d6cc1623175cdb03 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 21 Oct 2024 19:07:19 +0200 Subject: [PATCH 11/12] use previous ref --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94727edbc0..a004b74e47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: # The ref below corresponds to the branch "version-2-0". # Right before an update from Nimble 0.16.1 to 0.16.2. # That update breaks our dependency resolution. - - ref: cc4c9251f0fbf5e2c93e6815db402a0e27e1110d + - ref: 8754469f4947844c5938f56e1fba846c349354b5 memory_management: refc include: - platform: @@ -97,7 +97,7 @@ jobs: if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} # The reason for using solver:legacy is to avoid an error in Nimble 0.16.2 where SAT is not able to check the dependencies. run: | - if [[ "${{ matrix.nim.ref }}" == "cc4c9251f0fbf5e2c93e6815db402a0e27e1110d" ]]; then + if [[ "${{ matrix.nim.ref }}" == "8754469f4947844c5938f56e1fba846c349354b5" ]]; then nimble --solver:legacy install_pinned else nimble install_pinned @@ -120,7 +120,7 @@ jobs: gcc --version NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" - if [[ "${{ matrix.nim.ref }}" == "cc4c9251f0fbf5e2c93e6815db402a0e27e1110d" ]]; then + if [[ "${{ matrix.nim.ref }}" == "8754469f4947844c5938f56e1fba846c349354b5" ]]; then NIMFLAGS="${NIMFLAGS} --solver:legacy" fi From 7af0e90e4e5a8842c0baf2cc5ff8decc6eba7e6f Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 31 Oct 2024 18:01:26 +0100 Subject: [PATCH 12/12] Remove leftover code from version-2-0 fix --- .github/workflows/ci.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a004b74e47..bb71b236b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,13 +95,8 @@ jobs: - name: Install deps if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} - # The reason for using solver:legacy is to avoid an error in Nimble 0.16.2 where SAT is not able to check the dependencies. run: | - if [[ "${{ matrix.nim.ref }}" == "8754469f4947844c5938f56e1fba846c349354b5" ]]; then - nimble --solver:legacy install_pinned - else - nimble install_pinned - fi + nimble install_pinned - name: Use gcc 14 if : ${{ matrix.platform.os == 'linux-gcc-14'}} @@ -113,15 +108,10 @@ jobs: sudo update-alternatives --set gcc /usr/bin/gcc-14 - name: Run tests - # The reason for using solver:legacy is to avoid an error in Nimble 0.16.2 where SAT is not able to check the dependencies. run: | nim --version nimble --version gcc --version NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" - if [[ "${{ matrix.nim.ref }}" == "8754469f4947844c5938f56e1fba846c349354b5" ]]; then - NIMFLAGS="${NIMFLAGS} --solver:legacy" - fi - nimble test