From 633f7c0877d857e2a99c2eefc282590829e570bc Mon Sep 17 00:00:00 2001 From: Javier Maestro Date: Wed, 6 Nov 2024 18:59:13 +0000 Subject: [PATCH] fix: patch old releases The doc generation was failing for old releases because the .bazelrc file wasn't disabling Bzlmod. See: https://github.com/bazel-contrib/rules_foreign_cc/pull/1316#issuecomment-2460299238 --- .github/docs-0.1.0.patch | 13 +++++++++++++ .github/docs-0.10.1.patch | 13 +++++++++++++ .github/docs-0.2.0.patch | 13 +++++++++++++ .github/docs-0.3.0.patch | 13 +++++++++++++ .github/docs-0.4.0.patch | 13 +++++++++++++ .github/docs-0.5.0.patch | 13 +++++++++++++ .github/docs-0.5.1.patch | 13 +++++++++++++ .github/docs-0.6.0.patch | 13 +++++++++++++ .github/docs-0.7.0.patch | 13 +++++++++++++ .github/docs-0.7.1.patch | 13 +++++++++++++ .github/docs-0.8.0.patch | 13 +++++++++++++ .github/docs-0.9.0.patch | 13 +++++++++++++ .github/workflows/pages.yaml | 11 ++++++++++- 13 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 .github/docs-0.10.1.patch create mode 100644 .github/docs-0.5.0.patch create mode 100644 .github/docs-0.5.1.patch create mode 100644 .github/docs-0.6.0.patch create mode 100644 .github/docs-0.7.0.patch create mode 100644 .github/docs-0.7.1.patch create mode 100644 .github/docs-0.8.0.patch create mode 100644 .github/docs-0.9.0.patch diff --git a/.github/docs-0.1.0.patch b/.github/docs-0.1.0.patch index 62b469d7f..7e6133ca5 100644 --- a/.github/docs-0.1.0.patch +++ b/.github/docs-0.1.0.patch @@ -40,3 +40,16 @@ index 0000000..98bb722 +"""A module represeting the version of rules_foreign_cc""" + +VERSION = "0.1.0" +diff --git a/docs/.bazelrc b/docs/.bazelrc +new file mode 100644 +index 0000000..9eb0697 +--- /dev/null ++++ b/docs/.bazelrc +@@ -0,0 +1,7 @@ ++# Bazel configuration flags for rules_foreign_cc_docs ++ ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod ++build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.10.1.patch b/.github/docs-0.10.1.patch new file mode 100644 index 000000000..cb7ec07a2 --- /dev/null +++ b/.github/docs-0.10.1.patch @@ -0,0 +1,13 @@ +diff --git a/docs/.bazelrc b/docs/.bazelrc +index dc6a3f7..9eb0697 100644 +--- a/docs/.bazelrc ++++ b/docs/.bazelrc +@@ -1,3 +1,7 @@ +-# Bazel configuration flags for rules_foregin_cc_docs ++# Bazel configuration flags for rules_foreign_cc_docs + ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod + build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.2.0.patch b/.github/docs-0.2.0.patch index fa54ab3d5..5a5075636 100644 --- a/.github/docs-0.2.0.patch +++ b/.github/docs-0.2.0.patch @@ -40,3 +40,16 @@ index 0000000..98bb722 +"""A module represeting the version of rules_foreign_cc""" + +VERSION = "0.2.0" +diff --git a/docs/.bazelrc b/docs/.bazelrc +new file mode 100644 +index 0000000..9eb0697 +--- /dev/null ++++ b/docs/.bazelrc +@@ -0,0 +1,7 @@ ++# Bazel configuration flags for rules_foreign_cc_docs ++ ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod ++build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.3.0.patch b/.github/docs-0.3.0.patch index 9e65ebc13..835689e28 100644 --- a/.github/docs-0.3.0.patch +++ b/.github/docs-0.3.0.patch @@ -80,3 +80,16 @@ index 0000000..98bb722 +"""A module represeting the version of rules_foreign_cc""" + +VERSION = "0.3.0" +diff --git a/docs/.bazelrc b/docs/.bazelrc +new file mode 100644 +index 0000000..9eb0697 +--- /dev/null ++++ b/docs/.bazelrc +@@ -0,0 +1,7 @@ ++# Bazel configuration flags for rules_foreign_cc_docs ++ ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod ++build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.4.0.patch b/.github/docs-0.4.0.patch index 098772021..5da78c0c6 100644 --- a/.github/docs-0.4.0.patch +++ b/.github/docs-0.4.0.patch @@ -11,3 +11,16 @@ index 2bdbf6e..418dd13 100644 release="\\$${RELEASE}" fi mkdir -p \\$${BUILD_WORKSPACE_DIRECTORY}/src +diff --git a/docs/.bazelrc b/docs/.bazelrc +index dc6a3f7..9eb0697 100644 +--- a/docs/.bazelrc ++++ b/docs/.bazelrc +@@ -1,3 +1,7 @@ +-# Bazel configuration flags for rules_foregin_cc_docs ++# Bazel configuration flags for rules_foreign_cc_docs + ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod + build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.5.0.patch b/.github/docs-0.5.0.patch new file mode 100644 index 000000000..cb7ec07a2 --- /dev/null +++ b/.github/docs-0.5.0.patch @@ -0,0 +1,13 @@ +diff --git a/docs/.bazelrc b/docs/.bazelrc +index dc6a3f7..9eb0697 100644 +--- a/docs/.bazelrc ++++ b/docs/.bazelrc +@@ -1,3 +1,7 @@ +-# Bazel configuration flags for rules_foregin_cc_docs ++# Bazel configuration flags for rules_foreign_cc_docs + ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod + build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.5.1.patch b/.github/docs-0.5.1.patch new file mode 100644 index 000000000..cb7ec07a2 --- /dev/null +++ b/.github/docs-0.5.1.patch @@ -0,0 +1,13 @@ +diff --git a/docs/.bazelrc b/docs/.bazelrc +index dc6a3f7..9eb0697 100644 +--- a/docs/.bazelrc ++++ b/docs/.bazelrc +@@ -1,3 +1,7 @@ +-# Bazel configuration flags for rules_foregin_cc_docs ++# Bazel configuration flags for rules_foreign_cc_docs + ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod + build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.6.0.patch b/.github/docs-0.6.0.patch new file mode 100644 index 000000000..cb7ec07a2 --- /dev/null +++ b/.github/docs-0.6.0.patch @@ -0,0 +1,13 @@ +diff --git a/docs/.bazelrc b/docs/.bazelrc +index dc6a3f7..9eb0697 100644 +--- a/docs/.bazelrc ++++ b/docs/.bazelrc +@@ -1,3 +1,7 @@ +-# Bazel configuration flags for rules_foregin_cc_docs ++# Bazel configuration flags for rules_foreign_cc_docs + ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod + build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.7.0.patch b/.github/docs-0.7.0.patch new file mode 100644 index 000000000..cb7ec07a2 --- /dev/null +++ b/.github/docs-0.7.0.patch @@ -0,0 +1,13 @@ +diff --git a/docs/.bazelrc b/docs/.bazelrc +index dc6a3f7..9eb0697 100644 +--- a/docs/.bazelrc ++++ b/docs/.bazelrc +@@ -1,3 +1,7 @@ +-# Bazel configuration flags for rules_foregin_cc_docs ++# Bazel configuration flags for rules_foreign_cc_docs + ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod + build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.7.1.patch b/.github/docs-0.7.1.patch new file mode 100644 index 000000000..cb7ec07a2 --- /dev/null +++ b/.github/docs-0.7.1.patch @@ -0,0 +1,13 @@ +diff --git a/docs/.bazelrc b/docs/.bazelrc +index dc6a3f7..9eb0697 100644 +--- a/docs/.bazelrc ++++ b/docs/.bazelrc +@@ -1,3 +1,7 @@ +-# Bazel configuration flags for rules_foregin_cc_docs ++# Bazel configuration flags for rules_foreign_cc_docs + ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod + build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.8.0.patch b/.github/docs-0.8.0.patch new file mode 100644 index 000000000..cb7ec07a2 --- /dev/null +++ b/.github/docs-0.8.0.patch @@ -0,0 +1,13 @@ +diff --git a/docs/.bazelrc b/docs/.bazelrc +index dc6a3f7..9eb0697 100644 +--- a/docs/.bazelrc ++++ b/docs/.bazelrc +@@ -1,3 +1,7 @@ +-# Bazel configuration flags for rules_foregin_cc_docs ++# Bazel configuration flags for rules_foreign_cc_docs + ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod + build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/docs-0.9.0.patch b/.github/docs-0.9.0.patch new file mode 100644 index 000000000..cb7ec07a2 --- /dev/null +++ b/.github/docs-0.9.0.patch @@ -0,0 +1,13 @@ +diff --git a/docs/.bazelrc b/docs/.bazelrc +index dc6a3f7..9eb0697 100644 +--- a/docs/.bazelrc ++++ b/docs/.bazelrc +@@ -1,3 +1,7 @@ +-# Bazel configuration flags for rules_foregin_cc_docs ++# Bazel configuration flags for rules_foreign_cc_docs + ++# https://github.com/bazelbuild/stardoc/issues/112 ++common --incompatible_allow_tags_propagation ++ ++common --noenable_bzlmod + build --workspace_status_command=tools/workspace_status.sh diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index cd2f32d3b..81f517418 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -44,10 +44,19 @@ jobs: if: ${{ matrix.ref == 'main' }} - name: Patch older branches run: | + ref="${{ matrix.ref }}" + + [[ "$ref" == "main" ]] && exit + + v_major="$(echo "$ref" | cut -d. -f1)" + v_minor="$(echo "$ref" | cut -d. -f2)" + v_patch="$(echo "$ref" | cut -d. -f3)" + + [[ $v_major -gt 10 ]] && exit + mkdir -p ${{ github.workspace }}/.github curl https://raw.githubusercontent.com/bazel-contrib/rules_foreign_cc/main/.github/docs-${{ matrix.ref }}.patch > ${{ github.workspace }}/.github/docs-${{ matrix.ref }}.patch git apply ${{ github.workspace }}/.github/docs-${{ matrix.ref }}.patch - if: ${{ matrix.ref == '0.4.0' || matrix.ref == '0.3.0' || matrix.ref == '0.2.0' || matrix.ref == '0.1.0' }} - name: Install bazelisk run: | curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.9.0/bazelisk-linux-amd64"