diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 5eaed35ee9c30..fb1586901d5ed 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -197,6 +197,7 @@ copypasta'd copypasted copytruncate corechecks +corepack could've counteraaaaaaaaaaa cpf @@ -740,6 +741,7 @@ noauth nocapture nochild nodebuginfo +nodistro nofield nofree nomac diff --git a/scripts/environment/bootstrap-ubuntu-20.04.sh b/scripts/environment/bootstrap-ubuntu-20.04.sh index b5eedad16afca..1c03e031ce843 100755 --- a/scripts/environment/bootstrap-ubuntu-20.04.sh +++ b/scripts/environment/bootstrap-ubuntu-20.04.sh @@ -13,17 +13,17 @@ export ACCEPT_EULA=Y echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries -apt update --yes +apt-get update --yes -apt install --yes \ +apt-get install --yes \ software-properties-common \ apt-utils \ apt-transport-https -apt upgrade --yes +apt-get upgrade --yes # Deps -apt install --yes --no-install-recommends \ +apt-get install --yes --no-install-recommends \ awscli \ build-essential \ ca-certificates \ @@ -40,8 +40,6 @@ apt install --yes --no-install-recommends \ libssl-dev \ llvm \ locales \ - nodejs \ - npm \ pkg-config \ python3-pip \ rename \ @@ -50,8 +48,7 @@ apt install --yes --no-install-recommends \ shellcheck \ sudo \ unzip \ - wget \ - yarn + wget # Cue TEMP=$(mktemp -d) @@ -62,6 +59,7 @@ tar \ -xvf "${TEMP}/cue_v0.5.0_linux_amd64.tar.gz" \ -C "${TEMP}" cp "${TEMP}/cue" /usr/bin/cue +rm -rf "$TEMP" # Grease # Grease is used for the `make release-github` task. @@ -73,6 +71,7 @@ tar \ -xvf "${TEMP}/grease-1.0.1-linux-amd64.tar.gz" \ -C "${TEMP}" cp "${TEMP}/grease/bin/grease" /usr/bin/grease +rm -rf "$TEMP" # Locales locale-gen en_US.UTF-8 @@ -102,8 +101,8 @@ if ! [ -x "$(command -v docker)" ]; then xenial \ stable" # Install those new things - apt update --yes - apt install --yes docker-ce docker-ce-cli containerd.io + apt-get update --yes + apt-get install --yes docker-ce docker-ce-cli containerd.io # ubuntu user doesn't exist in scripts/environment/Dockerfile which runs this usermod --append --groups docker ubuntu || true @@ -117,8 +116,49 @@ fi bash scripts/environment/install-protoc.sh +# Node.js, npm and yarn. +# Note: the current LTS for the Node.js toolchain is 18.x +if ! [ -x "$(command -v node)" ]; then + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | apt-key add - + add-apt-repository \ + "deb [arch=$(dpkg --print-architecture)] https://deb.nodesource.com/node_18.x \ + nodistro \ + main" + # Install those new things + apt-get update --yes + apt-get install --yes nodejs + + # enable corepack (enables the yarn and pnpm package managers) + # ref: https://nodejs.org/docs/latest-v18.x/api/corepack.html + corepack enable +fi + +# Hugo (static site generator). +# Hugo is used to build the website content. +# Note: the installed version should match the version specified in 'netlify.toml' +TEMP=$(mktemp -d) +curl \ + -L https://github.com/gohugoio/hugo/releases/download/v0.84.0/hugo_extended_0.84.0_Linux-64bit.tar.gz \ + -o "${TEMP}/hugo_extended_0.84.0_Linux-64bit.tar.gz" +tar \ + -xvf "${TEMP}/hugo_extended_0.84.0_Linux-64bit.tar.gz" \ + -C "${TEMP}" +cp "${TEMP}/hugo" /usr/bin/hugo +rm -rf "$TEMP" + +# htmltest (HTML checker for the website content) +TEMP=$(mktemp -d) +curl \ + -L https://github.com/wjdp/htmltest/releases/download/v0.17.0/htmltest_0.17.0_linux_amd64.tar.gz \ + -o "${TEMP}/htmltest_0.17.0_linux_amd64.tar.gz" +tar \ + -xvf "${TEMP}/htmltest_0.17.0_linux_amd64.tar.gz" \ + -C "${TEMP}" +cp "${TEMP}/htmltest" /usr/bin/htmltest +rm -rf "$TEMP" + # Apt cleanup -apt clean +apt-get clean # Set up the default "deny all warnings" build flags CARGO_OVERRIDE_DIR="${HOME}/.cargo" @@ -146,6 +186,7 @@ if [ -z "${DISABLE_MOLD:-""}" ] ; then -C "${TEMP}" cp "${TEMP}/${MOLD_TARGET}/bin/mold" /usr/bin/mold cp "${TEMP}/${MOLD_TARGET}/lib/mold/mold-wrapper.so" /usr/bin/mold-wrapper.so + rm -rf "$TEMP" # Create our rustc wrapper script that we'll use to actually invoke `rustc` such that `mold` will wrap it and intercept # anything linking calls to use `mold` instead of `ld`, etc.