From c936ce11b44bddf29814e0d7040f9a558c617671 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Tue, 24 Sep 2024 15:39:46 +0400 Subject: [PATCH] feat: update Go to 1.22.7 Backport for Talos 1.7.x. Signed-off-by: Andrey Smirnov --- .github/workflows/ci.yaml | 59 +++++++++++++++++++++-- .github/workflows/weekly.yaml | 30 +++++++++++- Makefile | 22 ++++----- Pkgfile | 16 ++----- dejagnu/pkg.yaml | 30 ------------ expect/pkg.yaml | 47 ------------------ git/pkg.yaml | 1 - hack/release.sh | 89 +++++++++++++++++++++++++++++++++-- tcl/pkg.yaml | 30 ------------ tools/pkg.yaml | 3 -- 10 files changed, 182 insertions(+), 145 deletions(-) delete mode 100644 dejagnu/pkg.yaml delete mode 100644 expect/pkg.yaml delete mode 100644 tcl/pkg.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cfd8bb4..31fdcc9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-03-27T10:42:24Z by kres latest. +# Generated on 2024-09-24T11:50:06Z by kres 8be5fa7. name: default concurrency: @@ -33,7 +33,7 @@ jobs: labels: ${{ steps.retrieve-pr-labels.outputs.result }} services: buildkitd: - image: moby/buildkit:v0.13.1 + image: moby/buildkit:v0.15.2 options: --privileged ports: - 1234:1234 @@ -41,12 +41,38 @@ jobs: - /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit - /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml steps: + - name: gather-system-info + id: system-info + uses: kenchan0130/actions-system-info@v1.3.0 + continue-on-error: true + - name: print-system-info + run: | + MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024)) + + OUTPUTS=( + "CPU Core: ${{ steps.system-info.outputs.cpu-core }}" + "CPU Model: ${{ steps.system-info.outputs.cpu-model }}" + "Hostname: ${{ steps.system-info.outputs.hostname }}" + "NodeName: ${NODE_NAME}" + "Kernel release: ${{ steps.system-info.outputs.kernel-release }}" + "Kernel version: ${{ steps.system-info.outputs.kernel-version }}" + "Name: ${{ steps.system-info.outputs.name }}" + "Platform: ${{ steps.system-info.outputs.platform }}" + "Release: ${{ steps.system-info.outputs.release }}" + "Total memory: ${MEMORY_GB} GB" + ) + + for OUTPUT in "${OUTPUTS[@]}";do + echo "${OUTPUT}" + done + continue-on-error: true - name: checkout uses: actions/checkout@v4 - name: Unshallow run: | git fetch --prune --unshallow - name: Set up Docker Buildx + id: setup-buildx uses: docker/setup-buildx-action@v3 with: append: | @@ -55,6 +81,7 @@ jobs: driver: remote endpoint: tcp://127.0.0.1:1234 - name: Build + if: github.event_name == 'pull_request' run: | make - name: Login to registry @@ -102,7 +129,7 @@ jobs: - default services: buildkitd: - image: moby/buildkit:v0.13.1 + image: moby/buildkit:v0.15.2 options: --privileged ports: - 1234:1234 @@ -110,12 +137,38 @@ jobs: - /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit - /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml steps: + - name: gather-system-info + id: system-info + uses: kenchan0130/actions-system-info@v1.3.0 + continue-on-error: true + - name: print-system-info + run: | + MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024)) + + OUTPUTS=( + "CPU Core: ${{ steps.system-info.outputs.cpu-core }}" + "CPU Model: ${{ steps.system-info.outputs.cpu-model }}" + "Hostname: ${{ steps.system-info.outputs.hostname }}" + "NodeName: ${NODE_NAME}" + "Kernel release: ${{ steps.system-info.outputs.kernel-release }}" + "Kernel version: ${{ steps.system-info.outputs.kernel-version }}" + "Name: ${{ steps.system-info.outputs.name }}" + "Platform: ${{ steps.system-info.outputs.platform }}" + "Release: ${{ steps.system-info.outputs.release }}" + "Total memory: ${MEMORY_GB} GB" + ) + + for OUTPUT in "${OUTPUTS[@]}";do + echo "${OUTPUT}" + done + continue-on-error: true - name: checkout uses: actions/checkout@v4 - name: Unshallow run: | git fetch --prune --unshallow - name: Set up Docker Buildx + id: setup-buildx uses: docker/setup-buildx-action@v3 with: append: | diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index 8aa6075..6881c4d 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-03-27T10:42:24Z by kres latest. +# Generated on 2024-09-24T11:50:06Z by kres 8be5fa7. name: weekly concurrency: @@ -16,7 +16,7 @@ jobs: - pkgs services: buildkitd: - image: moby/buildkit:v0.13.1 + image: moby/buildkit:v0.15.2 options: --privileged ports: - 1234:1234 @@ -24,12 +24,38 @@ jobs: - /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit - /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml steps: + - name: gather-system-info + id: system-info + uses: kenchan0130/actions-system-info@v1.3.0 + continue-on-error: true + - name: print-system-info + run: | + MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024)) + + OUTPUTS=( + "CPU Core: ${{ steps.system-info.outputs.cpu-core }}" + "CPU Model: ${{ steps.system-info.outputs.cpu-model }}" + "Hostname: ${{ steps.system-info.outputs.hostname }}" + "NodeName: ${NODE_NAME}" + "Kernel release: ${{ steps.system-info.outputs.kernel-release }}" + "Kernel version: ${{ steps.system-info.outputs.kernel-version }}" + "Name: ${{ steps.system-info.outputs.name }}" + "Platform: ${{ steps.system-info.outputs.platform }}" + "Release: ${{ steps.system-info.outputs.release }}" + "Total memory: ${MEMORY_GB} GB" + ) + + for OUTPUT in "${OUTPUTS[@]}";do + echo "${OUTPUT}" + done + continue-on-error: true - name: checkout uses: actions/checkout@v4 - name: Unshallow run: | git fetch --prune --unshallow - name: Set up Docker Buildx + id: setup-buildx uses: docker/setup-buildx-action@v3 with: append: | diff --git a/Makefile b/Makefile index 1f3006f..5e1cb0c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-03-13T16:52:46Z by kres latest. +# Generated on 2024-09-24T11:50:06Z by kres 8be5fa7. # common variables @@ -9,12 +9,9 @@ TAG := $(shell git describe --tag --always --dirty --match v[0-9]\*) ABBREV_TAG := $(shell git describe --tags >/dev/null 2>/dev/null && git describe --tag --always --match v[0-9]\* --abbrev=0 || echo 'undefined') BRANCH := $(shell git rev-parse --abbrev-ref HEAD) ARTIFACTS := _out +IMAGE_TAG ?= $(TAG) OPERATING_SYSTEM := $(shell uname -s | tr '[:upper:]' '[:lower:]') -GOARCH := $(shell uname -m | tr '[:upper:]' '[:lower:]') - -ifeq ($(GOARCH),x86_64) - GOARCH := amd64 -endif +GOARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/') REGISTRY ?= ghcr.io USERNAME ?= siderolabs REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) @@ -28,7 +25,7 @@ SOURCE_DATE_EPOCH := $(shell git log $(INITIAL_COMMIT_SHA) --pretty=%ct) # sync bldr image with pkgfile -BLDR_RELEASE := v0.3.0 +BLDR_RELEASE := v0.3.2 BLDR_IMAGE := ghcr.io/siderolabs/bldr:$(BLDR_RELEASE) BLDR := docker run --rm --user $(shell id -u):$(shell id -g) --volume $(PWD):/src --entrypoint=/bldr $(BLDR_IMAGE) --root=/src @@ -93,7 +90,7 @@ If you already have a compatible builder instance, you may use that instead. ## Artifacts All artifacts will be output to ./$(ARTIFACTS). Images will be tagged with the -registry "$(REGISTRY)", username "$(USERNAME)", and a dynamic tag (e.g. $(IMAGE):$(TAG)). +registry "$(REGISTRY)", username "$(USERNAME)", and a dynamic tag (e.g. $(IMAGE):$(IMAGE_TAG)). The registry and username can be overridden by exporting REGISTRY, and USERNAME respectively. @@ -101,13 +98,13 @@ endef all: $(TARGETS) ## Builds all targets defined. +$(ARTIFACTS): ## Creates artifacts directory. + @mkdir -p $(ARTIFACTS) + .PHONY: clean clean: ## Cleans up all artifacts. @rm -rf $(ARTIFACTS) -$(ARTIFACTS): ## Creates artifacts directory. - @mkdir -p $(ARTIFACTS) - target-%: ## Builds the specified target defined in the Pkgfile. The build result will only remain in the build cache. @$(BUILD) --target=$* $(COMMON_ARGS) $(TARGET_ARGS) $(CI_ARGS) . @@ -147,8 +144,7 @@ help: ## This help menu. @grep -E '^[a-zA-Z%_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' .PHONY: release-notes -release-notes: - mkdir -p $(ARTIFACTS) +release-notes: $(ARTIFACTS) @ARTIFACTS=$(ARTIFACTS) ./hack/release.sh $@ $(ARTIFACTS)/RELEASE_NOTES.md $(TAG) .PHONY: conformance diff --git a/Pkgfile b/Pkgfile index 0b6abba..6426add 100644 --- a/Pkgfile +++ b/Pkgfile @@ -62,11 +62,6 @@ vars: curl_sha256: 6fea2aac6a4610fbd0400afb0bcddbe7258a64c63f1f68e5855ebc0c659710cd curl_sha512: 5bbde9d5648e9226f5490fa951690aaf159149345f3a315df2ba58b2468f3e59ca32e8a49734338afc861803a4f81caac6d642a4699b72c6310ebfb1f618aad2 - # renovate: datasource=git-tags extractVersion=^dejagnu-(?.*)-release$ depName=git://git.savannah.gnu.org/dejagnu.git - dejagnu_version: 1.6.3 - dejagnu_sha256: 87daefacd7958b4a69f88c6856dbd1634261963c414079d0c371f589cd66a2e3 - dejagnu_sha512: 1a737132bd912cb527e7f2fcbe70ffff8ccc8604a0ffdecff87ba2a16aeeefd800f5792aeffdbe79be6daa35cedb1c60e41002ca4aabb5370a460028191b76c4 - # renovate: datasource=git-tags extractVersion=^v(?.*)$ depName=git://git.savannah.gnu.org/diffutils.git diffutils_version: 3.10 diffutils_sha256: 90e5e93cc724e4ebe12ede80df1634063c7a855692685919bfe60b556c9bd09e @@ -129,9 +124,9 @@ vars: gmp_sha512: c99be0950a1d05a0297d65641dd35b75b74466f7bf03c9e8a99895a3b2f9a0856cd17887738fa51cf7499781b65c049769271cbcb77d057d2e9f1ec52e07dd84 # renovate: datasource=github-tags extractVersion=^go(?.*)$ depName=golang/go - golang_version: 1.22.5 - golang_sha256: ac9c723f224969aee624bc34fd34c9e13f2a212d75c71c807de644bb46e112f6 - golang_sha512: 798c2bd5d59be1fb5d7af98893fa7bb68322117facfdee546a37175ec5e8be634f2bed2d8d0e7d4d0555b354c8e9d72b3829c39670d3be2d2328376a00a48576 + golang_version: 1.22.7 + golang_sha256: 66432d87d85e0cfac3edffe637d5930fc4ddf5793313fe11e4a0f333023c879f + golang_sha512: 60b37916e31c3482e8395580a29757971df5e1783dc13a9914261007e07aa8b1b9c1a0b874883e297903e16c7831117b8f814aeff0a0d4398948c97c9d73b73a # renovate: datasource=git-tags extractVersion=^v(?.*)$ depName=git://git.savannah.gnu.org/gperf.git gperf_version: 3.1 @@ -324,11 +319,6 @@ vars: tar_sha256: 63bebd26879c5e1eea4352f0d03c991f966aeb3ddeb3c7445c902568d5411d28 tar_sha512: 5e77c4a7b49983ad7d15238c2bce28be7a8aa437b4b1815fc00abd13096da308b6bba196cc6e3ed79d85e62823d520ae0d8fcda2d93873842cf84dc3369fc902 - # renovate: datasource=github-tags extractVersion=^core-(?.*)$ depName=tcltk/tcl - tcl_version: 8-6-14 - tcl_sha256: 517656a58506544f9a09beae45311125244e4d602714b8daf1edd4eee9ca52d3 - tcl_sha512: 8f1fe9585824ff29cd9ba86bd31fa1a13d956274f1bc26f94968ae5e8be9da03786f53e747a2cc922a22f5705942638a389d11020694f15c0f2739d0f11f8781 - # renovate: datasource=git-tags extractVersion=^texinfo-(?.*)$ depName=git://git.savannah.gnu.org/texinfo.git texinfo_version: 7.1 texinfo_sha256: deeec9f19f159e046fdf8ad22231981806dac332cc372f1c763504ad82b30953 diff --git a/dejagnu/pkg.yaml b/dejagnu/pkg.yaml deleted file mode 100644 index b332baf..0000000 --- a/dejagnu/pkg.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: dejagnu -dependencies: - - stage: base - - stage: expect - - stage: tcl -steps: - - sources: - - url: https://ftp.gnu.org/gnu/dejagnu/dejagnu-{{ .dejagnu_version }}.tar.gz - destination: dejagnu.tar.gz - sha256: "{{ .dejagnu_sha256 }}" - sha512: "{{ .dejagnu_sha512 }}" - prepare: - - | - tar -xzf dejagnu.tar.gz --strip-components=1 - mkdir build - cd build - - ../configure \ - --prefix=${TOOLCHAIN} \ - build: - - | - cd build - make DESTDIR=/rootfs install - install: - - | - cd build - make DESTDIR=/rootfs install -finalize: - - from: /rootfs - to: / diff --git a/expect/pkg.yaml b/expect/pkg.yaml deleted file mode 100644 index d12e811..0000000 --- a/expect/pkg.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: expect -dependencies: - - stage: base - - stage: tcl -steps: - - sources: - - url: http://deb.debian.org/debian/pool/main/e/expect/expect_5.45.4.orig.tar.gz - destination: expect.tar.gz - sha256: d082bf340fdb7a85b1e4e5df4d967d0140835db34a8a035c3102abb5eb62d450 - sha512: 89ee8da2bfefc2baa5b0213c0d93be9a9eff1c3a1f437800c48395737ef359f3975f3355399be4494d491c080479e2b82bf9edbc9711ef1f6d3f3ae2ef613336 - prepare: - - | - tar -xzf expect.tar.gz --strip-components=1 - mkdir build - cd build - - extras="" - case $ARCH in - x86_64) - ;; - aarch64 | armv7) - extras="--build=arm-linux --host=arm-linux" - ;; - *) - echo "unsupported arch ${ARCH}" - exit 1 - ;; - esac - - cp -v ../configure{,.orig} - sed 's:/usr/local/bin:/bin:' ../configure.orig > ../configure - - ../configure ${extras} \ - --prefix=${TOOLCHAIN} \ - --with-tcl=${TOOLCHAIN}/lib \ - --with-tclinclude=${TOOLCHAIN}/include - build: - - | - cd build - make -j $(nproc) - install: - - | - cd build - make DESTDIR=/rootfs SCRIPTS="" install -finalize: - - from: /rootfs - to: / diff --git a/git/pkg.yaml b/git/pkg.yaml index 267b27c..e3b171f 100644 --- a/git/pkg.yaml +++ b/git/pkg.yaml @@ -3,7 +3,6 @@ dependencies: - stage: base - stage: zlib runtime: true - - stage: tcl - stage: gettext - stage: openssl - stage: curl diff --git a/hack/release.sh b/hack/release.sh index d9ee34e..34de41c 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2023-11-02T12:25:12Z by kres a0777d5-dirty. +# Generated on 2024-09-24T11:50:06Z by kres 8be5fa7. set -e @@ -44,9 +44,92 @@ function commit { exit 1 fi + if is_on_main_branch; then + update_license_files + fi + git commit -s -m "release($1): prepare release" -m "This is the official $1 release." } +function is_on_main_branch { + main_remotes=("upstream" "origin") + branch_names=("main" "master") + current_branch=$(git rev-parse --abbrev-ref HEAD) + + echo "Check current branch: $current_branch" + + for remote in "${main_remotes[@]}"; do + echo "Fetch remote $remote..." + + if ! git fetch --quiet "$remote" &>/dev/null; then + echo "Failed to fetch $remote, skip..." + + continue + fi + + for branch_name in "${branch_names[@]}"; do + if ! git rev-parse --verify "$branch_name" &>/dev/null; then + echo "Branch $branch_name does not exist, skip..." + + continue + fi + + echo "Branch $remote/$branch_name exists, comparing..." + + merge_base=$(git merge-base "$current_branch" "$remote/$branch_name") + latest_main=$(git rev-parse "$remote/$branch_name") + + if [ "$merge_base" = "$latest_main" ]; then + echo "Current branch is up-to-date with $remote/$branch_name" + + return 0 + else + echo "Current branch is not on $remote/$branch_name" + + return 1 + fi + done + done + + echo "No main or master branch found on any remote" + + return 1 +} + +function update_license_files { + script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + parent_dir="$(dirname "$script_dir")" + current_year=$(date +"%Y") + change_date=$(date -v+4y +"%Y-%m-%d" 2>/dev/null || date -d "+4 years" +"%Y-%m-%d" 2>/dev/null || date --date="+4 years" +"%Y-%m-%d") + + # Find LICENSE and .kres.yaml files recursively in the parent directory (project root) + find "$parent_dir" \( -name "LICENSE" -o -name ".kres.yaml" \) -type f | while read -r file; do + temp_file="${file}.tmp" + + if [[ $file == *"LICENSE" ]]; then + if grep -q "^Business Source License" "$file"; then + sed -e "s/The Licensed Work is (c) [0-9]\{4\}/The Licensed Work is (c) $current_year/" \ + -e "s/Change Date: [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/Change Date: $change_date/" \ + "$file" >"$temp_file" + else + continue # Not a Business Source License file + fi + elif [[ $file == *".kres.yaml" ]]; then + sed -E 's/^([[:space:]]*)ChangeDate:.*$/\1ChangeDate: "'"$change_date"'"/' "$file" >"$temp_file" + fi + + # Check if the file has changed + if ! cmp -s "$file" "$temp_file"; then + mv "$temp_file" "$file" + echo "Updated: $file" + git add "$file" + else + echo "No changes: $file" + rm "$temp_file" + fi + done +} + if declare -f "$1" > /dev/null then cmd="$1" @@ -55,7 +138,7 @@ then else cat <