From 062850d73fcb9f7efcf124fe637cee9c604215ba Mon Sep 17 00:00:00 2001 From: Sam Darwin Date: Tue, 6 Aug 2024 08:36:41 -0600 Subject: [PATCH] build_docs scripts improvements: macos-14 and windows-2022 (#74) * build_docs: macos-14 * build_docs: windows 2022 enhancements --- .github/workflows/build_docs.yml | 5 +++ build_docs/README.md | 1 + build_docs/macosdocs.sh | 50 ++++++++++++++------- build_docs/{ => other}/2020/README.md | 0 build_docs/{ => other}/2020/linuxdocs.sh | 0 build_docs/{ => other}/2020/macosdocs.sh | 0 build_docs/{ => other}/2020/windowsdocs.ps1 | 0 build_docs/other/README.md | 8 ++++ build_docs/other/windows-2022-clang.ps1 | 26 +++++++++++ build_docs/windowsdocs.ps1 | 18 ++++++-- 10 files changed, 90 insertions(+), 18 deletions(-) rename build_docs/{ => other}/2020/README.md (100%) rename build_docs/{ => other}/2020/linuxdocs.sh (100%) rename build_docs/{ => other}/2020/macosdocs.sh (100%) rename build_docs/{ => other}/2020/windowsdocs.ps1 (100%) create mode 100644 build_docs/other/README.md create mode 100644 build_docs/other/windows-2022-clang.ps1 diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 7011afc..a258347 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -162,6 +162,11 @@ jobs: - os: macos-12 skiplist: contract flags: "--boostrelease" + - os: macos-14 + skiplist: auto_index contract + - os: macos-14 + skiplist: contract + flags: "--boostrelease" timeout-minutes: 720 runs-on: ${{matrix.os}} diff --git a/build_docs/README.md b/build_docs/README.md index 1f9d67d..3f20a23 100644 --- a/build_docs/README.md +++ b/build_docs/README.md @@ -64,6 +64,7 @@ cd _path_to_boost_library_ windowsdocs.ps1 ``` +windowsdocs.ps1 requires a version of Visual Studio C++ to be available. Optionally, see the scripts here in the [other/](other/) directory such as `windows-2022-clang.ps1` for a method to install that.     Further discussion about a small number of issues affecting certain libraries is continued in [compatibility.md](compatibility.md) diff --git a/build_docs/macosdocs.sh b/build_docs/macosdocs.sh index 9ac25e1..b53bf66 100755 --- a/build_docs/macosdocs.sh +++ b/build_docs/macosdocs.sh @@ -11,9 +11,18 @@ shopt -s dotglob scriptname="macosdocs.sh" +if [[ "$(uname -p)" =~ "arm" ]]; then + echo "Running on arm processor" + homebrew_base_path="/opt/homebrew" +else + echo "Not running on arm processor" + homebrew_base_path="/usr/local" +fi + # set defaults: boostrelease="" BOOSTROOTRELPATH=".." +pythonvirtenvpath="${HOME}/venvboostdocs" # git and getopt are required. If they are not installed, moving that part of the installation process # to an earlier part of the script: @@ -30,16 +39,16 @@ then fi # check apple silicon. -if ! command -v /usr/local/opt/gnu-getopt/bin/getopt &> /dev/null +if ! command -v ${homebrew_base_path}/opt/gnu-getopt/bin/getopt &> /dev/null then echo "Installing gnu-getopt" brew install gnu-getopt fi -export PATH="/usr/local/opt/gnu-getopt/bin:$PATH" +export PATH="${homebrew_base_path}/opt/gnu-getopt/bin:$PATH" # READ IN COMMAND-LINE OPTIONS -TEMP=`/usr/local/opt/gnu-getopt/bin/getopt -o t:,h::,q:: --long type:,help::,skip-boost::,skip-packages::,quick::,boostrelease::,boostrootsubdir:: -- "$@"` +TEMP=`${homebrew_base_path}/opt/gnu-getopt/bin/getopt -o t:,h::,q:: --long type:,help::,skip-boost::,skip-packages::,quick::,boostrelease::,boostrootsubdir:: -- "$@"` eval set -- "$TEMP" # extract options and their arguments into variables. @@ -186,6 +195,12 @@ if [ "$skippackagesoption" != "yes" ]; then brew install docbook-xsl if [ "$typeoption" = "main" ]; then + + if [ ! -f ${pythonvirtenvpath}/bin/activate ]; then + python3 -m venv ${pythonvirtenvpath} + fi + source ${pythonvirtenvpath}/bin/activate + brew install ghostscript brew install texlive brew install graphviz @@ -195,23 +210,23 @@ if [ "$skippackagesoption" != "yes" ]; then sudo gem install asciidoctor-pdf --version 2.3.4 sudo gem install asciidoctor-diagram --version 2.2.14 sudo gem install asciidoctor-multipage --version 0.0.18 - pip3 install setuptools --user - pip3 install docutils --user + pip3 install setuptools + pip3 install docutils # which library is using rapidxml # wget -O rapidxml.zip http://sourceforge.net/projects/rapidxml/files/latest/download # unzip -n -d rapidxml rapidxml.zip - pip3 install --user https://github.com/bfgroup/jam_pygments/archive/master.zip - pip3 install --user Jinja2==3.1.2 - pip3 install --user MarkupSafe==2.1.1 + pip3 install https://github.com/bfgroup/jam_pygments/archive/master.zip + pip3 install Jinja2==3.1.2 + pip3 install MarkupSafe==2.1.1 sudo gem install pygments.rb --version 2.3.0 - pip3 install --user Pygments==2.13.0 + pip3 install Pygments==2.13.0 sudo gem install rouge --version 4.0.0 - pip3 install --user Sphinx==5.2.1 - pip3 install --user git+https://github.com/pfultz2/sphinx-boost@8ad7d424c6b613864976546d801439c34a27e3f6 + pip3 install Sphinx==5.2.1 + pip3 install git+https://github.com/pfultz2/sphinx-boost@8ad7d424c6b613864976546d801439c34a27e3f6 # from dockerfile: - pip3 install --user myst-parser==0.18.1 - pip3 install --user future==0.18.2 - pip3 install --user six==1.14.0 + pip3 install myst-parser==0.18.1 + pip3 install future==0.18.2 + pip3 install six==1.14.0 # Locking the version numbers in place offers a better guarantee of a known, good build. # At the same time, it creates a perpetual outstanding task, to upgrade the gem and pip versions @@ -234,8 +249,13 @@ if [ "$skippackagesoption" != "yes" ]; then fi +# In the above 'packages' section a python virtenv was created. Activate it, if that has not been done already. +if [ -f ${pythonvirtenvpath}/bin/activate ]; then + source ${pythonvirtenvpath}/bin/activate +fi + # check this on apple silicon: -export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" +export PATH="${homebrew_base_path}/opt/gnu-sed/libexec/gnubin:$PATH" cd $BOOST_SRC_FOLDER diff --git a/build_docs/2020/README.md b/build_docs/other/2020/README.md similarity index 100% rename from build_docs/2020/README.md rename to build_docs/other/2020/README.md diff --git a/build_docs/2020/linuxdocs.sh b/build_docs/other/2020/linuxdocs.sh similarity index 100% rename from build_docs/2020/linuxdocs.sh rename to build_docs/other/2020/linuxdocs.sh diff --git a/build_docs/2020/macosdocs.sh b/build_docs/other/2020/macosdocs.sh similarity index 100% rename from build_docs/2020/macosdocs.sh rename to build_docs/other/2020/macosdocs.sh diff --git a/build_docs/2020/windowsdocs.ps1 b/build_docs/other/2020/windowsdocs.ps1 similarity index 100% rename from build_docs/2020/windowsdocs.ps1 rename to build_docs/other/2020/windowsdocs.ps1 diff --git a/build_docs/other/README.md b/build_docs/other/README.md new file mode 100644 index 0000000..e7b800d --- /dev/null +++ b/build_docs/other/README.md @@ -0,0 +1,8 @@ + +## Miscellanous files + +- The 2020 folder contains an earlier copy of the build_docs scripts. + +- windows-2022-clang.ps1 is a powershell script to install Visual Studio C++ on Windows 2022. + + diff --git a/build_docs/other/windows-2022-clang.ps1 b/build_docs/other/windows-2022-clang.ps1 new file mode 100644 index 0000000..85aac9d --- /dev/null +++ b/build_docs/other/windows-2022-clang.ps1 @@ -0,0 +1,26 @@ + +iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) + +echo "You may need to close and re-open your shell window." + +choco install -y visualstudio2022buildtools --parameters \"--add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.CMake.Project\" +# choco install -y 7zip.install --version 22.1 +# choco install -y cmake.install --installargs '\"ADD_CMAKE_TO_PATH=System\"' --version 3.27.9 +# choco install -y curl --version 8.0.1 +choco install -y dotnetfx --version 4.8.0.20220524 +# choco install -y git.install --version 2.40.1 +# choco install -y hashdeep --version 4.4 +# choco install -y jq --version 1.6 +# choco install -y llvm --version 16.0.3 +choco install -y microsoft-build-tools --version 15.0.26320.2 +# choco install -y mingw --version 12.2.0.03042023 +# choco install -y notepadplusplus --version 8.5.2 +# choco install -y notepadplusplus.install --version 8.5.2 +# choco install -y rsync --version 6.2.8 +# choco install -y ruby --version 3.1.3.1 +choco install -y vcredist2017 --version 14.16.27033 +# choco install -y Wget --version 1.21.3 +choco install -y windows-sdk-10.1 --version 10.1.18362.1 +# choco install -y winscp --version 5.21.8 +# choco install -y winscp.install --version 5.21.8 +choco upgrade visualstudio2022-workload-vctools --package-parameters "--add Microsoft.VisualStudio.Component.VC.14.34.17.4.x86.x64" "--add Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64" "--add Microsoft.VisualStudio.Component.VC.v141.x86.x64" "--add Microsoft.VisualStudio.Component.VC.140" -y diff --git a/build_docs/windowsdocs.ps1 b/build_docs/windowsdocs.ps1 index 8f581d1..8162009 100755 --- a/build_docs/windowsdocs.ps1 +++ b/build_docs/windowsdocs.ps1 @@ -16,6 +16,7 @@ param ( ) $scriptname="windowsdocs.ps1" +$pythonvirtenvpath="${HOME}\venvboostdocs" # Set-PSDebug -Trace 1 @@ -287,6 +288,12 @@ if ( -Not ${skip-packages} ) { if ($typeoption -eq "main") { $ghostversion="9.56.1" + + if (!(Test-Path "${pythonvirtenvpath}\Scripts\activate")) { + python -m venv ${pythonvirtenvpath} + } + "${pythonvirtenvpath}\Scripts\activate" + choco install -y --no-progress ghostscript --version $ghostversion choco install -y --no-progress texlive choco install -y --no-progress graphviz @@ -325,9 +332,9 @@ if ( -Not ${skip-packages} ) { $file1="C:\Program Files\gs\gs9.56.1\bin\gswin32c.exe" $file2="C:\Program Files\gs\gs9.56.1\bin\gswin64c.exe" - if (-not(Test-Path -Path $file1 -PathType Leaf)) { + if (-not(Test-Path -Path $file1 -PathType Leaf)) { New-Item -ItemType SymbolicLink -Path $file1 -Target $file2 - } + } # Locking the version numbers in place offers a better guarantee of a known, good build. # At the same time, it creates a perpetual outstanding task, to upgrade the gem and pip versions @@ -383,6 +390,12 @@ if ( -Not ${skip-packages} ) { } +# In the above 'packages' section a python virtenv was created. Activate it, if that has not been done already. + +if ( Test-Path "${pythonvirtenvpath}\Scripts\activate" ) { + "${pythonvirtenvpath}\Scripts\activate" +} + # re-adding the path fix from above, even if skip-packages was set. $newpathitem="C:\Program Files\Git\usr\bin" if( (Test-Path -Path $newpathitem) -and -Not ( $env:Path -like "*$newpathitem*")) @@ -647,4 +660,3 @@ else { } popd -