From df2076b111893ea3b6a5ca4bb06bd77c47447fd9 Mon Sep 17 00:00:00 2001 From: Max Heller Date: Thu, 18 Jul 2024 07:01:25 -0400 Subject: [PATCH] Upgrade `mdbook-pandoc` and disable it except during CI workflows (#2212) Implements the approach summarized in https://github.com/google/mdbook-i18n-helpers/issues/200#issuecomment-2220035461 to disable running `mdbook-pandoc` even if it is available to avoid dependency-related issues during local rendering. Should address https://github.com/google/comprehensive-rust/issues/1911 since `mdbook-pandoc` will no longer run locally. --- .github/workflows/build.sh | 3 +++ .github/workflows/install-mdbook/action.yml | 6 +++--- book.toml | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh index 6e91d19ebdee..0911422c31ca 100755 --- a/.github/workflows/build.sh +++ b/.github/workflows/build.sh @@ -36,6 +36,9 @@ else fi fi +# Enable mdbook-pandoc to build PDF version of the course +export MDBOOK_OUTPUT__PANDOC__DISABLED=false + mdbook build -d "$dest_dir" # Disable the redbox button in built versions of the course diff --git a/.github/workflows/install-mdbook/action.yml b/.github/workflows/install-mdbook/action.yml index b7de8aa2a9d1..406576d7a82b 100644 --- a/.github/workflows/install-mdbook/action.yml +++ b/.github/workflows/install-mdbook/action.yml @@ -17,11 +17,11 @@ runs: - name: Install mdbook-pandoc and related dependencies run: | - cargo install mdbook-pandoc --locked --version 0.6.4 + cargo install mdbook-pandoc --locked --version 0.7.0 sudo apt-get update sudo apt-get install -y texlive texlive-luatex texlive-lang-cjk librsvg2-bin fonts-noto - curl -LsSf https://github.com/jgm/pandoc/releases/download/3.2/pandoc-3.2-linux-amd64.tar.gz | tar zxf - - echo "$PWD/pandoc-3.2/bin" >> $GITHUB_PATH + curl -LsSf https://github.com/jgm/pandoc/releases/download/3.2.1/pandoc-3.2.1-linux-amd64.tar.gz | tar zxf - + echo "$PWD/pandoc-3.2.1/bin" >> $GITHUB_PATH shell: bash - name: Install mdbook-i18n-helpers diff --git a/book.toml b/book.toml index 73bff23d38a5..b6f0ed957818 100644 --- a/book.toml +++ b/book.toml @@ -24,6 +24,7 @@ verbose = false # Report timing information. [output.pandoc] optional = true +disabled = true hosted-html = "https://google.github.io/comprehensive-rust/" [output.pandoc.profile.pdf]