From c8dbaa04889271add42bdaddb91c3605d70c01ec Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 24 Dec 2024 13:59:18 -0800 Subject: [PATCH 1/7] Update GCC versions --- .github/actions/build_arm64/Dockerfile | 4 ++-- .github/actions/build_x86_64/Dockerfile | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/test.yml | 17 +---------------- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/actions/build_arm64/Dockerfile b/.github/actions/build_arm64/Dockerfile index 4509a80..7f3ab6a 100644 --- a/.github/actions/build_arm64/Dockerfile +++ b/.github/actions/build_arm64/Dockerfile @@ -1,10 +1,10 @@ -FROM golang:1.23-bullseye +FROM golang:1.23-bookworm RUN \ dpkg --add-architecture arm64 && \ apt-get update && \ apt-get install -y ca-certificates openssl zip curl jq \ - gcc-10-aarch64-linux-gnu gcc-aarch64-linux-gnu libsqlite3-dev:arm64 && \ + gcc-12-aarch64-linux-gnu gcc-aarch64-linux-gnu libsqlite3-dev:arm64 && \ update-ca-certificates && \ rm -rf /var/lib/apt diff --git a/.github/actions/build_x86_64/Dockerfile b/.github/actions/build_x86_64/Dockerfile index adf9159..07ae1f5 100644 --- a/.github/actions/build_x86_64/Dockerfile +++ b/.github/actions/build_x86_64/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.23-bullseye +FROM golang:1.23-bookworm RUN \ apt-get update && \ diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 659f48f..aa91a2e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - go: [1.21.x] + go: [1.23.x] steps: - name: Install GCC (Ubuntu) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 346486b..130a965 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,27 +49,12 @@ jobs: GOARCH: arm64 CC: "/usr/bin/aarch64-linux-gnu-gcc-11" steps: - # Patch azure archives for [amd64, i386] use only and add - # arm64 ports (derived from ryankurte/action-apt) - - name: Update sources for arm64 - shell: bash - run: | - sudo dpkg --add-architecture arm64 - echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | sudo tee /etc/apt/sources.list - echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list - echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list - echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list - echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe" | sudo tee -a /etc/apt/sources.list - echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe" | sudo tee -a /etc/apt/sources.list - echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe"| sudo tee -a /etc/apt/sources.list - echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe" | sudo tee -a /etc/apt/sources.list - - name: Install GCC and SQLite for Arm64 shell: bash run: | sudo apt-get update DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ - gcc-11-aarch64-linux-gnu \ + gcc-14-aarch64-linux-gnu \ libsqlite3-dev:arm64 \ file - name: Install Go From d1606bf4de824cfdcd1a287284def0b68d10a23f Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 24 Dec 2024 14:01:58 -0800 Subject: [PATCH 2/7] Make sure to set arm64 arch --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 130a965..d8eac57 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,6 +52,7 @@ jobs: - name: Install GCC and SQLite for Arm64 shell: bash run: | + sudo dpkg --add-architecture arm64 sudo apt-get update DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ gcc-14-aarch64-linux-gnu \ From 8de4ff4d645c6e1fcf7af9ef1f5a3a6b2e312941 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 24 Dec 2024 14:44:08 -0800 Subject: [PATCH 3/7] Try again to patch sources directly --- .github/workflows/test.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d8eac57..e1514ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,10 +49,29 @@ jobs: GOARCH: arm64 CC: "/usr/bin/aarch64-linux-gnu-gcc-11" steps: - - name: Install GCC and SQLite for Arm64 + # Patch azure archives for [amd64, i386] use only and add + # arm64 ports (derived from ryankurte/action-apt) + - name: Update sources for arm64 shell: bash run: | sudo dpkg --add-architecture arm64 + sudo echo "Types: deb" > /etc/apt/sources.list.d/ubuntu.sources + sudo echo "URIs: http://azure.archive.ubuntu.com/ubuntu/" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "Suites: noble noble-updates noble-backports noble-security" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "Components: main universe restricted multiverse" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "Architectures: amd64" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "# Arm64 packages" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "Types: deb" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "Suites: noble noble-updates noble-backports noble-security" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "Components: main universe restricted multiverse" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> /etc/apt/sources.list.d/ubuntu.sources + sudo echo "Architectures: arm64" >> /etc/apt/sources.list.d/ubuntu.sources + + - name: Install GCC and SQLite for Arm64 + shell: bash + run: | sudo apt-get update DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ gcc-14-aarch64-linux-gnu \ From 86ae956db527086775bbecb9af280848c14af4fa Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 24 Dec 2024 14:58:04 -0800 Subject: [PATCH 4/7] Add more logging --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1514ff..fecf14c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,6 +54,7 @@ jobs: - name: Update sources for arm64 shell: bash run: | + cat /etc/apt/sources.list.d/ubuntu.sources sudo dpkg --add-architecture arm64 sudo echo "Types: deb" > /etc/apt/sources.list.d/ubuntu.sources sudo echo "URIs: http://azure.archive.ubuntu.com/ubuntu/" >> /etc/apt/sources.list.d/ubuntu.sources From 8726f90288e28b94f17eb5ce8131c6e66b7e330e Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 24 Dec 2024 15:06:55 -0800 Subject: [PATCH 5/7] Try again with sudo tee --- .github/workflows/test.yml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fecf14c..79b73c8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,21 +54,27 @@ jobs: - name: Update sources for arm64 shell: bash run: | + echo "Existing sources" cat /etc/apt/sources.list.d/ubuntu.sources + sudo dpkg --add-architecture arm64 - sudo echo "Types: deb" > /etc/apt/sources.list.d/ubuntu.sources - sudo echo "URIs: http://azure.archive.ubuntu.com/ubuntu/" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "Suites: noble noble-updates noble-backports noble-security" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "Components: main universe restricted multiverse" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "Architectures: amd64" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "# Arm64 packages" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "Types: deb" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "Suites: noble noble-updates noble-backports noble-security" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "Components: main universe restricted multiverse" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> /etc/apt/sources.list.d/ubuntu.sources - sudo echo "Architectures: arm64" >> /etc/apt/sources.list.d/ubuntu.sources + sudo rm /etc/apt/sources.list.d/ubuntu.sources + echo "Types: deb" | sudo tee /etc/apt/sources.list.d/ubuntu.sources + echo "URIs: mirror+file:/etc/apt/apt-mirrors.txt" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "Suites: noble noble-updates noble-backports noble-security" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "Components: main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "Architectures: amd64" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "# Arm64 packages" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "Types: deb" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "Suites: noble noble-updates noble-backports noble-security" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "Components: main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + echo "Architectures: arm64" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + + echo "Updated sources" + cat /etc/apt/sources.list.d/ubuntu.sources - name: Install GCC and SQLite for Arm64 shell: bash From 0c0a5ea7d9247cd941dc4f34140eca193f3b6ad2 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 24 Dec 2024 15:14:02 -0800 Subject: [PATCH 6/7] Fix version of GCC --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 79b73c8..449c5d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: CGO_ENABLED: 1 GOOS: linux GOARCH: arm64 - CC: "/usr/bin/aarch64-linux-gnu-gcc-11" + CC: "/usr/bin/aarch64-linux-gnu-gcc-14" steps: # Patch azure archives for [amd64, i386] use only and add # arm64 ports (derived from ryankurte/action-apt) From f4458c931fe0bba126d338c6027d7495b283d1dc Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 24 Dec 2024 15:37:54 -0800 Subject: [PATCH 7/7] Try again with GCC 13 and different set of mirrors --- .github/workflows/test.yml | 48 ++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 449c5d1..11ad020 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,41 +47,43 @@ jobs: CGO_ENABLED: 1 GOOS: linux GOARCH: arm64 - CC: "/usr/bin/aarch64-linux-gnu-gcc-14" + CC: "/usr/bin/aarch64-linux-gnu-gcc-13" steps: - # Patch azure archives for [amd64, i386] use only and add - # arm64 ports (derived from ryankurte/action-apt) + # Update sources to split out amd64 vs arm64 since arm64 is not supported on all mirrors + # adaped from https://github.com/shamil-mubarakshin/tests-repository/blob/main/.github/workflows/run-ubuntu-matrix.yml - name: Update sources for arm64 shell: bash run: | - echo "Existing sources" - cat /etc/apt/sources.list.d/ubuntu.sources - sudo dpkg --add-architecture arm64 - sudo rm /etc/apt/sources.list.d/ubuntu.sources - echo "Types: deb" | sudo tee /etc/apt/sources.list.d/ubuntu.sources - echo "URIs: mirror+file:/etc/apt/apt-mirrors.txt" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "Suites: noble noble-updates noble-backports noble-security" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "Components: main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "Architectures: amd64" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "# Arm64 packages" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "Types: deb" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "Suites: noble noble-updates noble-backports noble-security" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "Components: main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources - echo "Architectures: arm64" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources + cat < deb822sources + Types: deb + URIs: http://archive.ubuntu.com/ubuntu/ + Suites: noble noble-updates + Components: main restricted universe + Architectures: amd64 + + Types: deb + URIs: http://security.ubuntu.com/ubuntu/ + Suites: noble-security + Components: main restricted universe + Architectures: amd64 + + Types: deb + URIs: http://azure.ports.ubuntu.com/ubuntu-ports/ + Suites: noble noble-updates + Components: main restricted multiverse universe + Architectures: arm64 + + EOF - echo "Updated sources" - cat /etc/apt/sources.list.d/ubuntu.sources + sudo mv deb822sources /etc/apt/sources.list.d/ubuntu.sources - name: Install GCC and SQLite for Arm64 shell: bash run: | sudo apt-get update DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ - gcc-14-aarch64-linux-gnu \ + gcc-13-aarch64-linux-gnu \ libsqlite3-dev:arm64 \ file - name: Install Go