From 15c1ec668dbcf8b8e5767fdecd79aceae333b7d0 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 11:56:21 -0800 Subject: [PATCH 01/45] Fix build (update some incompatible deps), lints --- Cargo.lock | 202 +++++++++++++++++++++++++++++++++++++------------ Cargo.toml | 4 +- src/cli.rs | 3 +- src/fs_util.rs | 4 +- 4 files changed, 158 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cb2c2f1..24c4c43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "ambient-authority" -version = "0.0.1" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8ad6edb4840b78c5c3d88de606b22252d552b55f3a4699fbb10fc070ec3049" +checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" [[package]] name = "anyhow" @@ -85,6 +85,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + [[package]] name = "block-buffer" version = "0.10.3" @@ -108,33 +114,31 @@ checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "cap-primitives" -version = "0.25.3" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba063daa90ed40882bb288ac4ecaa942d655d15cf74393d41d2267b5d7daf120" +checksum = "90a0b44fc796b1a84535a63753d50ba3972c4db55c7255c186f79140e63d56d0" dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes", + "io-lifetimes 2.0.3", "ipnet", "maybe-owned", - "rustix", - "winapi-util", - "windows-sys", + "rustix 0.38.30", + "windows-sys 0.52.0", "winx", ] [[package]] name = "cap-std" -version = "0.25.3" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3a603c9f3bd2181ed128ab3cd32fbde7cff76afc64a3576662701c4aee7e2b" +checksum = "266626ce180cf9709f317d0bf9754e3a5006359d87f4bf792f06c9c5f1b63c0f" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes", - "ipnet", - "rustix", + "io-lifetimes 2.0.3", + "rustix 0.38.30", ] [[package]] @@ -156,7 +160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a1af219c3e254a8b4649d6ddaef886b2015089f35f2ac5e1db31410c0566ab8" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_derive", "clap_lex", "once_cell", @@ -259,7 +263,7 @@ dependencies = [ "rand", "regex", "reqwest", - "rustix", + "rustix 0.38.30", "serde", "serde_json", "serde_yaml", @@ -307,6 +311,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -335,7 +349,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -370,13 +384,13 @@ dependencies = [ [[package]] name = "fs-set-times" -version = "0.17.1" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a267b6a9304912e018610d53fe07115d8b530b160e85db4d2d3a59f3ddde1aec" +checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ - "io-lifetimes", - "rustix", - "windows-sys", + "io-lifetimes 2.0.3", + "rustix 0.38.30", + "windows-sys 0.52.0", ] [[package]] @@ -615,12 +629,12 @@ dependencies = [ [[package]] name = "io-extras" -version = "0.15.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5d8c2ab5becd8720e30fd25f8fa5500d8dc3fceadd8378f05859bd7b46fc49" +checksum = "c301e73fb90e8a29e600a9f402d095765f74310d582916a952f618836a1bd1ed" dependencies = [ - "io-lifetimes", - "windows-sys", + "io-lifetimes 2.0.3", + "windows-sys 0.52.0", ] [[package]] @@ -629,6 +643,12 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" +[[package]] +name = "io-lifetimes" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" + [[package]] name = "ipnet" version = "2.5.0" @@ -658,9 +678,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.134" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linked-hash-map" @@ -674,6 +694,12 @@ version = "0.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + [[package]] name = "log" version = "0.4.17" @@ -719,7 +745,7 @@ dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -771,7 +797,7 @@ version = "0.10.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "foreign-types", "libc", @@ -924,7 +950,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1002,14 +1028,27 @@ version = "0.35.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbb2fda4666def1433b1b05431ab402e42a1084285477222b72d6c564c417cef" dependencies = [ - "bitflags", - "errno", - "io-lifetimes", + "bitflags 1.3.2", + "errno 0.2.8", + "io-lifetimes 0.7.3", + "libc", + "linux-raw-sys 0.0.46", + "windows-sys 0.36.1", +] + +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno 0.3.8", "itoa", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.13", "once_cell", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1025,7 +1064,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1034,7 +1073,7 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -1216,8 +1255,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8440c860cf79def6164e4a0a983bcc2305d82419177a0e0c71930d049e3ac5a1" dependencies = [ - "rustix", - "windows-sys", + "rustix 0.35.11", + "windows-sys 0.36.1", ] [[package]] @@ -1508,43 +1547,109 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winreg" version = "0.10.1" @@ -1556,13 +1661,12 @@ dependencies = [ [[package]] name = "winx" -version = "0.33.0" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b01e010390eb263a4518c8cebf86cb67469d1511c00b749a47b64c39e8054d" +checksum = "f9643b83820c0cd246ecabe5fa454dd04ba4fa67996369466d0747472d337346" dependencies = [ - "bitflags", - "io-lifetimes", - "windows-sys", + "bitflags 2.4.2", + "windows-sys 0.52.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c09ab82..6dddbf9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ path = "src/main.rs" [dependencies] anyhow = { version = "1.0.60", features = ["backtrace"] } atty = "0.2.14" -cap-std = "0.25.2" +cap-std = "3.0.0" clap = { version = "4.0.7", features = ["derive", "wrap_help"] } clap_complete = "4.0.2" indoc = "1.0.7" @@ -30,7 +30,7 @@ lazy_static = "1.4.0" rand = "0.8.5" regex = "1.6.0" reqwest = { version = "0.11.11", features = ["blocking"] } -rustix = { version = "0.35.7", features = ["process"] } +rustix = { version = "0.38.30", features = ["fs", "process"] } serde = { version = "1.0.143", features = ["derive"] } serde_json = "1.0.83" serde_yaml = "0.9.10" diff --git a/src/cli.rs b/src/cli.rs index 6e05a4d..6365188 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -6,7 +6,6 @@ use clap::{Parser, Subcommand}; use clap_complete::{generate, shells::Shell}; -use std::borrow::Borrow; use std::collections::BTreeSet; use std::fmt::{self, Debug, Display}; use std::io; @@ -547,7 +546,7 @@ fn matching_environments( for pattern in patterns { let start = matched.len(); matched.extend(drain_filter(&mut unmatched, |name| pattern.matches(name))); - if matched.len() == start && !matched.iter().any(|name| pattern.matches(name.borrow())) { + if matched.len() == start && !matched.iter().any(|name| pattern.matches(name)) { if pattern.0.is_pattern() { warn(anyhow!( "pattern {pattern} did not match any environment names" diff --git a/src/fs_util.rs b/src/fs_util.rs index f230315..eae1b11 100644 --- a/src/fs_util.rs +++ b/src/fs_util.rs @@ -95,7 +95,7 @@ pub fn file_size(metadata: &std::fs::Metadata) -> Option { pub fn file_size_cap(metadata: &cap_std::fs::Metadata) -> Option { #[cfg(unix)] return { - use std::os::unix::fs::MetadataExt; + use cap_std::fs::MetadataExt; Some(metadata.size()) }; #[allow(unreachable_code)] @@ -300,7 +300,7 @@ pub fn create_tar_from_dir(dir: &HostPath, w: W, opts: &TarOptions } #[cfg(unix)] { - use std::os::unix::fs::MetadataExt; + use cap_std::fs::MetadataExt; let metadata = entry.metadata().todo_context()?; let mut header = tar::Header::new_gnu(); header.set_mtime(metadata.mtime() as u64); From 5f32627bc479fd043ad900f46ebbfd2408c172c0 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 12:12:31 -0800 Subject: [PATCH 02/45] Update from Debian 11 (bullseye) to Debian 12 (bookworm) --- .github/workflows/main.yaml | 6 +++--- docs/Bubblewrap.md | 6 +++--- docs/Docker.md | 8 +++---- docs/Packages.md | 2 +- packages/configs-core/profile.d/00-path.sh | 2 +- packages/configs-core/profile.d/path/60-os | 4 ++-- packages/mold/package.toml | 2 +- src/bin/gen_github_yaml.rs | 2 +- src/docker.rs | 21 +++++++++---------- src/os_util.rs | 2 +- .../cubicle__docker__tests__Dockerfile.snap | 4 ++-- 11 files changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f78952b..39f31c7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -190,7 +190,7 @@ jobs: eval "$(docker-machine env default)" && \ env | grep DOCKER >> $GITHUB_ENV - name: Docker hello world - run: docker run --rm debian:11 echo 'Hello world' + run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact uses: actions/download-artifact@v3 with: @@ -236,7 +236,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Docker hello world - run: docker run --rm debian:11 echo 'Hello world' + run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact uses: actions/download-artifact@v3 with: @@ -259,7 +259,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Docker hello world - run: docker run --rm debian:11 echo 'Hello world' + run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact uses: actions/download-artifact@v3 with: diff --git a/docs/Bubblewrap.md b/docs/Bubblewrap.md index 713222e..9fb5646 100644 --- a/docs/Bubblewrap.md +++ b/docs/Bubblewrap.md @@ -54,7 +54,7 @@ This [short C program](https://github.com/bradfa/tlpi-dist/blob/master/seccomp/dump_seccomp_filter.c) can dump a compiled BFP seccomp filter that is installed in a running process. It uses -[`PTRACE_SECCOMP_GET_FILTER`](https://manpages.debian.org/bullseye/manpages-dev/ptrace.2.en.html#PTRACE_SECCOMP_GET_FILTER) +[`PTRACE_SECCOMP_GET_FILTER`](https://manpages.debian.org/bookworm/manpages-dev/ptrace.2.en.html#PTRACE_SECCOMP_GET_FILTER) to do this. Extracting a filter this way can be easier than trying to compile a BPF filter from the above source code. @@ -66,7 +66,7 @@ shell scripts for package setup that run in containers. ### Installing Dependencies You'll need [Rust and Cargo](https://www.rust-lang.org/tools/install). The -version in Debian 11 is too old. +version in Debian 12 may be too old. Install the other dependencies: @@ -78,7 +78,7 @@ Install the other dependencies: - `jq` - command-line JSON processor. - `pv` - pipe viewer, displays progress bars. -On Debian 11, you can install the dependencies using `apt`: +On Debian 12, you can install the dependencies using `apt`: ```sh sudo apt install bubblewrap curl git jq pv diff --git a/docs/Docker.md b/docs/Docker.md index 633c3ad..f2d9aa5 100644 --- a/docs/Docker.md +++ b/docs/Docker.md @@ -28,7 +28,7 @@ shell scripts for package setup that run in containers. ### Installing Dependencies -[Install Docker](https://docs.docker.com/get-docker/). On Debian 11, you can +[Install Docker](https://docs.docker.com/get-docker/). On Debian 12, you can install it using `apt`: ```sh @@ -56,13 +56,13 @@ cargo build --release ``` Alternatively, you can use Docker to run the Rust compiler, if the host system -is similar enough to Debian 11 (Bullseye): +is similar enough to Debian 12 (Bookworm): ```sh docker run --rm \ --user "$(id -u):$(id -g)" \ -v "$PWD:$PWD" -w "$PWD" \ - rust:1-bullseye \ + rust:1-bookworm \ cargo build --release ``` @@ -179,7 +179,7 @@ Each Cubicle environment consists of three logical filesystem layers: | 3. work | cub-ENV-work Docker volume | `~/w/` | long | 1. The base operating system. This is the "cub-cubicle-base" Docker image that - is built automatically by Cubicle. It's currently based on Debian 11. + is built automatically by Cubicle. It's currently based on Debian 12. 2. A home directory. Inside the environment, this is at the same path as the host's `$HOME`, but it's not shared with the host. It lives in diff --git a/docs/Packages.md b/docs/Packages.md index e831161..9979366 100644 --- a/docs/Packages.md +++ b/docs/Packages.md @@ -26,7 +26,7 @@ Cubicle can also manage two types of third-party packages: 1. Depending on the runner used, Cubicle can install or verify the installation of operating system-level packages. For example, you can depend on `debian.sl` to have Cubicle install the - [Steam Locomotive package](https://packages.debian.org/bullseye/sl) using + [Steam Locomotive package](https://packages.debian.org/bookworm/sl) using `apt`. Currently, only the `debian` namespace is supported. 2. Some special Cubicle packages are designated as package managers. They can diff --git a/packages/configs-core/profile.d/00-path.sh b/packages/configs-core/profile.d/00-path.sh index e02f131..e4a964c 100644 --- a/packages/configs-core/profile.d/00-path.sh +++ b/packages/configs-core/profile.d/00-path.sh @@ -1,2 +1,2 @@ -PATH=$(sed -e "s|\$HOME|$HOME|" ~/.config/profile.d/path/* | sed -z 's/\n/:/g;s/:$/\n/') +PATH=$(sed -e "s/#.*//;s|\$HOME|$HOME|" ~/.config/profile.d/path/* | sed -z 's/\n/:/g;s/:$/\n/') export PATH diff --git a/packages/configs-core/profile.d/path/60-os b/packages/configs-core/profile.d/path/60-os index 8d85c1a..8a5271f 100644 --- a/packages/configs-core/profile.d/path/60-os +++ b/packages/configs-core/profile.d/path/60-os @@ -1,4 +1,4 @@ +# The paths `/sbin` and `/bin` aren't needed, since they're symlinks (after +# usrmerge in Debian 12). /usr/sbin /usr/bin -/sbin -/bin diff --git a/packages/mold/package.toml b/packages/mold/package.toml index fad3a55..12fb5ed 100644 --- a/packages/mold/package.toml +++ b/packages/mold/package.toml @@ -1,6 +1,6 @@ [depends.debian] clang = {} -"libssl1.1" = {} +libssl3 = {} zlib1g = {} [build_depends.debian] diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 8cc8e56..ad2c55c 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -546,7 +546,7 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) steps.push(Step { name: s("Docker hello world"), details: Run { - run: s("docker run --rm debian:11 echo 'Hello world'"), + run: s("docker run --rm debian:12 echo 'Hello world'"), }, env: dict! {}, }); diff --git a/src/docker.rs b/src/docker.rs index 9fb4bcc..5f88892 100644 --- a/src/docker.rs +++ b/src/docker.rs @@ -470,7 +470,7 @@ impl Docker { name.encoded() )) .arg("--rm") - .arg("debian:11") + .arg("debian:12") .arg("du") .arg("--block-size=1") .arg("--summarize") @@ -574,7 +574,7 @@ impl Docker { )) .arg("--rm") .args(["--workdir", "/v"]) - .arg("debian:11") + .arg("debian:12") .arg("cat") .arg(path) .stdout(Stdio::piped()) @@ -978,10 +978,8 @@ fn fallback_path(container_home: &EnvPath) -> OsString { let home_bin = container_home.join("bin"); let paths = [ home_bin.as_env_raw(), - // The debian:11 image hasn't gone through usrmerge, so - // /usr/bin and /bin are distinct there. - Path::new("/bin"), - Path::new("/sbin"), + // The debian:12 image has usrmerge, so /bin and /sbin are symlinks and + // do not need to be included. Path::new("/usr/bin"), Path::new("/usr/sbin"), ]; @@ -1000,6 +998,7 @@ fn fallback_path(container_home: &EnvPath) -> OsString { /// Debian packages that many packages might depend on for basic functionality. /// They are installed in the CI system. const BASE_PACKAGES: &[&str] = &[ + "apt-utils", // Silences a warning from apt about package configuration. "bzip2", "ca-certificates", "curl", @@ -1043,8 +1042,8 @@ fn write_dockerfile(w: &mut W, args: DockerfileArgs) -> std::io::R std::mem::drop(args); // Note: If we wanted to trim this down even more for CI, we might be able - // to use the '11-slim' base image here. - writeln!(w, "FROM debian:11")?; + // to use the '12-slim' base image here. + writeln!(w, "FROM debian:12")?; // Set time zone. writeln!(w, "RUN echo {timezone} > /etc/timezone && \\")?; @@ -1083,7 +1082,7 @@ fn write_dockerfile(w: &mut W, args: DockerfileArgs) -> std::io::R // Configure and Update apt. writeln!( w, - r#"RUN sed -i 's/ main$/ main contrib non-free/' /etc/apt/sources.list"# + r#"RUN sed -i 's/^Components: main$/Components: main contrib non-free/' /etc/apt/sources.list.d/debian.sources"# )?; writeln!(w, "RUN apt-get update && apt-get upgrade --yes")?; @@ -1127,11 +1126,11 @@ mod tests { fn fallback_path() { assert_snapshot!( super::fallback_path(&EnvPath::try_from(PathBuf::from("/home/foo")).unwrap()).to_string_lossy(), - @"PATH=/home/foo/bin:/bin:/sbin:/usr/bin:/usr/sbin" + @"PATH=/home/foo/bin:/usr/bin:/usr/sbin" ); assert_snapshot!( super::fallback_path(&EnvPath::try_from(PathBuf::from("/home/fo:oo")).unwrap()).to_string_lossy(), - @"PATH=/bin:/sbin:/usr/bin:/usr/sbin" + @"PATH=/usr/bin:/usr/sbin" ); } diff --git a/src/os_util.rs b/src/os_util.rs index 8b161b7..eaf92b3 100644 --- a/src/os_util.rs +++ b/src/os_util.rs @@ -81,7 +81,7 @@ fn try_get_timezone() -> Option { /// Returns the name of a time zone from a filesystem path inside a timezone /// database directory. fn timezone_from_localtime_target(path: &Path) -> Option { - // Debian 11 has its timezone db at '/usr/share/zoneinfo/'. + // Debian 12 has its timezone db at '/usr/share/zoneinfo/'. // Mac OS 12 has its timezone db at '/var/db/timezone/zoneinfo/'. let mut iter = path.iter(); loop { diff --git a/src/snapshots/cubicle__docker__tests__Dockerfile.snap b/src/snapshots/cubicle__docker__tests__Dockerfile.snap index 27294ea..36fff0c 100644 --- a/src/snapshots/cubicle__docker__tests__Dockerfile.snap +++ b/src/snapshots/cubicle__docker__tests__Dockerfile.snap @@ -2,7 +2,7 @@ source: src/docker.rs expression: dockerfile --- -FROM debian:11 +FROM debian:12 RUN echo "Etc/Timez'one" > /etc/timezone && \ ln -fs '/usr/share/zoneinfo/'"Etc/Timez'one" /etc/localtime RUN addgroup --gid 7331 "h#x*r" || addgroup "h#x*r" && \ @@ -10,7 +10,7 @@ RUN addgroup --gid 7331 "h#x*r" || addgroup "h#x*r" && \ adduser "h#x*r" sudo && \ mkdir /home/"h#x*r"/w && \ chown "h#x*r":"h#x*r" /home/"h#x*r"/w -RUN sed -i 's/ main$/ main contrib non-free/' /etc/apt/sources.list +RUN sed -i 's/^Components: main$/Components: main contrib non-free/' /etc/apt/sources.list.d/debian.sources RUN apt-get update && apt-get upgrade --yes RUN apt-get install --no-install-recommends --yes \ apt-file \ From 1dbd556427295bf327d0d806081399abcedb282b Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 15:28:06 -0800 Subject: [PATCH 03/45] Update all dependencies Ran `cargo upgrade` from cargo-edit (with workaround from ) and `cargo update`. --- Cargo.lock | 865 ++++++++++-------- Cargo.toml | 32 +- src/bubblewrap.rs | 2 +- src/docker.rs | 8 +- .../cubicle__docker__tests__Dockerfile.snap | 12 +- src/user.rs | 2 +- 6 files changed, 491 insertions(+), 430 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24c4c43..8570a49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.19" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -32,11 +32,59 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" +[[package]] +name = "anstream" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" -version = "1.0.65" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" dependencies = [ "backtrace", ] @@ -47,7 +95,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -60,9 +108,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -75,9 +123,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bitflags" @@ -93,24 +141,24 @@ checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytes" -version = "1.2.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cap-primitives" @@ -121,10 +169,10 @@ dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "ipnet", "maybe-owned", - "rustix 0.38.30", + "rustix", "windows-sys 0.52.0", "winx", ] @@ -137,15 +185,18 @@ checksum = "266626ce180cf9709f317d0bf9754e3a5006359d87f4bf792f06c9c5f1b63c0f" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes 2.0.3", - "rustix 0.38.30", + "io-lifetimes", + "rustix", ] [[package]] name = "cc" -version = "1.0.73" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -155,37 +206,43 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.0.7" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1af219c3e254a8b4649d6ddaef886b2015089f35f2ac5e1db31410c0566ab8" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ - "atty", - "bitflags 1.3.2", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "once_cell", "strsim", - "termcolor", - "terminal_size 0.2.1", + "terminal_size", ] [[package]] name = "clap_complete" -version = "4.0.2" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cba7abac9b56dfe2f035098cdb3a43946f276e6db83b72c4e692343f9aab9a" +checksum = "df631ae429f6613fcd3a7c1adbdb65f637271e561b03680adaa6573015dfb106" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.0.7" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd114ae53ce5a0670f43d2f169c1cd26c69b4896b0c121900cf1e4d06d67316c" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", "syn", @@ -193,31 +250,33 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "console" -version = "0.15.2" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", - "terminal_size 0.1.17", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -225,15 +284,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -263,7 +322,7 @@ dependencies = [ "rand", "regex", "reqwest", - "rustix 0.38.30", + "rustix", "serde", "serde_json", "serde_yaml", @@ -277,9 +336,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.5" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -293,23 +352,18 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] -name = "errno" -version = "0.2.8" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" @@ -321,35 +375,22 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "fastrand" -version = "1.8.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "filetime" -version = "0.2.17" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys 0.36.1", + "windows-sys 0.52.0", ] [[package]] @@ -375,9 +416,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -388,49 +429,49 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ - "io-lifetimes 2.0.3", - "rustix 0.38.30", + "io-lifetimes", + "rustix", "windows-sys 0.52.0", ] [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-io", @@ -443,9 +484,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -453,9 +494,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -464,15 +505,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "h2" -version = "0.3.14" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -489,15 +530,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -508,11 +549,17 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + [[package]] name = "http" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -521,9 +568,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -538,15 +585,15 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -581,9 +628,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -591,25 +638,25 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] [[package]] name = "indoc" -version = "1.0.7" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adab1eaa3408fb7f0c777a73e7465fd5656136fc93b670eb6df3c88c2c1344e3" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" [[package]] name = "insta" -version = "1.21.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581d4e3314cae4536e5d22ffd23189d4a374696c5ef733eadafae0ed273fd303" +checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" dependencies = [ "console", "lazy_static", @@ -618,31 +665,16 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "io-extras" version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c301e73fb90e8a29e600a9f402d095765f74310d582916a952f618836a1bd1ed" dependencies = [ - "io-lifetimes 2.0.3", + "io-lifetimes", "windows-sys 0.52.0", ] -[[package]] -name = "io-lifetimes" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" - [[package]] name = "io-lifetimes" version = "2.0.3" @@ -651,21 +683,21 @@ checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" [[package]] name = "ipnet" -version = "2.5.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -688,12 +720,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.0.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -702,12 +728,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "maybe-owned" @@ -717,42 +740,41 @@ checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.5.4" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.4" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", - "log", "wasi", - "windows-sys 0.36.1", + "windows-sys 0.48.0", ] [[package]] name = "native-tls" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", @@ -768,36 +790,36 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.4", "libc", ] [[package]] name = "object" -version = "0.29.0" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.15.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.42" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -808,9 +830,9 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", @@ -825,34 +847,27 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.76" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230151e44c0f05157effb743e8d517472843121cf9243e8b81393edb5acd9ce" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ - "autocfg", "cc", "libc", "pkg-config", "vcpkg", ] -[[package]] -name = "os_str_bytes" -version = "6.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" - [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -862,54 +877,30 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.46" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.21" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -946,44 +937,47 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.6.0" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", + "regex-automata", "regex-syntax", ] [[package]] -name = "regex-syntax" -version = "0.6.27" +name = "regex-automata" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.12" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "base64", "bytes", @@ -1003,9 +997,12 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -1018,23 +1015,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" - -[[package]] -name = "rustix" -version = "0.35.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb2fda4666def1433b1b05431ab402e42a1084285477222b72d6c564c417cef" -dependencies = [ - "bitflags 1.3.2", - "errno 0.2.8", - "io-lifetimes 0.7.3", - "libc", - "linux-raw-sys 0.0.46", - "windows-sys 0.36.1", -] +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" @@ -1043,35 +1026,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ "bitflags 2.4.2", - "errno 0.3.8", + "errno", "itoa", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "once_cell", "windows-sys 0.52.0", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "schannel" -version = "0.1.20" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "windows-sys 0.52.0", ] [[package]] name = "security-framework" -version = "2.7.0" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -1082,9 +1073,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -1092,18 +1083,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.145" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.145" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -1112,15 +1103,24 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -1135,9 +1135,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.13" +version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8613d593412a0deb7bbd8de9d908efff5a0cb9ccd8f62c641e7b2ed2f57291d1" +checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ "indexmap", "itoa", @@ -1148,9 +1148,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -1159,33 +1159,33 @@ dependencies = [ [[package]] name = "shlex" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "similar" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" +checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "socket2" -version = "0.4.7" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1196,9 +1196,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.101" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1206,57 +1206,64 @@ dependencies = [ ] [[package]] -name = "tar" -version = "0.4.38" +name = "sync_wrapper" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "filetime", - "libc", - "xattr", + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", ] [[package]] -name = "tempfile" -version = "3.3.0" +name = "system-configuration-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ - "cfg-if", - "fastrand", + "core-foundation-sys", "libc", - "redox_syscall", - "remove_dir_all", - "winapi", ] [[package]] -name = "termcolor" -version = "1.1.3" +name = "tar" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" dependencies = [ - "winapi-util", + "filetime", + "libc", + "xattr", ] [[package]] -name = "terminal_size" -version = "0.1.17" +name = "tempfile" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ - "libc", - "winapi", + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", ] [[package]] name = "terminal_size" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8440c860cf79def6164e4a0a983bcc2305d82419177a0e0c71930d049e3ac5a1" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.35.11", - "windows-sys 0.36.1", + "rustix", + "windows-sys 0.48.0", ] [[package]] @@ -1270,32 +1277,31 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.21.2" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "pin-project-lite", "socket2", - "winapi", + "windows-sys 0.48.0", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -1303,9 +1309,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -1317,11 +1323,36 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" dependencies = [ "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] @@ -1332,47 +1363,46 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.4" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -1385,21 +1415,27 @@ dependencies = [ [[package]] name = "unsafe-libyaml" -version = "0.2.4" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e5fa573d8ac5f1a856f8d7be41d390ee973daf97c806b2c1a465e4e1406e68" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "url" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "vcpkg" version = "0.2.15" @@ -1414,11 +1450,10 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -1430,9 +1465,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1440,9 +1475,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -1455,9 +1490,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -1467,9 +1502,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1477,9 +1512,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -1490,15 +1525,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -1506,9 +1541,9 @@ dependencies = [ [[package]] name = "wildmatch" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee583bdc5ff1cf9db20e9db5bb3ff4c3089a8f6b8b31aff265c9aba85812db86" +checksum = "495ec47bf3c1345005f40724f0269362c8556cbc43aed0526ed44cae1d35fceb" [[package]] name = "winapi" @@ -1526,15 +1561,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -1543,15 +1569,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets 0.48.5", ] [[package]] @@ -1560,7 +1582,22 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -1569,15 +1606,21 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm", + "windows_aarch64_gnullvm 0.52.0", "windows_aarch64_msvc 0.52.0", "windows_i686_gnu 0.52.0", "windows_i686_msvc 0.52.0", "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm", + "windows_x86_64_gnullvm 0.52.0", "windows_x86_64_msvc 0.52.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.0" @@ -1586,9 +1629,9 @@ checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" @@ -1598,9 +1641,9 @@ checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" @@ -1610,9 +1653,9 @@ checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" @@ -1622,9 +1665,9 @@ checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" @@ -1632,6 +1675,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.0" @@ -1640,9 +1689,9 @@ checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" @@ -1650,13 +1699,23 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "winnow" +version = "0.5.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "818ce546a11a9986bc24f93d0cdf38a8a1a400f1473ea8c82e59f6e0ffab9249" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -1671,11 +1730,13 @@ dependencies = [ [[package]] name = "xattr" -version = "0.2.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", + "linux-raw-sys", + "rustix", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 6dddbf9..8a84f1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,28 +18,28 @@ name = "cub" path = "src/main.rs" [dependencies] -anyhow = { version = "1.0.60", features = ["backtrace"] } +anyhow = { version = "1.0.79", features = ["backtrace"] } atty = "0.2.14" cap-std = "3.0.0" -clap = { version = "4.0.7", features = ["derive", "wrap_help"] } -clap_complete = "4.0.2" -indoc = "1.0.7" +clap = { version = "4.4.18", features = ["derive", "wrap_help"] } +clap_complete = "4.4.9" +indoc = "2.0.4" # this is a dev-dependency but needed in `system_test` bin -insta = "1.18.2" +insta = "1.34.0" lazy_static = "1.4.0" rand = "0.8.5" -regex = "1.6.0" -reqwest = { version = "0.11.11", features = ["blocking"] } +regex = "1.10.3" +reqwest = { version = "0.11.24", features = ["blocking"] } rustix = { version = "0.38.30", features = ["fs", "process"] } -serde = { version = "1.0.143", features = ["derive"] } -serde_json = "1.0.83" -serde_yaml = "0.9.10" -sha2 = "0.10.6" -shlex = "1.1.0" -tar = "0.4.38" -tempfile = "3.3.0" -toml = "0.5.9" -wildmatch = "2.1.1" +serde = { version = "1.0.196", features = ["derive"] } +serde_json = "1.0.113" +serde_yaml = "0.9.31" +sha2 = "0.10.8" +shlex = "1.3.0" +tar = "0.4.40" +tempfile = "3.9.0" +toml = "0.8.9" +wildmatch = "2.3.0" [dev-dependencies] diff --git a/src/bubblewrap.rs b/src/bubblewrap.rs index 36ad01f..1195eca 100644 --- a/src/bubblewrap.rs +++ b/src/bubblewrap.rs @@ -243,7 +243,7 @@ impl Bubblewrap { RunnerCommand::Interactive => {} RunnerCommand::Exec { command: exec, .. } => { command.arg("-c"); - command.arg(shlex::join(exec.iter().map(|a| a.as_str()))); + command.arg(shlex::try_join(exec.iter().map(|a| a.as_str())).expect("TODO")); } } diff --git a/src/docker.rs b/src/docker.rs index 5f88892..1ee0c23 100644 --- a/src/docker.rs +++ b/src/docker.rs @@ -691,7 +691,7 @@ impl Docker { RunnerCommand::Interactive => {} RunnerCommand::Exec { command: exec, .. } => { command.arg("-c"); - command.arg(shlex::join(exec.iter().map(|a| a.as_str()))); + command.arg(shlex::try_join(exec.iter().map(|a| a.as_str())).expect("TODO")); } } @@ -1028,10 +1028,10 @@ fn write_dockerfile(w: &mut W, args: DockerfileArgs) -> std::io::R let packages: Vec = args .packages .iter() - .map(|p| shlex::quote(p).into_owned()) + .map(|p| shlex::try_quote(p).expect("TODO").into_owned()) .collect(); - let timezone = shlex::quote(args.timezone); - let user = shlex::quote(args.user); + let timezone = shlex::try_quote(args.timezone).expect("TODO"); + let user = shlex::try_quote(args.user).expect("TODO"); let has_apt_file = args.packages.contains("apt-file"); let has_sudo = args.packages.contains("sudo"); let uid = args.uids.real_user; diff --git a/src/snapshots/cubicle__docker__tests__Dockerfile.snap b/src/snapshots/cubicle__docker__tests__Dockerfile.snap index 36fff0c..57b3d59 100644 --- a/src/snapshots/cubicle__docker__tests__Dockerfile.snap +++ b/src/snapshots/cubicle__docker__tests__Dockerfile.snap @@ -5,16 +5,16 @@ expression: dockerfile FROM debian:12 RUN echo "Etc/Timez'one" > /etc/timezone && \ ln -fs '/usr/share/zoneinfo/'"Etc/Timez'one" /etc/localtime -RUN addgroup --gid 7331 "h#x*r" || addgroup "h#x*r" && \ - adduser --disabled-password --gecos '' --uid 1337 --ingroup "h#x*r" "h#x*r" && \ - adduser "h#x*r" sudo && \ - mkdir /home/"h#x*r"/w && \ - chown "h#x*r":"h#x*r" /home/"h#x*r"/w +RUN addgroup --gid 7331 'h#x*r' || addgroup 'h#x*r' && \ + adduser --disabled-password --gecos '' --uid 1337 --ingroup 'h#x*r' 'h#x*r' && \ + adduser 'h#x*r' sudo && \ + mkdir /home/'h#x*r'/w && \ + chown 'h#x*r':'h#x*r' /home/'h#x*r'/w RUN sed -i 's/^Components: main$/Components: main contrib non-free/' /etc/apt/sources.list.d/debian.sources RUN apt-get update && apt-get upgrade --yes RUN apt-get install --no-install-recommends --yes \ apt-file \ - "pack#age1" \ + 'pack#age1' \ package2 \ sudo RUN apt-file update diff --git a/src/user.rs b/src/user.rs index 646b38a..bcca644 100644 --- a/src/user.rs +++ b/src/user.rs @@ -353,7 +353,7 @@ impl User { command.arg("-c"); command.arg(format!( "cd w && {}", - shlex::join(exec.iter().map(|a| a.as_str())) + shlex::try_join(exec.iter().map(|a| a.as_str())).expect("TODO") )); } } From 23b6016dd3c6e1bf9e264613298b7f891bfdc05a Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 15:31:19 -0800 Subject: [PATCH 04/45] Remove atty dependency --- Cargo.lock | 45 +-------------------------------------------- Cargo.toml | 1 - src/docker.rs | 7 ++----- 3 files changed, 3 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8570a49..4eb5916 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,17 +89,6 @@ dependencies = [ "backtrace", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -312,7 +301,6 @@ name = "cubicle" version = "0.0.0" dependencies = [ "anyhow", - "atty", "cap-std", "clap", "clap_complete", @@ -540,15 +528,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.4" @@ -794,7 +773,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.4", + "hermit-abi", "libc", ] @@ -1545,28 +1524,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "495ec47bf3c1345005f40724f0269362c8556cbc43aed0526ed44cae1d35fceb" -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" version = "0.48.0" diff --git a/Cargo.toml b/Cargo.toml index 8a84f1c..1381847 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ path = "src/main.rs" [dependencies] anyhow = { version = "1.0.79", features = ["backtrace"] } -atty = "0.2.14" cap-std = "3.0.0" clap = { version = "4.4.18", features = ["derive", "wrap_help"] } clap_complete = "4.4.9" diff --git a/src/docker.rs b/src/docker.rs index 1ee0c23..e768b05 100644 --- a/src/docker.rs +++ b/src/docker.rs @@ -2,7 +2,7 @@ use lazy_static::lazy_static; use regex::{Regex, RegexBuilder}; use std::collections::BTreeSet; use std::ffi::{OsStr, OsString}; -use std::io::{self, BufRead, Write}; +use std::io::{self, BufRead, IsTerminal, Write}; use std::path::Path; use std::process::Stdio; use std::rc::Rc; @@ -678,10 +678,7 @@ impl Docker { // If we really don't have a TTY, Docker will exit with status 1 when // we request one. - if atty::is(atty::Stream::Stdin) - || atty::is(atty::Stream::Stdout) - || atty::is(atty::Stream::Stderr) - { + if io::stdin().is_terminal() || io::stdout().is_terminal() || io::stderr().is_terminal() { command.arg("--tty"); } From d20f3a6123df97ac2a68040f701f8598e7cbcc4c Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 15:37:29 -0800 Subject: [PATCH 05/45] Fix clippy lints --- src/bubblewrap.rs | 14 +++++++------- src/cli.rs | 3 ++- src/docker.rs | 6 +++--- src/packages.rs | 10 +++++----- src/randname.rs | 6 +++--- src/user.rs | 6 +++--- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/bubblewrap.rs b/src/bubblewrap.rs index 1195eca..66e2616 100644 --- a/src/bubblewrap.rs +++ b/src/bubblewrap.rs @@ -187,7 +187,7 @@ impl Bubblewrap { match run { RunnerCommand::Interactive => {} RunnerCommand::Exec { env_vars, .. } => { - for (var, value) in env_vars.iter() { + for (var, value) in *env_vars { command.env(var, value); } } @@ -202,7 +202,7 @@ impl Bubblewrap { command.args(["--symlink", "/usr/bin", "/bin"]); command.args(["--dev", "/dev"]); - for (host_path, env_path) in bind.iter() { + for (host_path, env_path) in bind { command .arg("--ro-bind-try") .arg(host_path.as_host_raw()) @@ -276,7 +276,7 @@ where // This is pretty ugly, but it's how bwrap likes it. let mut flags = rustix::fs::fcntl_getfd(file)?; flags.remove(rustix::fs::FdFlags::CLOEXEC); - rustix::fs::fcntl_setfd(&file, flags)?; + rustix::fs::fcntl_setfd(file, flags)?; Ok(file.as_raw_fd().to_string()) } @@ -293,7 +293,7 @@ impl Runner for Bubblewrap { ) -> Result<()> { let Dirs { host_home, .. } = self.dirs(name); let home_dir = cap_std::fs::Dir::open_ambient_dir( - &host_home.as_host_raw(), + host_home.as_host_raw(), cap_std::ambient_authority(), ) .todo_context()?; @@ -310,7 +310,7 @@ impl Runner for Bubblewrap { ) -> Result<()> { let Dirs { host_work, .. } = self.dirs(name); let work_dir = cap_std::fs::Dir::open_ambient_dir( - &host_work.as_host_raw(), + host_work.as_host_raw(), cap_std::ambient_authority(), ) .todo_context()?; @@ -324,8 +324,8 @@ impl Runner for Bubblewrap { host_home, host_work, } = self.dirs(name); - std::fs::create_dir_all(&host_home.as_host_raw()).todo_context()?; - std::fs::create_dir_all(&host_work.as_host_raw()).todo_context()?; + std::fs::create_dir_all(host_home.as_host_raw()).todo_context()?; + std::fs::create_dir_all(host_work.as_host_raw()).todo_context()?; self.init(name, init) } diff --git a/src/cli.rs b/src/cli.rs index 6365188..d74cc66 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -229,7 +229,7 @@ struct PathWithVarExpansion(PathBuf); impl PathWithVarExpansion { /// Helper for Display. Split out for unit testing. fn sub_home_prefix(&self, home: &Path) -> String { - if let Ok(rest) = self.0.strip_prefix(&home) { + if let Ok(rest) = self.0.strip_prefix(home) { format!("$HOME{}{}", std::path::MAIN_SEPARATOR, rest.display()) } else { format!("{}", self.0.display()) @@ -353,6 +353,7 @@ fn write_completions(shell: Shell, out: &mut W) -> Result<()> { } r#"_cub "$@""# => { counts[4] += 1; + #[allow(clippy::write_literal)] writeln!( out, "{}", diff --git a/src/docker.rs b/src/docker.rs index e768b05..d27242c 100644 --- a/src/docker.rs +++ b/src/docker.rs @@ -320,7 +320,7 @@ impl Docker { } } - command.arg("--workdir").arg(&container_work.as_env_raw()); + command.arg("--workdir").arg(container_work.as_env_raw()); command.arg(self.base_image.encoded()); command.args(["sleep", "90d"]); command.stdout(Stdio::null()); @@ -668,7 +668,7 @@ impl Docker { match run_command { RunnerCommand::Interactive => {} RunnerCommand::Exec { env_vars, .. } => { - for (var, value) in env_vars.iter() { + for (var, value) in *env_vars { command.arg("--env").arg(format!("{}={}", var, value)); } } @@ -980,7 +980,7 @@ fn fallback_path(container_home: &EnvPath) -> OsString { Path::new("/usr/bin"), Path::new("/usr/sbin"), ]; - let joined = match std::env::join_paths(&paths) + let joined = match std::env::join_paths(paths) .with_context(|| format!("unable to add container home dir ({container_home:?}) to $PATH")) { Ok(joined) => joined, diff --git a/src/packages.rs b/src/packages.rs index a710dff..d22d9b9 100644 --- a/src/packages.rs +++ b/src/packages.rs @@ -140,7 +140,7 @@ fn transitive_depends( build_depends, visited: BTreeSet::new(), }; - for p in packages.iter() { + for p in packages { visitor.visit(p, None)?; } Ok(visitor.visited) @@ -561,10 +561,10 @@ impl Cubicle { .with_context(|| format!("error building package {package_name}"))?; let package_cache = &self.shared.package_cache; - std::fs::create_dir_all(&package_cache.as_host_raw()) + std::fs::create_dir_all(package_cache.as_host_raw()) .with_context(|| format!("failed to create directory {package_cache:?}"))?; let package_cache_dir = cap_std::fs::Dir::open_ambient_dir( - &package_cache.as_host_raw(), + package_cache.as_host_raw(), cap_std::ambient_authority(), ) .with_context(|| format!("failed to open directory {package_cache:?}"))?; @@ -605,7 +605,7 @@ impl Cubicle { .rename( testing_tar_name, &package_cache_dir, - &package_tar_name, + package_tar_name, ) .with_context(|| { format!( @@ -1160,7 +1160,7 @@ pub fn write_package_list_tar( } let mut buf = Vec::new(); - for name in packages.iter() { + for name in packages { writeln!(buf, "{}", name.unquoted()).todo_context()?; } header.set_size(buf.len() as u64); diff --git a/src/randname.rs b/src/randname.rs index 23fb573..d447863 100644 --- a/src/randname.rs +++ b/src/randname.rs @@ -73,7 +73,7 @@ impl RandomNameGenerator { fn download_or_open_eff_list(&self) -> Result { let eff_word_list = self.cache_dir.join("eff_short_wordlist_1.txt"); - let file = match std::fs::File::open(&eff_word_list.as_host_raw()) { + let file = match std::fs::File::open(eff_word_list.as_host_raw()) { Ok(file) => file, Err(e) if e.kind() == io::ErrorKind::NotFound => { println!("Downloading EFF short wordlist"); @@ -83,8 +83,8 @@ impl RandomNameGenerator { format!("error downloading word list from {:?}", self.eff_url) })?; std::fs::create_dir_all(self.cache_dir.as_host_raw()).todo_context()?; - std::fs::write(&eff_word_list.as_host_raw(), body).todo_context()?; - std::fs::File::open(&eff_word_list.as_host_raw()).todo_context()? + std::fs::write(eff_word_list.as_host_raw(), body).todo_context()?; + std::fs::File::open(eff_word_list.as_host_raw()).todo_context()? } Err(e) => return Err(e).todo_context(), }; diff --git a/src/user.rs b/src/user.rs index bcca644..72d503c 100644 --- a/src/user.rs +++ b/src/user.rs @@ -337,7 +337,7 @@ impl User { match run_command { RunnerCommand::Interactive => {} RunnerCommand::Exec { env_vars, .. } => { - for (var, value) in env_vars.iter() { + for (var, value) in *env_vars { command.env(var, value).arg(format!("--preserve-env={var}")); } } @@ -474,7 +474,7 @@ impl Runner for User { let username = self.username_from_environment(env_name); self.kill_username(&username)?; - std::fs::create_dir_all(&self.work_tars.as_host_raw()).todo_context()?; + std::fs::create_dir_all(self.work_tars.as_host_raw()).todo_context()?; let work_tar = self.work_tars.join( FilenameEncoder::new() .push(env_name.as_str()) @@ -509,7 +509,7 @@ impl Runner for User { let mut f = std::fs::OpenOptions::new() .create_new(true) .write(true) - .open(&work_tar.as_host_raw()) + .open(work_tar.as_host_raw()) .with_context(|| format!("failed to open {work_tar} for writing"))?; io::copy(&mut stdout, &mut f).context("failed to copy data")?; f.flush().context("failed to flush data")?; From e456a4ca09261148c738024d761102c0b87f07f0 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 15:58:53 -0800 Subject: [PATCH 06/45] tests: Update expected `toml` error messages --- src/config.rs | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/config.rs b/src/config.rs index a79b6d0..c8c8185 100644 --- a/src/config.rs +++ b/src/config.rs @@ -230,6 +230,8 @@ impl Config { #[cfg(test)] mod tests { + use indoc::{formatdoc, indoc}; + use super::*; #[test] @@ -280,15 +282,35 @@ mod tests { #[test] fn config_from_str_bad_runner() { assert_eq!( - "missing field `runner`", + formatdoc! {" + TOML parse error at line 1, column 1 + | + 1 |{trailing} + | ^ + missing field `runner` + ", + // The trailing space is written this way so that code editors + // don't strip it out. + trailing = " ", + }, Config::from_str("") .enough_context() .unwrap_err() - .to_string() + .to_string(), ); + assert_eq!( - "unknown variant `q`, expected one of `Bubblewrap`, `Docker`, `User` for key `runner` at line 1 column 1", - Config::from_str("runner = 'q'").enough_context().unwrap_err().to_string() + indoc! {" + TOML parse error at line 1, column 10 + | + 1 | runner = 'q' + | ^^^ + unknown variant `q`, expected one of `Bubblewrap`, `Docker`, `User` + "}, + Config::from_str("runner = 'q'") + .enough_context() + .unwrap_err() + .to_string(), ); } From 93336ead8a87cdfb8aaf538581256460c9b62031 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 16:05:25 -0800 Subject: [PATCH 07/45] Update snapshots, completion hacks for clap output changes --- src/cli.rs | 2 +- .../cub__cli__tests__usage_completions.snap | 2 +- src/snapshots/cub__cli__tests__usage_cub.snap | 2 +- .../cub__cli__tests__usage_enter.snap | 2 +- .../cub__cli__tests__usage_exec.snap | 2 +- .../cub__cli__tests__usage_list.snap | 2 +- src/snapshots/cub__cli__tests__usage_new.snap | 2 +- .../cub__cli__tests__usage_package list.snap | 2 +- ...cub__cli__tests__usage_package update.snap | 2 +- .../cub__cli__tests__usage_package.snap | 2 +- .../cub__cli__tests__usage_purge.snap | 2 +- .../cub__cli__tests__usage_reset.snap | 2 +- src/snapshots/cub__cli__tests__usage_tmp.snap | 2 +- ...b__cli__tests__write_completions_bash.snap | 126 ++++++++++-------- ...ub__cli__tests__write_completions_zsh.snap | 54 ++++---- 15 files changed, 110 insertions(+), 96 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index d74cc66..aa50d06 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -351,7 +351,7 @@ fn write_completions(shell: Shell, out: &mut W) -> Result<()> { r#"'*--packages=[Comma-separated names of packages to inject into home directory]:PACKAGES:_cub_pkgs_comma' \"# )?; } - r#"_cub "$@""# => { + r#"if [ "$funcstack[1]" = "_cub" ]; then"# => { counts[4] += 1; #[allow(clippy::write_literal)] writeln!( diff --git a/src/snapshots/cub__cli__tests__usage_completions.snap b/src/snapshots/cub__cli__tests__usage_completions.snap index 40ceed5..643f9a7 100644 --- a/src/snapshots/cub__cli__tests__usage_completions.snap +++ b/src/snapshots/cub__cli__tests__usage_completions.snap @@ -26,5 +26,5 @@ Arguments: Options: -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__usage_cub.snap b/src/snapshots/cub__cli__tests__usage_cub.snap index d492b86..4d2e89a 100644 --- a/src/snapshots/cub__cli__tests__usage_cub.snap +++ b/src/snapshots/cub__cli__tests__usage_cub.snap @@ -20,5 +20,5 @@ Commands: Options: -c, --config Path to configuration file [default: $HOME/.config/cubicle.toml] - -h, --help Print help information + -h, --help Print help diff --git a/src/snapshots/cub__cli__tests__usage_enter.snap b/src/snapshots/cub__cli__tests__usage_enter.snap index 9fbeade..27b5a17 100644 --- a/src/snapshots/cub__cli__tests__usage_enter.snap +++ b/src/snapshots/cub__cli__tests__usage_enter.snap @@ -15,5 +15,5 @@ Arguments: Options: -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__usage_exec.snap b/src/snapshots/cub__cli__tests__usage_exec.snap index c01995a..f3531dd 100644 --- a/src/snapshots/cub__cli__tests__usage_exec.snap +++ b/src/snapshots/cub__cli__tests__usage_exec.snap @@ -18,5 +18,5 @@ Arguments: Options: -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__usage_list.snap b/src/snapshots/cub__cli__tests__usage_list.snap index 4389b94..9ad3d14 100644 --- a/src/snapshots/cub__cli__tests__usage_list.snap +++ b/src/snapshots/cub__cli__tests__usage_list.snap @@ -18,5 +18,5 @@ Options: - names: Newline-delimited list of environment names only -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__usage_new.snap b/src/snapshots/cub__cli__tests__usage_new.snap index 22410ef..f5b87b2 100644 --- a/src/snapshots/cub__cli__tests__usage_new.snap +++ b/src/snapshots/cub__cli__tests__usage_new.snap @@ -23,5 +23,5 @@ Options: characters. -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__usage_package list.snap b/src/snapshots/cub__cli__tests__usage_package list.snap index bd820d0..b8e2097 100644 --- a/src/snapshots/cub__cli__tests__usage_package list.snap +++ b/src/snapshots/cub__cli__tests__usage_package list.snap @@ -18,5 +18,5 @@ Options: - names: Newline-delimited list of package names only -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__usage_package update.snap b/src/snapshots/cub__cli__tests__usage_package update.snap index 6963217..a8685b6 100644 --- a/src/snapshots/cub__cli__tests__usage_package update.snap +++ b/src/snapshots/cub__cli__tests__usage_package update.snap @@ -27,5 +27,5 @@ Options: successfully before. -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__usage_package.snap b/src/snapshots/cub__cli__tests__usage_package.snap index 42bcf2a..04deff8 100644 --- a/src/snapshots/cub__cli__tests__usage_package.snap +++ b/src/snapshots/cub__cli__tests__usage_package.snap @@ -12,5 +12,5 @@ Commands: help Print this message or the help of the given subcommand(s) Options: - -h, --help Print help information + -h, --help Print help diff --git a/src/snapshots/cub__cli__tests__usage_purge.snap b/src/snapshots/cub__cli__tests__usage_purge.snap index 34b0e1b..f80fd99 100644 --- a/src/snapshots/cub__cli__tests__usage_purge.snap +++ b/src/snapshots/cub__cli__tests__usage_purge.snap @@ -15,5 +15,5 @@ Arguments: Options: -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__usage_reset.snap b/src/snapshots/cub__cli__tests__usage_reset.snap index cb20303..7c6b05f 100644 --- a/src/snapshots/cub__cli__tests__usage_reset.snap +++ b/src/snapshots/cub__cli__tests__usage_reset.snap @@ -24,5 +24,5 @@ Options: characters. -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__usage_tmp.snap b/src/snapshots/cub__cli__tests__usage_tmp.snap index d69fc87..2a59f3a 100644 --- a/src/snapshots/cub__cli__tests__usage_tmp.snap +++ b/src/snapshots/cub__cli__tests__usage_tmp.snap @@ -16,5 +16,5 @@ Options: characters. -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') diff --git a/src/snapshots/cub__cli__tests__write_completions_bash.snap b/src/snapshots/cub__cli__tests__write_completions_bash.snap index bf3b32e..ba710b0 100644 --- a/src/snapshots/cub__cli__tests__write_completions_bash.snap +++ b/src/snapshots/cub__cli__tests__write_completions_bash.snap @@ -3,7 +3,7 @@ source: src/cli.rs expression: buf --- _cub() { - local i cur prev opts cmds + local i cur prev opts cmd COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" @@ -16,89 +16,89 @@ _cub() { ",$1") cmd="cub" ;; - cubicle,completions) - cmd="cubicle__completions" + cub,completions) + cmd="cub__completions" ;; - cubicle,enter) - cmd="cubicle__enter" + cub,enter) + cmd="cub__enter" ;; - cubicle,exec) - cmd="cubicle__exec" + cub,exec) + cmd="cub__exec" ;; - cubicle,help) - cmd="cubicle__help" + cub,help) + cmd="cub__help" ;; - cubicle,list) - cmd="cubicle__list" + cub,list) + cmd="cub__list" ;; - cubicle,new) - cmd="cubicle__new" + cub,new) + cmd="cub__new" ;; - cubicle,package) - cmd="cubicle__package" + cub,package) + cmd="cub__package" ;; - cubicle,purge) - cmd="cubicle__purge" + cub,purge) + cmd="cub__purge" ;; - cubicle,reset) - cmd="cubicle__reset" + cub,reset) + cmd="cub__reset" ;; - cubicle,tmp) - cmd="cubicle__tmp" + cub,tmp) + cmd="cub__tmp" ;; - cubicle__help,completions) - cmd="cubicle__help__completions" + cub__help,completions) + cmd="cub__help__completions" ;; - cubicle__help,enter) - cmd="cubicle__help__enter" + cub__help,enter) + cmd="cub__help__enter" ;; - cubicle__help,exec) - cmd="cubicle__help__exec" + cub__help,exec) + cmd="cub__help__exec" ;; - cubicle__help,help) - cmd="cubicle__help__help" + cub__help,help) + cmd="cub__help__help" ;; - cubicle__help,list) - cmd="cubicle__help__list" + cub__help,list) + cmd="cub__help__list" ;; - cubicle__help,new) - cmd="cubicle__help__new" + cub__help,new) + cmd="cub__help__new" ;; - cubicle__help,package) - cmd="cubicle__help__package" + cub__help,package) + cmd="cub__help__package" ;; - cubicle__help,purge) - cmd="cubicle__help__purge" + cub__help,purge) + cmd="cub__help__purge" ;; - cubicle__help,reset) - cmd="cubicle__help__reset" + cub__help,reset) + cmd="cub__help__reset" ;; - cubicle__help,tmp) - cmd="cubicle__help__tmp" + cub__help,tmp) + cmd="cub__help__tmp" ;; - cubicle__help__package,list) - cmd="cubicle__help__package__list" + cub__help__package,list) + cmd="cub__help__package__list" ;; - cubicle__help__package,update) - cmd="cubicle__help__package__update" + cub__help__package,update) + cmd="cub__help__package__update" ;; - cubicle__package,help) - cmd="cubicle__package__help" + cub__package,help) + cmd="cub__package__help" ;; - cubicle__package,list) - cmd="cubicle__package__list" + cub__package,list) + cmd="cub__package__list" ;; - cubicle__package,update) - cmd="cubicle__package__update" + cub__package,update) + cmd="cub__package__update" ;; - cubicle__package__help,help) - cmd="cubicle__package__help__help" + cub__package__help,help) + cmd="cub__package__help__help" ;; - cubicle__package__help,list) - cmd="cubicle__package__help__list" + cub__package__help,list) + cmd="cub__package__help__list" ;; - cubicle__package__help,update) - cmd="cubicle__package__help__update" + cub__package__help,update) + cmd="cub__package__help__update" ;; *) ;; @@ -115,10 +115,16 @@ _cub() { case "${prev}" in --config) COMPREPLY=($(compgen -f "${cur}")) + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; -c) COMPREPLY=($(compgen -f "${cur}")) + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; *) @@ -543,5 +549,9 @@ _cub() { esac } -complete -F _cub -o bashdefault -o default cub +if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then + complete -F _cub -o nosort -o bashdefault -o default cub +else + complete -F _cub -o bashdefault -o default cub +fi diff --git a/src/snapshots/cub__cli__tests__write_completions_zsh.snap b/src/snapshots/cub__cli__tests__write_completions_zsh.snap index 42170da..5788208 100644 --- a/src/snapshots/cub__cli__tests__write_completions_zsh.snap +++ b/src/snapshots/cub__cli__tests__write_completions_zsh.snap @@ -21,8 +21,8 @@ _cub() { _arguments "${_arguments_options[@]}" \ '-c+[Path to configuration file]:CONFIG:_files' \ '--config=[Path to configuration file]:CONFIG:_files' \ -'-h[Print help information]' \ -'--help[Print help information]' \ +'-h[Print help]' \ +'--help[Print help]' \ ":: :_cub_commands" \ "*::: :->cubicle" \ && ret=0 @@ -34,22 +34,22 @@ _cub() { case $line[1] in (completions) _arguments "${_arguments_options[@]}" \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ ':shell:(bash elvish fish powershell zsh)' \ && ret=0 ;; (enter) _arguments "${_arguments_options[@]}" \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ ':name -- Environment name:_cub_envs' \ && ret=0 ;; (exec) _arguments "${_arguments_options[@]}" \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ ':name -- Environment name:_cub_envs' \ '*::command -- Command and arguments to run:' \ && ret=0 @@ -59,14 +59,14 @@ _arguments "${_arguments_options[@]}" \ '--format=[Set output format]:FORMAT:((default\:"Human-formatted table" json\:"Detailed JSON output for machine consumption" names\:"Newline-delimited list of environment names only"))' \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ && ret=0 ;; (package) _arguments "${_arguments_options[@]}" \ -'-h[Print help information]' \ -'--help[Print help information]' \ +'-h[Print help]' \ +'--help[Print help]' \ ":: :_cub__package_commands" \ "*::: :->package" \ && ret=0 @@ -82,16 +82,16 @@ _arguments "${_arguments_options[@]}" \ '--format=[Set output format]:FORMAT:((default\:"Human-formatted table" json\:"Detailed JSON output for machine consumption" names\:"Newline-delimited list of package names only"))' \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ && ret=0 ;; (update) _arguments "${_arguments_options[@]}" \ '--clean[Clear out existing build environment first]' \ '--skip-deps[Build dependencies only if required]' \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ '*::packages -- Package name(s):_cub_pkgs' \ && ret=0 ;; @@ -131,31 +131,31 @@ esac _arguments "${_arguments_options[@]}" \ '*--packages=[Comma-separated names of packages to inject into home directory]:PACKAGES:_cub_pkgs_comma' \ '--enter[Run a shell in new environment]' \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ ':name -- New environment name:' \ && ret=0 ;; (purge) _arguments "${_arguments_options[@]}" \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ '*::names -- Environment name(s):_cub_envs' \ && ret=0 ;; (reset) _arguments "${_arguments_options[@]}" \ '*--packages=[Comma-separated names of packages to inject into home directory]:PACKAGES:_cub_pkgs_comma' \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ '*::names -- Environment name(s):_cub_envs' \ && ret=0 ;; (tmp) _arguments "${_arguments_options[@]}" \ '*--packages=[Comma-separated names of packages to inject into home directory]:PACKAGES:_cub_pkgs_comma' \ -'-h[Print help information (use `--help` for more detail)]' \ -'--help[Print help information (use `--help` for more detail)]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ && ret=0 ;; (help) @@ -429,5 +429,9 @@ _cub_pkgs_comma() { _values -s , -w 'packages' $(cub package list --format=names) } -_cub "$@" +if [ "$funcstack[1]" = "_cub" ]; then + _cub "$@" +else + compdef _cub cub +fi From 0c08962ab9c7c88e8cc7af0906efdb6a039587ed Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 16:27:51 -0800 Subject: [PATCH 08/45] docker: Fix volume not found message pattern --- src/docker.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/docker.rs b/src/docker.rs index d27242c..d69a181 100644 --- a/src/docker.rs +++ b/src/docker.rs @@ -442,7 +442,23 @@ impl Docker { let status = output.status; if !status.success() { let stderr = String::from_utf8_lossy(&output.stderr).trim().to_owned(); - if status.code() == Some(1) && stderr.starts_with("Error: No such volume") { + // Errors for missing volume on Debian 12 with docker.io + // 20.10.24+dfsg1 are like: + // + // ``` + // [blank line] + // Error: No such volume: [name] + // ``` + // + // However, on ubuntu-20.04 and macos-12 in CI, they're like: + // + // ``` + // Error response from daemon: get NAME: no such volume + // ``` + if status.code() == Some(1) + && (stderr.starts_with("Error: No such volume") + || stderr.ends_with(": no such volume")) + { return Ok(None); } return Err(anyhow!( From f98df5939f45296a66fa6dac95db1fe3be98ae96 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 16:33:30 -0800 Subject: [PATCH 09/45] Update CI runners ubuntu 20.04 -> 22.04 mac os 12 -> 13 --- .github/workflows/main.yaml | 86 ++++++++++++++++++------------------- src/bin/gen_github_yaml.rs | 8 ++-- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 39f31c7..9a0fa4f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,9 +11,9 @@ on: - cron: 0 16 * * * workflow_dispatch: {} jobs: - build-macos-12-stable: - name: Build & check (macos-12, Rust stable) - runs-on: macos-12 + build-macos-13-stable: + name: Build & check (macos-13, Rust stable) + runs-on: macos-13 steps: - name: Check out sources uses: actions/checkout@v2 @@ -27,12 +27,12 @@ jobs: - name: Use Rust/Cargo cache uses: actions/cache@v3 with: - key: cargo-macos-12-stable-${{ hashFiles('Cargo.lock') }} + key: cargo-macos-13-stable-${{ hashFiles('Cargo.lock') }} path: | ~/.cargo/registry ~/.cargo/git/ target/ - restore-keys: cargo-macos-12-stable- + restore-keys: cargo-macos-13-stable- - name: Run cargo build uses: actions-rs/cargo@v1 with: @@ -55,11 +55,11 @@ jobs: uses: actions/upload-artifact@v3 with: if-no-files-found: error - name: debug-dist-macos-12-stable + name: debug-dist-macos-13-stable path: debug-dist.tar.gz - build-ubuntu-20-04-nightly: - name: Build & check (ubuntu-20.04, Rust nightly) - runs-on: ubuntu-20.04 + build-ubuntu-22-04-nightly: + name: Build & check (ubuntu-22.04, Rust nightly) + runs-on: ubuntu-22.04 steps: - name: Check out sources uses: actions/checkout@v2 @@ -73,12 +73,12 @@ jobs: - name: Use Rust/Cargo cache uses: actions/cache@v3 with: - key: cargo-ubuntu-20.04-nightly-${{ hashFiles('Cargo.lock') }} + key: cargo-ubuntu-22.04-nightly-${{ hashFiles('Cargo.lock') }} path: | ~/.cargo/registry ~/.cargo/git/ target/ - restore-keys: cargo-ubuntu-20.04-nightly- + restore-keys: cargo-ubuntu-22.04-nightly- - name: Run cargo build uses: actions-rs/cargo@v1 with: @@ -101,11 +101,11 @@ jobs: uses: actions/upload-artifact@v3 with: if-no-files-found: error - name: debug-dist-ubuntu-20.04-nightly + name: debug-dist-ubuntu-22.04-nightly path: debug-dist.tar.gz - build-ubuntu-20-04-stable: - name: Build & check (ubuntu-20.04, Rust stable) - runs-on: ubuntu-20.04 + build-ubuntu-22-04-stable: + name: Build & check (ubuntu-22.04, Rust stable) + runs-on: ubuntu-22.04 steps: - name: Check out sources uses: actions/checkout@v2 @@ -119,12 +119,12 @@ jobs: - name: Use Rust/Cargo cache uses: actions/cache@v3 with: - key: cargo-ubuntu-20.04-stable-${{ hashFiles('Cargo.lock') }} + key: cargo-ubuntu-22.04-stable-${{ hashFiles('Cargo.lock') }} path: | ~/.cargo/registry ~/.cargo/git/ target/ - restore-keys: cargo-ubuntu-20.04-stable- + restore-keys: cargo-ubuntu-22.04-stable- - name: Run cargo build uses: actions-rs/cargo@v1 with: @@ -170,13 +170,13 @@ jobs: uses: actions/upload-artifact@v3 with: if-no-files-found: error - name: debug-dist-ubuntu-20.04-stable + name: debug-dist-ubuntu-22.04-stable path: debug-dist.tar.gz - system_test-macos-12-docker: - name: System tests (macos-12, docker) + system_test-macos-13-docker: + name: System tests (macos-13, docker) needs: - - build-macos-12-stable - runs-on: macos-12 + - build-macos-13-stable + runs-on: macos-13 steps: - name: Install Docker run: brew install docker docker-machine @@ -194,7 +194,7 @@ jobs: - name: Download build artifact uses: actions/download-artifact@v3 with: - name: debug-dist-macos-12-stable + name: debug-dist-macos-13-stable - name: Unpack build artifact run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - name: Run cub list @@ -206,18 +206,18 @@ jobs: env: INSTA_WORKSPACE_ROOT: . RUST_BACKTRACE: '1' - system_test-ubuntu-20-04-bubblewrap: - name: System tests (ubuntu-20.04, bubblewrap) + system_test-ubuntu-22-04-bubblewrap: + name: System tests (ubuntu-22.04, bubblewrap) needs: - - build-ubuntu-20-04-stable - runs-on: ubuntu-20.04 + - build-ubuntu-22-04-stable + runs-on: ubuntu-22.04 steps: - name: Install Bubblewrap and minor dependencies run: sudo apt-get install -y bubblewrap pv - name: Download build artifact uses: actions/download-artifact@v3 with: - name: debug-dist-ubuntu-20.04-stable + name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - name: Run cub list @@ -229,18 +229,18 @@ jobs: env: INSTA_WORKSPACE_ROOT: . RUST_BACKTRACE: '1' - system_test-ubuntu-20-04-docker: - name: System tests (ubuntu-20.04, docker) + system_test-ubuntu-22-04-docker: + name: System tests (ubuntu-22.04, docker) needs: - - build-ubuntu-20-04-stable - runs-on: ubuntu-20.04 + - build-ubuntu-22-04-stable + runs-on: ubuntu-22.04 steps: - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact uses: actions/download-artifact@v3 with: - name: debug-dist-ubuntu-20.04-stable + name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - name: Run cub list @@ -252,18 +252,18 @@ jobs: env: INSTA_WORKSPACE_ROOT: . RUST_BACKTRACE: '1' - system_test-ubuntu-20-04-docker-bind: - name: System tests (ubuntu-20.04, docker-bind) + system_test-ubuntu-22-04-docker-bind: + name: System tests (ubuntu-22.04, docker-bind) needs: - - build-ubuntu-20-04-stable - runs-on: ubuntu-20.04 + - build-ubuntu-22-04-stable + runs-on: ubuntu-22.04 steps: - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact uses: actions/download-artifact@v3 with: - name: debug-dist-ubuntu-20.04-stable + name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - name: Run cub list @@ -275,18 +275,18 @@ jobs: env: INSTA_WORKSPACE_ROOT: . RUST_BACKTRACE: '1' - system_test-ubuntu-20-04-user: - name: System tests (ubuntu-20.04, user) + system_test-ubuntu-22-04-user: + name: System tests (ubuntu-22.04, user) needs: - - build-ubuntu-20-04-stable - runs-on: ubuntu-20.04 + - build-ubuntu-22-04-stable + runs-on: ubuntu-22.04 steps: - name: Install minor dependencies run: sudo apt-get install -y pv - name: Download build artifact uses: actions/download-artifact@v3 with: - name: debug-dist-ubuntu-20.04-stable + name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - name: Run cub list diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index ad2c55c..040b353 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -194,15 +194,15 @@ enum Os { impl Os { fn as_str(&self) -> &'static str { match self { - Self::Ubuntu => "ubuntu-20.04", - Self::Mac => "macos-12", + Self::Ubuntu => "ubuntu-22.04", + Self::Mac => "macos-13", } } fn as_ident(&self) -> &'static str { match self { - Self::Ubuntu => "ubuntu-20-04", - Self::Mac => "macos-12", + Self::Ubuntu => "ubuntu-22-04", + Self::Mac => "macos-13", } } } From 82656d309f8c5606a5a035015ff54e048965dfad Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 18:00:47 -0800 Subject: [PATCH 10/45] CI: Try installing Virtualbox on macos-13 --- .github/workflows/main.yaml | 2 ++ src/bin/gen_github_yaml.rs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9a0fa4f..13ac05f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -178,6 +178,8 @@ jobs: - build-macos-13-stable runs-on: macos-13 steps: + - name: Install Virtualbox + run: brew install --cask virtualbox - name: Install Docker run: brew install docker docker-machine - name: Create VirtualBox VM for Docker diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 040b353..82d7939 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -618,6 +618,14 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) // see . fn docker_mac_install_steps() -> Vec { vec![ + // Virtualbox was included in the MacOS 12 runners but not in MacOS 13. + Step { + name: s("Install Virtualbox"), + details: Run { + run: s("brew install --cask virtualbox"), + }, + env: dict! {}, + }, Step { name: s("Install Docker"), details: Run { From 9c85c613476beb3dc23fe6ab15aa6bf45a207a3a Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 18:10:59 -0800 Subject: [PATCH 11/45] Revert "CI: Try installing Virtualbox on macos-13" This reverts commit 82656d309f8c5606a5a035015ff54e048965dfad. It didn't work on the macos-13 runner: ``` docker-machine create \ --driver virtualbox \ --virtualbox-boot2docker-url 'https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso' \ --virtualbox-hostonly-cidr '192.168.56.1/24' \ default && \ eval "$(docker-machine env default)" && \ env | grep DOCKER >> $GITHUB_ENV shell: /bin/bash -e {0} Creating CA: /Users/runner/.docker/machine/certs/ca.pem Creating client certificate: /Users/runner/.docker/machine/certs/cert.pem Running pre-create checks... (default) Image cache directory does not exist, creating it at /Users/runner/.docker/machine/cache... Creating machine... (default) Downloading /Users/runner/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso... (default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100% (default) Creating VirtualBox VM... (default) Creating SSH key... (default) Starting the VM... (default) Check network to re-create if needed... (default) Creating a new host-only adapter produced an error: /usr/local/bin/VBoxManage hostonlyif create failed: (default) 0%...NS_ERROR_FAILURE (default) VBoxManage: error: Failed to create the host-only adapter (default) VBoxManage: error: Failed to execute '/Applications/VirtualBox.app/Contents/MacOS/VBoxNetAdpCtl add 2>&1' - exit status: 34304 (default) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface (default) VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 105 of file VBoxManageHostonly.cpp (default) (default) This is a known VirtualBox bug. Let's try to recover anyway... Error creating machine: Error in driver during machine creation: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue Error: Process completed with exit code 1. ``` --- .github/workflows/main.yaml | 2 -- src/bin/gen_github_yaml.rs | 8 -------- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 13ac05f..9a0fa4f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -178,8 +178,6 @@ jobs: - build-macos-13-stable runs-on: macos-13 steps: - - name: Install Virtualbox - run: brew install --cask virtualbox - name: Install Docker run: brew install docker docker-machine - name: Create VirtualBox VM for Docker diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 82d7939..040b353 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -618,14 +618,6 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) // see . fn docker_mac_install_steps() -> Vec { vec![ - // Virtualbox was included in the MacOS 12 runners but not in MacOS 13. - Step { - name: s("Install Virtualbox"), - details: Run { - run: s("brew install --cask virtualbox"), - }, - env: dict! {}, - }, Step { name: s("Install Docker"), details: Run { From d7df3798774072ba3895c60d26ae201a7120a7e2 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 18:24:01 -0800 Subject: [PATCH 12/45] CI: Try colima for Docker on Mac --- .github/workflows/main.yaml | 13 ++++--------- src/bin/gen_github_yaml.rs | 38 +++++-------------------------------- 2 files changed, 9 insertions(+), 42 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9a0fa4f..7ac3176 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -179,16 +179,11 @@ jobs: runs-on: macos-13 steps: - name: Install Docker - run: brew install docker docker-machine - - name: Create VirtualBox VM for Docker + run: brew install docker + - name: Install Colima run: | - docker-machine create \ - --driver virtualbox \ - --virtualbox-boot2docker-url 'https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso' \ - --virtualbox-hostonly-cidr '192.168.56.1/24' \ - default && \ - eval "$(docker-machine env default)" && \ - env | grep DOCKER >> $GITHUB_ENV + brew install colima + colima start - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 040b353..643064d 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -621,45 +621,17 @@ fn docker_mac_install_steps() -> Vec { Step { name: s("Install Docker"), details: Run { - run: s("brew install docker docker-machine"), + run: s("brew install docker"), }, env: dict! {}, }, + // Colima isn't installed in the Mac OS 13 runners. Step { - name: s("Create VirtualBox VM for Docker"), - // Normally docker-machine would check for the latest boot2docker - // URL, but it gives the error: `Error with pre-create check: - // "failure getting a version tag from the Github API response (are - // you getting rate limited by Github?)"`. Its README says to pass - // `--github-api-token`, but that doesn't work due to - // and - // . This just sets - // a static URL. Because boot2docker is no longer maintained, - // there's no risk of a newer ISO being released. - - // Then, set a different IPv4 range to work around this error: - // - // ``` - // Error creating machine: Error in driver during machine creation: - // Error setting up host only network on machine start: - // /usr/local/bin/VBoxManage hostonlyif ipconfig vboxnet0 --ip - // 192.168.99.1 --netmask 255.255.255.0 failed: - // VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied - // (extended info not available) - // VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), - // Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp - // ``` - // - // See . + name: s("Install Colima"), details: Run { run: s(indoc! {r#" - docker-machine create \ - --driver virtualbox \ - --virtualbox-boot2docker-url 'https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso' \ - --virtualbox-hostonly-cidr '192.168.56.1/24' \ - default && \ - eval "$(docker-machine env default)" && \ - env | grep DOCKER >> $GITHUB_ENV + brew install colima + colima start "#}), }, env: dict! {}, From c90c58520ac521c3424a10481595a64e5f84534a Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 18:43:45 -0800 Subject: [PATCH 13/45] CI: Try setting colima VM type --- .github/workflows/main.yaml | 6 +++--- src/bin/gen_github_yaml.rs | 15 +++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7ac3176..38ec125 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -181,9 +181,9 @@ jobs: - name: Install Docker run: brew install docker - name: Install Colima - run: | - brew install colima - colima start + run: brew install colima + - name: Start Colima + run: colima start -vm-type vz - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 643064d..a329c41 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -629,10 +629,17 @@ fn docker_mac_install_steps() -> Vec { Step { name: s("Install Colima"), details: Run { - run: s(indoc! {r#" - brew install colima - colima start - "#}), + run: s("brew install colima"), + }, + env: dict! {}, + }, + Step { + name: s("Start Colima"), + details: Run { + // The Lima docs say that the VZ backend is faster. It's only + // available starting in Mac OS 13. See + // . + run: s("colima start -vm-type vz"), }, env: dict! {}, }, From 51949fa71a0e1831bb6a107bf8c1cf761ce6d6cf Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 18:48:42 -0800 Subject: [PATCH 14/45] CI: Add missing dash --- .github/workflows/main.yaml | 2 +- src/bin/gen_github_yaml.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 38ec125..32e7d61 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -183,7 +183,7 @@ jobs: - name: Install Colima run: brew install colima - name: Start Colima - run: colima start -vm-type vz + run: colima start --vm-type vz - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index a329c41..3656aa7 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -639,7 +639,7 @@ fn docker_mac_install_steps() -> Vec { // The Lima docs say that the VZ backend is faster. It's only // available starting in Mac OS 13. See // . - run: s("colima start -vm-type vz"), + run: s("colima start --vm-type vz"), }, env: dict! {}, }, From 6a1a75f185e5ae562b1cd9f11c345e7f4a4e0a4b Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 18:52:27 -0800 Subject: [PATCH 15/45] CI: Print homebrew directory sizes (maybe we should cache one?) --- .github/workflows/main.yaml | 10 ++++++++++ src/bin/gen_github_yaml.rs | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 32e7d61..b9b40ca 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -178,10 +178,20 @@ jobs: - build-macos-13-stable runs-on: macos-13 steps: + - name: Print homebrew info + run: | + set -x + du -sh /Users/runner/Library/Caches/Homebrew/ + du -sh /Users/runner/Library/Caches/Homebrew/downloads/ - name: Install Docker run: brew install docker - name: Install Colima run: brew install colima + - name: Print homebrew info + run: | + set -x + du -sh /Users/runner/Library/Caches/Homebrew/ + du -sh /Users/runner/Library/Caches/Homebrew/downloads/ - name: Start Colima run: colima start --vm-type vz - name: Docker hello world diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 3656aa7..c33ce32 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -617,7 +617,19 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) // Docker isn't installed on the Mac runners due to licensing issues: // see . fn docker_mac_install_steps() -> Vec { + let print_homebrew_info = || Step { + name: s("Print homebrew info"), + details: Run { + run: s(indoc! {" + set -x + du -sh /Users/runner/Library/Caches/Homebrew/ + du -sh /Users/runner/Library/Caches/Homebrew/downloads/ + "}), + }, + env: dict! {}, + }; vec![ + print_homebrew_info(), Step { name: s("Install Docker"), details: Run { @@ -633,6 +645,7 @@ fn docker_mac_install_steps() -> Vec { }, env: dict! {}, }, + print_homebrew_info(), Step { name: s("Start Colima"), details: Run { From 9b69ab9fe9158bfa79d5adc38852cdecd34c4c89 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 18:54:43 -0800 Subject: [PATCH 16/45] CI: Don't fail if dirs don't exist --- .github/workflows/main.yaml | 8 ++++---- src/bin/gen_github_yaml.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b9b40ca..fff9ae3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -181,8 +181,8 @@ jobs: - name: Print homebrew info run: | set -x - du -sh /Users/runner/Library/Caches/Homebrew/ - du -sh /Users/runner/Library/Caches/Homebrew/downloads/ + du -sh /Users/runner/Library/Caches/Homebrew/ || true + du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true - name: Install Docker run: brew install docker - name: Install Colima @@ -190,8 +190,8 @@ jobs: - name: Print homebrew info run: | set -x - du -sh /Users/runner/Library/Caches/Homebrew/ - du -sh /Users/runner/Library/Caches/Homebrew/downloads/ + du -sh /Users/runner/Library/Caches/Homebrew/ || true + du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true - name: Start Colima run: colima start --vm-type vz - name: Docker hello world diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index c33ce32..31cec9e 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -622,8 +622,8 @@ fn docker_mac_install_steps() -> Vec { details: Run { run: s(indoc! {" set -x - du -sh /Users/runner/Library/Caches/Homebrew/ - du -sh /Users/runner/Library/Caches/Homebrew/downloads/ + du -sh /Users/runner/Library/Caches/Homebrew/ || true + du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true "}), }, env: dict! {}, From 9de894525ad241a19fad260b1b613a96419cc231 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 19:08:32 -0800 Subject: [PATCH 17/45] colima: Set disk size --- .github/workflows/main.yaml | 2 +- src/bin/gen_github_yaml.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fff9ae3..63035f7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -193,7 +193,7 @@ jobs: du -sh /Users/runner/Library/Caches/Homebrew/ || true du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true - name: Start Colima - run: colima start --vm-type vz + run: colima start --disk 6 --vm-type vz - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 31cec9e..3600d7d 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -652,7 +652,11 @@ fn docker_mac_install_steps() -> Vec { // The Lima docs say that the VZ backend is faster. It's only // available starting in Mac OS 13. See // . - run: s("colima start --vm-type vz"), + // + // The default disk size is 60 GiB, and the VZ backend appears + // to unpack and "expand" the QCOW2 image. The runner only has + // 14 GB, so set the disk size smaller. + run: s("colima start --disk 6 --vm-type vz"), }, env: dict! {}, }, From 0e5dc71a8dcf6a48b730210ca3bafdc088dc4eb4 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 19:18:57 -0800 Subject: [PATCH 18/45] CI: Add homebrew cache --- .github/workflows/main.yaml | 15 +++++++++++++++ src/bin/gen_github_yaml.rs | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 63035f7..e0807aa 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -178,6 +178,16 @@ jobs: - build-macos-13-stable runs-on: macos-13 steps: + - name: Print homebrew info + run: | + set -x + du -sh /Users/runner/Library/Caches/Homebrew/ || true + du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true + - name: Restore Homebrew cache + uses: actions/cache/restore@v3 + with: + key: homebrew-macos-13 + path: ~/Library/Caches/Homebrew/ - name: Print homebrew info run: | set -x @@ -192,6 +202,11 @@ jobs: set -x du -sh /Users/runner/Library/Caches/Homebrew/ || true du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true + - name: Save Homebrew cache + uses: actions/cache/save@v3 + with: + key: homebrew-macos-13 + path: ~/Library/Caches/Homebrew/ - name: Start Colima run: colima start --disk 6 --vm-type vz - name: Docker hello world diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 3600d7d..a4a2330 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -223,6 +223,8 @@ impl Display for Os { enum Action { Checkout, Cache, + CacheRestore, + CacheSave, Cargo, DownloadArtifact, RustToolchain, @@ -235,6 +237,8 @@ impl Action { match self { Checkout => "actions/checkout@v2", Cache => "actions/cache@v3", + CacheRestore => "actions/cache/restore@v3", + CacheSave => "actions/cache/save@v3", Cargo => "actions-rs/cargo@v1", DownloadArtifact => "actions/download-artifact@v3", RustToolchain => "actions-rs/toolchain@v1", @@ -540,7 +544,7 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) Runner::Docker | Runner::DockerBind => { if os == Os::Mac { - steps.extend(docker_mac_install_steps()); + steps.extend(docker_mac_install_steps(os)); } steps.push(Step { @@ -616,7 +620,7 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) // Docker isn't installed on the Mac runners due to licensing issues: // see . -fn docker_mac_install_steps() -> Vec { +fn docker_mac_install_steps(os: Os) -> Vec { let print_homebrew_info = || Step { name: s("Print homebrew info"), details: Run { @@ -628,7 +632,21 @@ fn docker_mac_install_steps() -> Vec { }, env: dict! {}, }; + let homebrew_cache_path = "~/Library/Caches/Homebrew/"; + let homebrew_cache_key = format!("homebrew-{os}"); vec![ + print_homebrew_info(), + Step { + name: s("Restore Homebrew cache"), + details: Uses { + uses: Action::CacheRestore, + with: dict! { + "path" => homebrew_cache_path, + "key" => homebrew_cache_key, + }, + }, + env: dict! {}, + }, print_homebrew_info(), Step { name: s("Install Docker"), @@ -646,6 +664,18 @@ fn docker_mac_install_steps() -> Vec { env: dict! {}, }, print_homebrew_info(), + // Save the cache early in case a later step fails. + Step { + name: s("Save Homebrew cache"), + details: Uses { + uses: Action::CacheSave, + with: dict! { + "path" => homebrew_cache_path, + "key" => homebrew_cache_key, + }, + }, + env: dict! {}, + }, Step { name: s("Start Colima"), details: Run { From af7cc53529626ae3a31e949eb991bc119c9c16bf Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 19:29:31 -0800 Subject: [PATCH 19/45] CI: Drop colima disk size --- .github/workflows/main.yaml | 2 +- src/bin/gen_github_yaml.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e0807aa..b44019c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -208,7 +208,7 @@ jobs: key: homebrew-macos-13 path: ~/Library/Caches/Homebrew/ - name: Start Colima - run: colima start --disk 6 --vm-type vz + run: colima start --disk 4 --vm-type vz - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index a4a2330..23ec93c 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -685,8 +685,11 @@ fn docker_mac_install_steps(os: Os) -> Vec { // // The default disk size is 60 GiB, and the VZ backend appears // to unpack and "expand" the QCOW2 image. The runner only has - // 14 GB, so set the disk size smaller. - run: s("colima start --disk 6 --vm-type vz"), + // 14 GB and is slow to write to disk, so set the disk size + // smaller. The QCOW2 image expands to a 3.5 GiB raw disk, and + // the `--disk` flag takes an int, so the smallest reasonable + // size is probably 4. + run: s("colima start --disk 4 --vm-type vz"), }, env: dict! {}, }, From edb0afa146d34bda3a37fd145ec540405faac818 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 19:33:18 -0800 Subject: [PATCH 20/45] CI: Drop homebrew cache dir sizes --- .github/workflows/main.yaml | 15 --------------- src/bin/gen_github_yaml.rs | 14 -------------- 2 files changed, 29 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b44019c..742f1f0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -178,30 +178,15 @@ jobs: - build-macos-13-stable runs-on: macos-13 steps: - - name: Print homebrew info - run: | - set -x - du -sh /Users/runner/Library/Caches/Homebrew/ || true - du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true - name: Restore Homebrew cache uses: actions/cache/restore@v3 with: key: homebrew-macos-13 path: ~/Library/Caches/Homebrew/ - - name: Print homebrew info - run: | - set -x - du -sh /Users/runner/Library/Caches/Homebrew/ || true - du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true - name: Install Docker run: brew install docker - name: Install Colima run: brew install colima - - name: Print homebrew info - run: | - set -x - du -sh /Users/runner/Library/Caches/Homebrew/ || true - du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true - name: Save Homebrew cache uses: actions/cache/save@v3 with: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 23ec93c..a899882 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -621,21 +621,9 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) // Docker isn't installed on the Mac runners due to licensing issues: // see . fn docker_mac_install_steps(os: Os) -> Vec { - let print_homebrew_info = || Step { - name: s("Print homebrew info"), - details: Run { - run: s(indoc! {" - set -x - du -sh /Users/runner/Library/Caches/Homebrew/ || true - du -sh /Users/runner/Library/Caches/Homebrew/downloads/ || true - "}), - }, - env: dict! {}, - }; let homebrew_cache_path = "~/Library/Caches/Homebrew/"; let homebrew_cache_key = format!("homebrew-{os}"); vec![ - print_homebrew_info(), Step { name: s("Restore Homebrew cache"), details: Uses { @@ -647,7 +635,6 @@ fn docker_mac_install_steps(os: Os) -> Vec { }, env: dict! {}, }, - print_homebrew_info(), Step { name: s("Install Docker"), details: Run { @@ -663,7 +650,6 @@ fn docker_mac_install_steps(os: Os) -> Vec { }, env: dict! {}, }, - print_homebrew_info(), // Save the cache early in case a later step fails. Step { name: s("Save Homebrew cache"), From 30038b5fccd173adaa59dfdb5f55ed9549bd24a6 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 19:36:06 -0800 Subject: [PATCH 21/45] CI: Set colima mount type --- .github/workflows/main.yaml | 2 +- src/bin/gen_github_yaml.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 742f1f0..cc24082 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -193,7 +193,7 @@ jobs: key: homebrew-macos-13 path: ~/Library/Caches/Homebrew/ - name: Start Colima - run: colima start --disk 4 --vm-type vz + run: colima start --disk 4 --mount-type virtiofs --vm-type vz - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index a899882..903f2ae 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -665,9 +665,9 @@ fn docker_mac_install_steps(os: Os) -> Vec { Step { name: s("Start Colima"), details: Run { - // The Lima docs say that the VZ backend is faster. It's only - // available starting in Mac OS 13. See - // . + // The Lima docs say that the VZ backend is faster and the + // example uses virtiofs. VZ is only available starting in Mac + // OS 13. See . // // The default disk size is 60 GiB, and the VZ backend appears // to unpack and "expand" the QCOW2 image. The runner only has @@ -675,7 +675,7 @@ fn docker_mac_install_steps(os: Os) -> Vec { // smaller. The QCOW2 image expands to a 3.5 GiB raw disk, and // the `--disk` flag takes an int, so the smallest reasonable // size is probably 4. - run: s("colima start --disk 4 --vm-type vz"), + run: s("colima start --disk 4 --mount-type virtiofs --vm-type vz"), }, env: dict! {}, }, From cc027b3e9db6f399afa801e0498c8518126ba870 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 19:47:28 -0800 Subject: [PATCH 22/45] CI: Try unlinking openssl1.1 to install colima (why only now?) --- .github/workflows/main.yaml | 4 +++- src/bin/gen_github_yaml.rs | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cc24082..44cf360 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -186,7 +186,9 @@ jobs: - name: Install Docker run: brew install docker - name: Install Colima - run: brew install colima + run: | + brew unlink openssl@1.1 || true + brew install colima - name: Save Homebrew cache uses: actions/cache/save@v3 with: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 903f2ae..7297577 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -646,7 +646,11 @@ fn docker_mac_install_steps(os: Os) -> Vec { Step { name: s("Install Colima"), details: Run { - run: s("brew install colima"), + // This may depend on openssl 3, which conflicts with 1.1. + run: s(indoc! {" + brew unlink openssl@1.1 || true + brew install colima + "}), }, env: dict! {}, }, From b798db386bd34e59710fa96e4ef4764ac1a10fa5 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 19:57:27 -0800 Subject: [PATCH 23/45] CI: Try --overwrite instead --- .github/workflows/main.yaml | 4 +--- src/bin/gen_github_yaml.rs | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 44cf360..8b11e50 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -186,9 +186,7 @@ jobs: - name: Install Docker run: brew install docker - name: Install Colima - run: | - brew unlink openssl@1.1 || true - brew install colima + run: brew install colima --overwrite - name: Save Homebrew cache uses: actions/cache/save@v3 with: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 7297577..0bd5f08 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -646,11 +646,11 @@ fn docker_mac_install_steps(os: Os) -> Vec { Step { name: s("Install Colima"), details: Run { - // This may depend on openssl 3, which conflicts with 1.1. - run: s(indoc! {" - brew unlink openssl@1.1 || true - brew install colima - "}), + // The `--overwite` flag is a workaround because this may + // install or upgrade openssl to version 3, which conflicts + // with version 1.1. They fight over the symlink + // `/usr/local/bin/openssl`. + run: s("brew install colima --overwrite"), }, env: dict! {}, }, From 121c29b64c59273ccc3186a3f1a9f17d638dc2ff Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 20:01:27 -0800 Subject: [PATCH 24/45] CI: Try moving overwrite flag --- .github/workflows/main.yaml | 2 +- src/bin/gen_github_yaml.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8b11e50..5bea909 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -186,7 +186,7 @@ jobs: - name: Install Docker run: brew install docker - name: Install Colima - run: brew install colima --overwrite + run: brew install --overwrite colima - name: Save Homebrew cache uses: actions/cache/save@v3 with: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 0bd5f08..eae0bda 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -650,7 +650,7 @@ fn docker_mac_install_steps(os: Os) -> Vec { // install or upgrade openssl to version 3, which conflicts // with version 1.1. They fight over the symlink // `/usr/local/bin/openssl`. - run: s("brew install colima --overwrite"), + run: s("brew install --overwrite colima"), }, env: dict! {}, }, From c0ab9331525e2bd019953a2a9e7052a15ad6217d Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 20:10:39 -0800 Subject: [PATCH 25/45] CI: Try installing openssl separately --- .github/workflows/main.yaml | 4 +++- src/bin/gen_github_yaml.rs | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5bea909..32deac6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -186,7 +186,9 @@ jobs: - name: Install Docker run: brew install docker - name: Install Colima - run: brew install --overwrite colima + run: | + brew install --overwrite openssl@3 + brew install colima - name: Save Homebrew cache uses: actions/cache/save@v3 with: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index eae0bda..5cf6fe0 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -650,7 +650,10 @@ fn docker_mac_install_steps(os: Os) -> Vec { // install or upgrade openssl to version 3, which conflicts // with version 1.1. They fight over the symlink // `/usr/local/bin/openssl`. - run: s("brew install --overwrite colima"), + run: s(indoc! {" + brew install --overwrite openssl@3 + brew install colima + "}), }, env: dict! {}, }, From cb7b3d2389949bf5e05b91211c9e7c3a255ab641 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 20:15:02 -0800 Subject: [PATCH 26/45] CI: Update openssl comment --- src/bin/gen_github_yaml.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 5cf6fe0..4e76fc7 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -646,10 +646,11 @@ fn docker_mac_install_steps(os: Os) -> Vec { Step { name: s("Install Colima"), details: Run { - // The `--overwite` flag is a workaround because this may - // install or upgrade openssl to version 3, which conflicts - // with version 1.1. They fight over the symlink - // `/usr/local/bin/openssl`. + // Currently, installing colima upgrades openssl from 3.2.0_1 + // to 3.2.1. Somehow, this conflicts with version 1.1, + // fighting over the symlink `/usr/local/bin/openssl`. To work + // around this, install openssl explicitly with the + // `--overwrite` flag. run: s(indoc! {" brew install --overwrite openssl@3 brew install colima From 5bc5d9bc9367cfdcc11839335ee24b4531ab8a55 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 20:41:32 -0800 Subject: [PATCH 27/45] CI: Revert to colima-qemu --- .github/workflows/main.yaml | 2 +- src/bin/gen_github_yaml.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 32deac6..db75ee2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -195,7 +195,7 @@ jobs: key: homebrew-macos-13 path: ~/Library/Caches/Homebrew/ - name: Start Colima - run: colima start --disk 4 --mount-type virtiofs --vm-type vz + run: colima start - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 4e76fc7..9d43071 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -673,6 +673,8 @@ fn docker_mac_install_steps(os: Os) -> Vec { Step { name: s("Start Colima"), details: Run { + // Unfortunately, VZ seems to hang forever as of 2024-01-31. + // // The Lima docs say that the VZ backend is faster and the // example uses virtiofs. VZ is only available starting in Mac // OS 13. See . @@ -683,7 +685,9 @@ fn docker_mac_install_steps(os: Os) -> Vec { // smaller. The QCOW2 image expands to a 3.5 GiB raw disk, and // the `--disk` flag takes an int, so the smallest reasonable // size is probably 4. - run: s("colima start --disk 4 --mount-type virtiofs --vm-type vz"), + // + // run: s("colima start --disk 4 --mount-type virtiofs --vm-type vz"), + run: s("colima start"), // using QEMU by default, not VZ }, env: dict! {}, }, From 674000fe8aad26a1ca528b3c42e79ff44563a8e4 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 20:47:28 -0800 Subject: [PATCH 28/45] CI: Drop homebrew cache (it doesn't help much) --- .github/workflows/main.yaml | 10 ---------- src/bin/gen_github_yaml.rs | 28 ++-------------------------- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index db75ee2..a8d668a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -178,22 +178,12 @@ jobs: - build-macos-13-stable runs-on: macos-13 steps: - - name: Restore Homebrew cache - uses: actions/cache/restore@v3 - with: - key: homebrew-macos-13 - path: ~/Library/Caches/Homebrew/ - name: Install Docker run: brew install docker - name: Install Colima run: | brew install --overwrite openssl@3 brew install colima - - name: Save Homebrew cache - uses: actions/cache/save@v3 - with: - key: homebrew-macos-13 - path: ~/Library/Caches/Homebrew/ - name: Start Colima run: colima start - name: Docker hello world diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 9d43071..e3bca16 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -220,6 +220,7 @@ impl Display for Os { } #[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[allow(unused)] enum Action { Checkout, Cache, @@ -620,21 +621,8 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) // Docker isn't installed on the Mac runners due to licensing issues: // see . -fn docker_mac_install_steps(os: Os) -> Vec { - let homebrew_cache_path = "~/Library/Caches/Homebrew/"; - let homebrew_cache_key = format!("homebrew-{os}"); +fn docker_mac_install_steps(_os: Os) -> Vec { vec![ - Step { - name: s("Restore Homebrew cache"), - details: Uses { - uses: Action::CacheRestore, - with: dict! { - "path" => homebrew_cache_path, - "key" => homebrew_cache_key, - }, - }, - env: dict! {}, - }, Step { name: s("Install Docker"), details: Run { @@ -658,18 +646,6 @@ fn docker_mac_install_steps(os: Os) -> Vec { }, env: dict! {}, }, - // Save the cache early in case a later step fails. - Step { - name: s("Save Homebrew cache"), - details: Uses { - uses: Action::CacheSave, - with: dict! { - "path" => homebrew_cache_path, - "key" => homebrew_cache_key, - }, - }, - env: dict! {}, - }, Step { name: s("Start Colima"), details: Run { From e824c48a208f2919b93512f0904c38d6b220ee81 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 21:04:58 -0800 Subject: [PATCH 29/45] CI: Add parallel MacOS 12 build (will probably switch back) --- .github/workflows/main.yaml | 80 +++++++++++++++++ src/bin/gen_github_yaml.rs | 168 +++++++++++++++++++++++++----------- 2 files changed, 196 insertions(+), 52 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a8d668a..3d78187 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,6 +11,52 @@ on: - cron: 0 16 * * * workflow_dispatch: {} jobs: + build-macos-12-stable: + name: Build & check (macos-12, Rust stable) + runs-on: macos-12 + steps: + - name: Check out sources + uses: actions/checkout@v2 + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + components: rustfmt, clippy + override: 'true' + profile: minimal + toolchain: stable + - name: Use Rust/Cargo cache + uses: actions/cache@v3 + with: + key: cargo-macos-12-stable-${{ hashFiles('Cargo.lock') }} + path: | + ~/.cargo/registry + ~/.cargo/git/ + target/ + restore-keys: cargo-macos-12-stable- + - name: Run cargo build + uses: actions-rs/cargo@v1 + with: + command: build + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + env: + RUST_BACKTRACE: '1' + - name: Save build artifact + run: | + tar -C .. --create \ + cubicle/packages/ \ + cubicle/src/bin/system_test/github/ \ + cubicle/target/debug/cub \ + cubicle/target/debug/system_test | \ + gzip -1 > debug-dist.tar.gz + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: debug-dist-macos-12-stable + path: debug-dist.tar.gz build-macos-13-stable: name: Build & check (macos-13, Rust stable) runs-on: macos-13 @@ -172,6 +218,40 @@ jobs: if-no-files-found: error name: debug-dist-ubuntu-22.04-stable path: debug-dist.tar.gz + system_test-macos-12-docker: + name: System tests (macos-12, docker) + needs: + - build-macos-12-stable + runs-on: macos-12 + steps: + - name: Install Docker + run: brew install docker docker-machine + - name: Create VirtualBox VM for Docker + run: | + docker-machine create \ + --driver virtualbox \ + --virtualbox-boot2docker-url 'https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso' \ + --virtualbox-hostonly-cidr '192.168.56.1/24' \ + default && \ + eval "$(docker-machine env default)" && \ + env | grep DOCKER >> $GITHUB_ENV + - name: Docker hello world + run: docker run --rm debian:12 echo 'Hello world' + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: debug-dist-macos-12-stable + - name: Unpack build artifact + run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + - name: Run cub list + run: ./target/debug/cub --config 'src/bin/system_test/github/docker.toml' list + env: + RUST_BACKTRACE: '1' + - name: Run system test + run: ./target/debug/system_test --config 'src/bin/system_test/github/docker.toml' + env: + INSTA_WORKSPACE_ROOT: . + RUST_BACKTRACE: '1' system_test-macos-13-docker: name: System tests (macos-13, docker) needs: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index e3bca16..783e781 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -188,21 +188,26 @@ use StepDetails::*; #[derive(Clone, Copy, Debug, Eq, PartialEq)] enum Os { Ubuntu, - Mac, + Mac12, + // The Docker setup on Mac OS 13 is currently very slooooow. + #[allow(unused)] + Mac13, } impl Os { fn as_str(&self) -> &'static str { match self { Self::Ubuntu => "ubuntu-22.04", - Self::Mac => "macos-13", + Self::Mac12 => "macos-12", + Self::Mac13 => "macos-13", } } fn as_ident(&self) -> &'static str { match self { Self::Ubuntu => "ubuntu-22-04", - Self::Mac => "macos-13", + Self::Mac12 => "macos-12", + Self::Mac13 => "macos-13", } } } @@ -331,8 +336,13 @@ fn ci_jobs() -> BTreeMap { jobs.extend([build_job(Os::Ubuntu, Rust::Nightly, RunOnceChecks(false))]); - let mac_stable_key = { - let (key, job) = build_job(Os::Mac, Rust::Stable, RunOnceChecks(false)); + let mac12_stable_key = { + let (key, job) = build_job(Os::Mac12, Rust::Stable, RunOnceChecks(false)); + jobs.insert(key.clone(), job); + key + }; + let mac13_stable_key = { + let (key, job) = build_job(Os::Mac13, Rust::Stable, RunOnceChecks(false)); jobs.insert(key.clone(), job); key }; @@ -350,7 +360,8 @@ fn ci_jobs() -> BTreeMap { vec![ubuntu_stable_key.clone()], ), system_test_job(Os::Ubuntu, Runner::User, vec![ubuntu_stable_key]), - system_test_job(Os::Mac, Runner::Docker, vec![mac_stable_key]), + system_test_job(Os::Mac12, Runner::Docker, vec![mac12_stable_key]), + system_test_job(Os::Mac13, Runner::Docker, vec![mac13_stable_key]), ]); jobs @@ -544,9 +555,7 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) } Runner::Docker | Runner::DockerBind => { - if os == Os::Mac { - steps.extend(docker_mac_install_steps(os)); - } + steps.extend(install_docker(os)); steps.push(Step { name: s("Docker hello world"), @@ -619,55 +628,110 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) (key, job) } -// Docker isn't installed on the Mac runners due to licensing issues: -// see . -fn docker_mac_install_steps(_os: Os) -> Vec { - vec![ - Step { - name: s("Install Docker"), - details: Run { - run: s("brew install docker"), +fn install_docker(os: Os) -> Vec { + // Docker isn't installed on the Mac runners due to licensing issues: + // see . + match os { + Os::Mac12 => vec![ + Step { + name: s("Install Docker"), + details: Run { + run: s("brew install docker docker-machine"), + }, + env: dict! {}, }, - env: dict! {}, - }, - // Colima isn't installed in the Mac OS 13 runners. - Step { - name: s("Install Colima"), - details: Run { - // Currently, installing colima upgrades openssl from 3.2.0_1 - // to 3.2.1. Somehow, this conflicts with version 1.1, - // fighting over the symlink `/usr/local/bin/openssl`. To work - // around this, install openssl explicitly with the - // `--overwrite` flag. - run: s(indoc! {" + Step { + name: s("Create VirtualBox VM for Docker"), + // Normally docker-machine would check for the latest boot2docker + // URL, but it gives the error: `Error with pre-create check: + // "failure getting a version tag from the Github API response (are + // you getting rate limited by Github?)"`. Its README says to pass + // `--github-api-token`, but that doesn't work due to + // and + // . This just sets + // a static URL. Because boot2docker is no longer maintained, + // there's no risk of a newer ISO being released. + + // Then, set a different IPv4 range to work around this error: + // + // ``` + // Error creating machine: Error in driver during machine creation: + // Error setting up host only network on machine start: + // /usr/local/bin/VBoxManage hostonlyif ipconfig vboxnet0 --ip + // 192.168.99.1 --netmask 255.255.255.0 failed: + // VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied + // (extended info not available) + // VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), + // Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp + // ``` + // + // See . + details: Run { + run: s(indoc! {r#" + docker-machine create \ + --driver virtualbox \ + --virtualbox-boot2docker-url 'https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso' \ + --virtualbox-hostonly-cidr '192.168.56.1/24' \ + default && \ + eval "$(docker-machine env default)" && \ + env | grep DOCKER >> $GITHUB_ENV + "#}), + }, + env: dict! {}, + }, + ], + + // This works, but it takes about 7 minutes to do the Docker "Hello + // world". + Os::Mac13 => vec![ + Step { + name: s("Install Docker"), + details: Run { + run: s("brew install docker"), + }, + env: dict! {}, + }, + // Colima isn't installed in the Mac OS 13 runners. + Step { + name: s("Install Colima"), + details: Run { + // Currently, installing colima upgrades openssl from 3.2.0_1 + // to 3.2.1. Somehow, this conflicts with version 1.1, + // fighting over the symlink `/usr/local/bin/openssl`. To work + // around this, install openssl explicitly with the + // `--overwrite` flag. + run: s(indoc! {" brew install --overwrite openssl@3 brew install colima "}), + }, + env: dict! {}, }, - env: dict! {}, - }, - Step { - name: s("Start Colima"), - details: Run { - // Unfortunately, VZ seems to hang forever as of 2024-01-31. - // - // The Lima docs say that the VZ backend is faster and the - // example uses virtiofs. VZ is only available starting in Mac - // OS 13. See . - // - // The default disk size is 60 GiB, and the VZ backend appears - // to unpack and "expand" the QCOW2 image. The runner only has - // 14 GB and is slow to write to disk, so set the disk size - // smaller. The QCOW2 image expands to a 3.5 GiB raw disk, and - // the `--disk` flag takes an int, so the smallest reasonable - // size is probably 4. - // - // run: s("colima start --disk 4 --mount-type virtiofs --vm-type vz"), - run: s("colima start"), // using QEMU by default, not VZ + Step { + name: s("Start Colima"), + details: Run { + // Unfortunately, VZ seems to hang forever as of 2024-01-31. + // + // The Lima docs say that the VZ backend is faster and the + // example uses virtiofs. VZ is only available starting in Mac + // OS 13. See . + // + // The default disk size is 60 GiB, and the VZ backend appears + // to unpack and "expand" the QCOW2 image. The runner only has + // 14 GB and is slow to write to disk, so set the disk size + // smaller. The QCOW2 image expands to a 3.5 GiB raw disk, and + // the `--disk` flag takes an int, so the smallest reasonable + // size is probably 4. + // + // run: s("colima start --disk 4 --mount-type virtiofs --vm-type vz"), + run: s("colima start"), // using QEMU by default, not VZ + }, + env: dict! {}, }, - env: dict! {}, - }, - ] + ], + + Os::Ubuntu => vec![/* none */], + } } fn write(mut w: W, workflow: &Workflow) -> anyhow::Result<()> { From c8e09bd394e13f7fddca8aa28ad704671b4725ee Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 21:15:08 -0800 Subject: [PATCH 30/45] CI: Update comments --- src/bin/gen_github_yaml.rs | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 783e781..d40fc7a 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -632,6 +632,7 @@ fn install_docker(os: Os) -> Vec { // Docker isn't installed on the Mac runners due to licensing issues: // see . match os { + // This takes about 2 minutes to get through the Docker "Hello world". Os::Mac12 => vec![ Step { name: s("Install Docker"), @@ -642,15 +643,16 @@ fn install_docker(os: Os) -> Vec { }, Step { name: s("Create VirtualBox VM for Docker"), - // Normally docker-machine would check for the latest boot2docker - // URL, but it gives the error: `Error with pre-create check: - // "failure getting a version tag from the Github API response (are - // you getting rate limited by Github?)"`. Its README says to pass - // `--github-api-token`, but that doesn't work due to + // Normally docker-machine would check for the latest + // boot2docker URL, but it gives the error: `Error with + // pre-create check: "failure getting a version tag from the + // Github API response (are you getting rate limited by + // Github?)"`. Its README says to pass `--github-api-token`, + // but that doesn't work due to // and - // . This just sets - // a static URL. Because boot2docker is no longer maintained, - // there's no risk of a newer ISO being released. + // . This just + // sets a static URL. Because boot2docker is no longer + // maintained, there's no risk of a newer ISO being released. // Then, set a different IPv4 range to work around this error: // @@ -681,8 +683,14 @@ fn install_docker(os: Os) -> Vec { }, ], - // This works, but it takes about 7 minutes to do the Docker "Hello - // world". + // This works, but it takes about 7 minutes to get through the Docker + // "Hello world". + // + // It doesn't seem like we can continue using the Mac OS 12 approach: + // - Virtualbox isn't installed and doesn't seem to work (with `brew + // install virtualbox`) on the Mac OS 13 runners. + // - boot2docker is deprecated. + // - docker-machine is deprecated. Os::Mac13 => vec![ Step { name: s("Install Docker"), @@ -730,7 +738,7 @@ fn install_docker(os: Os) -> Vec { }, ], - Os::Ubuntu => vec![/* none */], + Os::Ubuntu => vec![/* works out of the box */], } } From 13ece9068a4e21b9178a7e3da2995eea69299087 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 23:18:23 -0800 Subject: [PATCH 31/45] CI: Try apt-get update in Docker hello world --- .github/workflows/main.yaml | 10 ++++------ src/bin/gen_github_yaml.rs | 5 +++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3d78187..b026bd5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -220,8 +220,6 @@ jobs: path: debug-dist.tar.gz system_test-macos-12-docker: name: System tests (macos-12, docker) - needs: - - build-macos-12-stable runs-on: macos-12 steps: - name: Install Docker @@ -236,7 +234,7 @@ jobs: eval "$(docker-machine env default)" && \ env | grep DOCKER >> $GITHUB_ENV - name: Docker hello world - run: docker run --rm debian:12 echo 'Hello world' + run: docker run --rm debian:12 apt-get update - name: Download build artifact uses: actions/download-artifact@v3 with: @@ -267,7 +265,7 @@ jobs: - name: Start Colima run: colima start - name: Docker hello world - run: docker run --rm debian:12 echo 'Hello world' + run: docker run --rm debian:12 apt-get update - name: Download build artifact uses: actions/download-artifact@v3 with: @@ -313,7 +311,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Docker hello world - run: docker run --rm debian:12 echo 'Hello world' + run: docker run --rm debian:12 apt-get update - name: Download build artifact uses: actions/download-artifact@v3 with: @@ -336,7 +334,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Docker hello world - run: docker run --rm debian:12 echo 'Hello world' + run: docker run --rm debian:12 apt-get update - name: Download build artifact uses: actions/download-artifact@v3 with: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index d40fc7a..b7e5964 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -360,7 +360,7 @@ fn ci_jobs() -> BTreeMap { vec![ubuntu_stable_key.clone()], ), system_test_job(Os::Ubuntu, Runner::User, vec![ubuntu_stable_key]), - system_test_job(Os::Mac12, Runner::Docker, vec![mac12_stable_key]), + system_test_job(Os::Mac12, Runner::Docker, vec![/*mac12_stable_key*/]), system_test_job(Os::Mac13, Runner::Docker, vec![mac13_stable_key]), ]); @@ -560,7 +560,8 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) steps.push(Step { name: s("Docker hello world"), details: Run { - run: s("docker run --rm debian:12 echo 'Hello world'"), + // run: s("docker run --rm debian:12 echo 'Hello world'"), + run: s("docker run --rm debian:12 apt-get update"), }, env: dict! {}, }); From d86b8ee0af4542fac7247c5f99af2865749b1071 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 23:24:01 -0800 Subject: [PATCH 32/45] Re-run CI From 8156b189676270289a33a8c4ef52b24072ab3986 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Wed, 31 Jan 2024 23:31:20 -0800 Subject: [PATCH 33/45] CI: More apt debugging --- .github/workflows/main.yaml | 332 +----------------------------------- src/bin/gen_github_yaml.rs | 12 +- 2 files changed, 11 insertions(+), 333 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b026bd5..e3cad1b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,213 +11,6 @@ on: - cron: 0 16 * * * workflow_dispatch: {} jobs: - build-macos-12-stable: - name: Build & check (macos-12, Rust stable) - runs-on: macos-12 - steps: - - name: Check out sources - uses: actions/checkout@v2 - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - components: rustfmt, clippy - override: 'true' - profile: minimal - toolchain: stable - - name: Use Rust/Cargo cache - uses: actions/cache@v3 - with: - key: cargo-macos-12-stable-${{ hashFiles('Cargo.lock') }} - path: | - ~/.cargo/registry - ~/.cargo/git/ - target/ - restore-keys: cargo-macos-12-stable- - - name: Run cargo build - uses: actions-rs/cargo@v1 - with: - command: build - - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test - env: - RUST_BACKTRACE: '1' - - name: Save build artifact - run: | - tar -C .. --create \ - cubicle/packages/ \ - cubicle/src/bin/system_test/github/ \ - cubicle/target/debug/cub \ - cubicle/target/debug/system_test | \ - gzip -1 > debug-dist.tar.gz - - name: Upload build artifact - uses: actions/upload-artifact@v3 - with: - if-no-files-found: error - name: debug-dist-macos-12-stable - path: debug-dist.tar.gz - build-macos-13-stable: - name: Build & check (macos-13, Rust stable) - runs-on: macos-13 - steps: - - name: Check out sources - uses: actions/checkout@v2 - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - components: rustfmt, clippy - override: 'true' - profile: minimal - toolchain: stable - - name: Use Rust/Cargo cache - uses: actions/cache@v3 - with: - key: cargo-macos-13-stable-${{ hashFiles('Cargo.lock') }} - path: | - ~/.cargo/registry - ~/.cargo/git/ - target/ - restore-keys: cargo-macos-13-stable- - - name: Run cargo build - uses: actions-rs/cargo@v1 - with: - command: build - - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test - env: - RUST_BACKTRACE: '1' - - name: Save build artifact - run: | - tar -C .. --create \ - cubicle/packages/ \ - cubicle/src/bin/system_test/github/ \ - cubicle/target/debug/cub \ - cubicle/target/debug/system_test | \ - gzip -1 > debug-dist.tar.gz - - name: Upload build artifact - uses: actions/upload-artifact@v3 - with: - if-no-files-found: error - name: debug-dist-macos-13-stable - path: debug-dist.tar.gz - build-ubuntu-22-04-nightly: - name: Build & check (ubuntu-22.04, Rust nightly) - runs-on: ubuntu-22.04 - steps: - - name: Check out sources - uses: actions/checkout@v2 - - name: Install Rust nightly toolchain - uses: actions-rs/toolchain@v1 - with: - components: rustfmt, clippy - override: 'true' - profile: minimal - toolchain: nightly - - name: Use Rust/Cargo cache - uses: actions/cache@v3 - with: - key: cargo-ubuntu-22.04-nightly-${{ hashFiles('Cargo.lock') }} - path: | - ~/.cargo/registry - ~/.cargo/git/ - target/ - restore-keys: cargo-ubuntu-22.04-nightly- - - name: Run cargo build - uses: actions-rs/cargo@v1 - with: - command: build - - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test - env: - RUST_BACKTRACE: '1' - - name: Save build artifact - run: | - tar -C .. --create \ - cubicle/packages/ \ - cubicle/src/bin/system_test/github/ \ - cubicle/target/debug/cub \ - cubicle/target/debug/system_test | \ - gzip -1 > debug-dist.tar.gz - - name: Upload build artifact - uses: actions/upload-artifact@v3 - with: - if-no-files-found: error - name: debug-dist-ubuntu-22.04-nightly - path: debug-dist.tar.gz - build-ubuntu-22-04-stable: - name: Build & check (ubuntu-22.04, Rust stable) - runs-on: ubuntu-22.04 - steps: - - name: Check out sources - uses: actions/checkout@v2 - - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - components: rustfmt, clippy - override: 'true' - profile: minimal - toolchain: stable - - name: Use Rust/Cargo cache - uses: actions/cache@v3 - with: - key: cargo-ubuntu-22.04-stable-${{ hashFiles('Cargo.lock') }} - path: | - ~/.cargo/registry - ~/.cargo/git/ - target/ - restore-keys: cargo-ubuntu-22.04-stable- - - name: Run cargo build - uses: actions-rs/cargo@v1 - with: - command: build - - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test - env: - RUST_BACKTRACE: '1' - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - args: --all -- --check - command: fmt - - name: Run clippy - uses: actions-rs/cargo@v1 - with: - args: -- -D warnings - command: clippy - - name: Check GitHub YAML - run: | - cargo run --bin gen_github_yaml > .github/workflows/main.gen.yaml - diff .github/workflows/main.yaml .github/workflows/main.gen.yaml - - name: Install cargo audit - uses: actions-rs/cargo@v1 - with: - args: cargo-audit - command: install - - name: Run cargo audit - uses: actions-rs/cargo@v1 - with: - command: audit - - name: Save build artifact - run: | - tar -C .. --create \ - cubicle/packages/ \ - cubicle/src/bin/system_test/github/ \ - cubicle/target/debug/cub \ - cubicle/target/debug/system_test | \ - gzip -1 > debug-dist.tar.gz - - name: Upload build artifact - uses: actions/upload-artifact@v3 - with: - if-no-files-found: error - name: debug-dist-ubuntu-22.04-stable - path: debug-dist.tar.gz system_test-macos-12-docker: name: System tests (macos-12, docker) runs-on: macos-12 @@ -234,7 +27,7 @@ jobs: eval "$(docker-machine env default)" && \ env | grep DOCKER >> $GITHUB_ENV - name: Docker hello world - run: docker run --rm debian:12 apt-get update + run: docker run --rm debian:12 sh -c 'env; dpkg -l debian-archive-keyring; apt-get update' - name: Download build artifact uses: actions/download-artifact@v3 with: @@ -250,126 +43,3 @@ jobs: env: INSTA_WORKSPACE_ROOT: . RUST_BACKTRACE: '1' - system_test-macos-13-docker: - name: System tests (macos-13, docker) - needs: - - build-macos-13-stable - runs-on: macos-13 - steps: - - name: Install Docker - run: brew install docker - - name: Install Colima - run: | - brew install --overwrite openssl@3 - brew install colima - - name: Start Colima - run: colima start - - name: Docker hello world - run: docker run --rm debian:12 apt-get update - - name: Download build artifact - uses: actions/download-artifact@v3 - with: - name: debug-dist-macos-13-stable - - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - - name: Run cub list - run: ./target/debug/cub --config 'src/bin/system_test/github/docker.toml' list - env: - RUST_BACKTRACE: '1' - - name: Run system test - run: ./target/debug/system_test --config 'src/bin/system_test/github/docker.toml' - env: - INSTA_WORKSPACE_ROOT: . - RUST_BACKTRACE: '1' - system_test-ubuntu-22-04-bubblewrap: - name: System tests (ubuntu-22.04, bubblewrap) - needs: - - build-ubuntu-22-04-stable - runs-on: ubuntu-22.04 - steps: - - name: Install Bubblewrap and minor dependencies - run: sudo apt-get install -y bubblewrap pv - - name: Download build artifact - uses: actions/download-artifact@v3 - with: - name: debug-dist-ubuntu-22.04-stable - - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - - name: Run cub list - run: ./target/debug/cub --config 'src/bin/system_test/github/bubblewrap.toml' list - env: - RUST_BACKTRACE: '1' - - name: Run system test - run: ./target/debug/system_test --config 'src/bin/system_test/github/bubblewrap.toml' - env: - INSTA_WORKSPACE_ROOT: . - RUST_BACKTRACE: '1' - system_test-ubuntu-22-04-docker: - name: System tests (ubuntu-22.04, docker) - needs: - - build-ubuntu-22-04-stable - runs-on: ubuntu-22.04 - steps: - - name: Docker hello world - run: docker run --rm debian:12 apt-get update - - name: Download build artifact - uses: actions/download-artifact@v3 - with: - name: debug-dist-ubuntu-22.04-stable - - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - - name: Run cub list - run: ./target/debug/cub --config 'src/bin/system_test/github/docker.toml' list - env: - RUST_BACKTRACE: '1' - - name: Run system test - run: ./target/debug/system_test --config 'src/bin/system_test/github/docker.toml' - env: - INSTA_WORKSPACE_ROOT: . - RUST_BACKTRACE: '1' - system_test-ubuntu-22-04-docker-bind: - name: System tests (ubuntu-22.04, docker-bind) - needs: - - build-ubuntu-22-04-stable - runs-on: ubuntu-22.04 - steps: - - name: Docker hello world - run: docker run --rm debian:12 apt-get update - - name: Download build artifact - uses: actions/download-artifact@v3 - with: - name: debug-dist-ubuntu-22.04-stable - - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - - name: Run cub list - run: ./target/debug/cub --config 'src/bin/system_test/github/docker-bind.toml' list - env: - RUST_BACKTRACE: '1' - - name: Run system test - run: ./target/debug/system_test --config 'src/bin/system_test/github/docker-bind.toml' - env: - INSTA_WORKSPACE_ROOT: . - RUST_BACKTRACE: '1' - system_test-ubuntu-22-04-user: - name: System tests (ubuntu-22.04, user) - needs: - - build-ubuntu-22-04-stable - runs-on: ubuntu-22.04 - steps: - - name: Install minor dependencies - run: sudo apt-get install -y pv - - name: Download build artifact - uses: actions/download-artifact@v3 - with: - name: debug-dist-ubuntu-22.04-stable - - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz - - name: Run cub list - run: ./target/debug/cub --config 'src/bin/system_test/github/user.toml' list - env: - RUST_BACKTRACE: '1' - - name: Run system test - run: ./target/debug/system_test --config 'src/bin/system_test/github/user.toml' - env: - INSTA_WORKSPACE_ROOT: . - RUST_BACKTRACE: '1' diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index b7e5964..e68a01f 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -328,6 +328,7 @@ fn ci_workflow() -> Workflow { fn ci_jobs() -> BTreeMap { let mut jobs = BTreeMap::new(); + /* let ubuntu_stable_key = { let (key, job) = build_job(Os::Ubuntu, Rust::Stable, RunOnceChecks(true)); jobs.insert(key.clone(), job); @@ -360,9 +361,16 @@ fn ci_jobs() -> BTreeMap { vec![ubuntu_stable_key.clone()], ), system_test_job(Os::Ubuntu, Runner::User, vec![ubuntu_stable_key]), - system_test_job(Os::Mac12, Runner::Docker, vec![/*mac12_stable_key*/]), + system_test_job(Os::Mac12, Runner::Docker, vec![mac12_stable_key]), system_test_job(Os::Mac13, Runner::Docker, vec![mac13_stable_key]), ]); + */ + + jobs.extend([system_test_job( + Os::Mac12, + Runner::Docker, + vec![/*mac12_stable_key*/], + )]); jobs } @@ -561,7 +569,7 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) name: s("Docker hello world"), details: Run { // run: s("docker run --rm debian:12 echo 'Hello world'"), - run: s("docker run --rm debian:12 apt-get update"), + run: s("docker run --rm debian:12 sh -c 'env; dpkg -l debian-archive-keyring; apt-get update'"), }, env: dict! {}, }); From ee20bd032ce2c7e08c0446bd2f35fc8171c482fb Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 11:20:54 -0800 Subject: [PATCH 34/45] CI: More debian/gpgv debugging --- .github/workflows/main.yaml | 8 ++++++-- src/bin/gen_github_yaml.rs | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e3cad1b..20aaf68 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -26,8 +26,12 @@ jobs: default && \ eval "$(docker-machine env default)" && \ env | grep DOCKER >> $GITHUB_ENV - - name: Docker hello world - run: docker run --rm debian:12 sh -c 'env; dpkg -l debian-archive-keyring; apt-get update' + - name: Docker debian 11 + run: docker run --rm debian:11 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; true' + - name: Docker debian 12 + run: docker run --rm debian:12 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; true' + - name: Abort + run: 'false' - name: Download build artifact uses: actions/download-artifact@v3 with: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index e68a01f..fd0f39d 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -565,12 +565,20 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) Runner::Docker | Runner::DockerBind => { steps.extend(install_docker(os)); + for version in [11, 12] { + steps.push(Step { + name: format!("Docker debian {version}"), + details: Run { + // run: s("docker run --rm debian:12 echo 'Hello world'"), + run: format!("docker run --rm debian:{version} sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; true'"), + }, + env: dict! {}, + }); + } + steps.push(Step { - name: s("Docker hello world"), - details: Run { - // run: s("docker run --rm debian:12 echo 'Hello world'"), - run: s("docker run --rm debian:12 sh -c 'env; dpkg -l debian-archive-keyring; apt-get update'"), - }, + name: s("Abort"), + details: Run { run: s("false") }, env: dict! {}, }); } From 0c83fd6d55fa306accc46a2e86c991007af15c2a Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 11:26:38 -0800 Subject: [PATCH 35/45] Re-run CI From cf7e4ff9ea8f6d2539e53e545096c9b69b2092d0 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 11:35:41 -0800 Subject: [PATCH 36/45] CI: More debian/gpgv debugging --- .github/workflows/main.yaml | 10 ++++++++-- src/bin/gen_github_yaml.rs | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 20aaf68..dde691e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,9 +27,15 @@ jobs: eval "$(docker-machine env default)" && \ env | grep DOCKER >> $GITHUB_ENV - name: Docker debian 11 - run: docker run --rm debian:11 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; true' + run: docker run --rm debian:11 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' + - name: Docker debian 12.2 + run: docker run --rm debian:12.2 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' + - name: Docker debian 12-slim + run: docker run --rm debian:12-slim sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' - name: Docker debian 12 - run: docker run --rm debian:12 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; true' + run: docker run --rm debian:12 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' + - name: Docker debian testing + run: docker run --rm debian:testing sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' - name: Abort run: 'false' - name: Download build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index fd0f39d..8321360 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -565,12 +565,12 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) Runner::Docker | Runner::DockerBind => { steps.extend(install_docker(os)); - for version in [11, 12] { + for version in ["11", "12.2", "12-slim", "12", "testing"] { steps.push(Step { name: format!("Docker debian {version}"), details: Run { // run: s("docker run --rm debian:12 echo 'Hello world'"), - run: format!("docker run --rm debian:{version} sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; true'"), + run: format!("docker run --rm debian:{version} sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true'"), }, env: dict! {}, }); From 66bf1f01348d9a85f16f469cb2030add83be1b3f Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 11:43:24 -0800 Subject: [PATCH 37/45] Re-run CI From 46f8cc604a897db9c2015fd9ec01f2fb403b1dd4 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 11:54:40 -0800 Subject: [PATCH 38/45] Revert to c8e09bd --- .github/workflows/main.yaml | 346 ++++++++++++++++++++++++++++++++++-- src/bin/gen_github_yaml.rs | 25 +-- 2 files changed, 338 insertions(+), 33 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index dde691e..3d78187 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,8 +11,217 @@ on: - cron: 0 16 * * * workflow_dispatch: {} jobs: + build-macos-12-stable: + name: Build & check (macos-12, Rust stable) + runs-on: macos-12 + steps: + - name: Check out sources + uses: actions/checkout@v2 + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + components: rustfmt, clippy + override: 'true' + profile: minimal + toolchain: stable + - name: Use Rust/Cargo cache + uses: actions/cache@v3 + with: + key: cargo-macos-12-stable-${{ hashFiles('Cargo.lock') }} + path: | + ~/.cargo/registry + ~/.cargo/git/ + target/ + restore-keys: cargo-macos-12-stable- + - name: Run cargo build + uses: actions-rs/cargo@v1 + with: + command: build + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + env: + RUST_BACKTRACE: '1' + - name: Save build artifact + run: | + tar -C .. --create \ + cubicle/packages/ \ + cubicle/src/bin/system_test/github/ \ + cubicle/target/debug/cub \ + cubicle/target/debug/system_test | \ + gzip -1 > debug-dist.tar.gz + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: debug-dist-macos-12-stable + path: debug-dist.tar.gz + build-macos-13-stable: + name: Build & check (macos-13, Rust stable) + runs-on: macos-13 + steps: + - name: Check out sources + uses: actions/checkout@v2 + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + components: rustfmt, clippy + override: 'true' + profile: minimal + toolchain: stable + - name: Use Rust/Cargo cache + uses: actions/cache@v3 + with: + key: cargo-macos-13-stable-${{ hashFiles('Cargo.lock') }} + path: | + ~/.cargo/registry + ~/.cargo/git/ + target/ + restore-keys: cargo-macos-13-stable- + - name: Run cargo build + uses: actions-rs/cargo@v1 + with: + command: build + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + env: + RUST_BACKTRACE: '1' + - name: Save build artifact + run: | + tar -C .. --create \ + cubicle/packages/ \ + cubicle/src/bin/system_test/github/ \ + cubicle/target/debug/cub \ + cubicle/target/debug/system_test | \ + gzip -1 > debug-dist.tar.gz + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: debug-dist-macos-13-stable + path: debug-dist.tar.gz + build-ubuntu-22-04-nightly: + name: Build & check (ubuntu-22.04, Rust nightly) + runs-on: ubuntu-22.04 + steps: + - name: Check out sources + uses: actions/checkout@v2 + - name: Install Rust nightly toolchain + uses: actions-rs/toolchain@v1 + with: + components: rustfmt, clippy + override: 'true' + profile: minimal + toolchain: nightly + - name: Use Rust/Cargo cache + uses: actions/cache@v3 + with: + key: cargo-ubuntu-22.04-nightly-${{ hashFiles('Cargo.lock') }} + path: | + ~/.cargo/registry + ~/.cargo/git/ + target/ + restore-keys: cargo-ubuntu-22.04-nightly- + - name: Run cargo build + uses: actions-rs/cargo@v1 + with: + command: build + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + env: + RUST_BACKTRACE: '1' + - name: Save build artifact + run: | + tar -C .. --create \ + cubicle/packages/ \ + cubicle/src/bin/system_test/github/ \ + cubicle/target/debug/cub \ + cubicle/target/debug/system_test | \ + gzip -1 > debug-dist.tar.gz + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: debug-dist-ubuntu-22.04-nightly + path: debug-dist.tar.gz + build-ubuntu-22-04-stable: + name: Build & check (ubuntu-22.04, Rust stable) + runs-on: ubuntu-22.04 + steps: + - name: Check out sources + uses: actions/checkout@v2 + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + components: rustfmt, clippy + override: 'true' + profile: minimal + toolchain: stable + - name: Use Rust/Cargo cache + uses: actions/cache@v3 + with: + key: cargo-ubuntu-22.04-stable-${{ hashFiles('Cargo.lock') }} + path: | + ~/.cargo/registry + ~/.cargo/git/ + target/ + restore-keys: cargo-ubuntu-22.04-stable- + - name: Run cargo build + uses: actions-rs/cargo@v1 + with: + command: build + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + env: + RUST_BACKTRACE: '1' + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + args: --all -- --check + command: fmt + - name: Run clippy + uses: actions-rs/cargo@v1 + with: + args: -- -D warnings + command: clippy + - name: Check GitHub YAML + run: | + cargo run --bin gen_github_yaml > .github/workflows/main.gen.yaml + diff .github/workflows/main.yaml .github/workflows/main.gen.yaml + - name: Install cargo audit + uses: actions-rs/cargo@v1 + with: + args: cargo-audit + command: install + - name: Run cargo audit + uses: actions-rs/cargo@v1 + with: + command: audit + - name: Save build artifact + run: | + tar -C .. --create \ + cubicle/packages/ \ + cubicle/src/bin/system_test/github/ \ + cubicle/target/debug/cub \ + cubicle/target/debug/system_test | \ + gzip -1 > debug-dist.tar.gz + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: debug-dist-ubuntu-22.04-stable + path: debug-dist.tar.gz system_test-macos-12-docker: name: System tests (macos-12, docker) + needs: + - build-macos-12-stable runs-on: macos-12 steps: - name: Install Docker @@ -26,18 +235,8 @@ jobs: default && \ eval "$(docker-machine env default)" && \ env | grep DOCKER >> $GITHUB_ENV - - name: Docker debian 11 - run: docker run --rm debian:11 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' - - name: Docker debian 12.2 - run: docker run --rm debian:12.2 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' - - name: Docker debian 12-slim - run: docker run --rm debian:12-slim sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' - - name: Docker debian 12 - run: docker run --rm debian:12 sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' - - name: Docker debian testing - run: docker run --rm debian:testing sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true' - - name: Abort - run: 'false' + - name: Docker hello world + run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact uses: actions/download-artifact@v3 with: @@ -53,3 +252,126 @@ jobs: env: INSTA_WORKSPACE_ROOT: . RUST_BACKTRACE: '1' + system_test-macos-13-docker: + name: System tests (macos-13, docker) + needs: + - build-macos-13-stable + runs-on: macos-13 + steps: + - name: Install Docker + run: brew install docker + - name: Install Colima + run: | + brew install --overwrite openssl@3 + brew install colima + - name: Start Colima + run: colima start + - name: Docker hello world + run: docker run --rm debian:12 echo 'Hello world' + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: debug-dist-macos-13-stable + - name: Unpack build artifact + run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + - name: Run cub list + run: ./target/debug/cub --config 'src/bin/system_test/github/docker.toml' list + env: + RUST_BACKTRACE: '1' + - name: Run system test + run: ./target/debug/system_test --config 'src/bin/system_test/github/docker.toml' + env: + INSTA_WORKSPACE_ROOT: . + RUST_BACKTRACE: '1' + system_test-ubuntu-22-04-bubblewrap: + name: System tests (ubuntu-22.04, bubblewrap) + needs: + - build-ubuntu-22-04-stable + runs-on: ubuntu-22.04 + steps: + - name: Install Bubblewrap and minor dependencies + run: sudo apt-get install -y bubblewrap pv + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: debug-dist-ubuntu-22.04-stable + - name: Unpack build artifact + run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + - name: Run cub list + run: ./target/debug/cub --config 'src/bin/system_test/github/bubblewrap.toml' list + env: + RUST_BACKTRACE: '1' + - name: Run system test + run: ./target/debug/system_test --config 'src/bin/system_test/github/bubblewrap.toml' + env: + INSTA_WORKSPACE_ROOT: . + RUST_BACKTRACE: '1' + system_test-ubuntu-22-04-docker: + name: System tests (ubuntu-22.04, docker) + needs: + - build-ubuntu-22-04-stable + runs-on: ubuntu-22.04 + steps: + - name: Docker hello world + run: docker run --rm debian:12 echo 'Hello world' + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: debug-dist-ubuntu-22.04-stable + - name: Unpack build artifact + run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + - name: Run cub list + run: ./target/debug/cub --config 'src/bin/system_test/github/docker.toml' list + env: + RUST_BACKTRACE: '1' + - name: Run system test + run: ./target/debug/system_test --config 'src/bin/system_test/github/docker.toml' + env: + INSTA_WORKSPACE_ROOT: . + RUST_BACKTRACE: '1' + system_test-ubuntu-22-04-docker-bind: + name: System tests (ubuntu-22.04, docker-bind) + needs: + - build-ubuntu-22-04-stable + runs-on: ubuntu-22.04 + steps: + - name: Docker hello world + run: docker run --rm debian:12 echo 'Hello world' + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: debug-dist-ubuntu-22.04-stable + - name: Unpack build artifact + run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + - name: Run cub list + run: ./target/debug/cub --config 'src/bin/system_test/github/docker-bind.toml' list + env: + RUST_BACKTRACE: '1' + - name: Run system test + run: ./target/debug/system_test --config 'src/bin/system_test/github/docker-bind.toml' + env: + INSTA_WORKSPACE_ROOT: . + RUST_BACKTRACE: '1' + system_test-ubuntu-22-04-user: + name: System tests (ubuntu-22.04, user) + needs: + - build-ubuntu-22-04-stable + runs-on: ubuntu-22.04 + steps: + - name: Install minor dependencies + run: sudo apt-get install -y pv + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: debug-dist-ubuntu-22.04-stable + - name: Unpack build artifact + run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + - name: Run cub list + run: ./target/debug/cub --config 'src/bin/system_test/github/user.toml' list + env: + RUST_BACKTRACE: '1' + - name: Run system test + run: ./target/debug/system_test --config 'src/bin/system_test/github/user.toml' + env: + INSTA_WORKSPACE_ROOT: . + RUST_BACKTRACE: '1' diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 8321360..d40fc7a 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -328,7 +328,6 @@ fn ci_workflow() -> Workflow { fn ci_jobs() -> BTreeMap { let mut jobs = BTreeMap::new(); - /* let ubuntu_stable_key = { let (key, job) = build_job(Os::Ubuntu, Rust::Stable, RunOnceChecks(true)); jobs.insert(key.clone(), job); @@ -364,13 +363,6 @@ fn ci_jobs() -> BTreeMap { system_test_job(Os::Mac12, Runner::Docker, vec![mac12_stable_key]), system_test_job(Os::Mac13, Runner::Docker, vec![mac13_stable_key]), ]); - */ - - jobs.extend([system_test_job( - Os::Mac12, - Runner::Docker, - vec![/*mac12_stable_key*/], - )]); jobs } @@ -565,20 +557,11 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) Runner::Docker | Runner::DockerBind => { steps.extend(install_docker(os)); - for version in ["11", "12.2", "12-slim", "12", "testing"] { - steps.push(Step { - name: format!("Docker debian {version}"), - details: Run { - // run: s("docker run --rm debian:12 echo 'Hello world'"), - run: format!("docker run --rm debian:{version} sh -c 'env; echo $PATH; gpgv --version; dpkg -l debian-archive-keyring; apt-get update; for file in $(dpkg -L debian-archive-keyring); do [ -f $file ] && sha256sum $file; done; true'"), - }, - env: dict! {}, - }); - } - steps.push(Step { - name: s("Abort"), - details: Run { run: s("false") }, + name: s("Docker hello world"), + details: Run { + run: s("docker run --rm debian:12 echo 'Hello world'"), + }, env: dict! {}, }); } From 30a73508f0df354d7b6628338e47f0b3a25847de Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 12:04:43 -0800 Subject: [PATCH 39/45] CI: Try colima on Mac OS 12 --- .github/workflows/main.yaml | 13 ++----- src/bin/gen_github_yaml.rs | 69 ++++++++++++++++++++++++------------- 2 files changed, 48 insertions(+), 34 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3d78187..48013c6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -225,16 +225,9 @@ jobs: runs-on: macos-12 steps: - name: Install Docker - run: brew install docker docker-machine - - name: Create VirtualBox VM for Docker - run: | - docker-machine create \ - --driver virtualbox \ - --virtualbox-boot2docker-url 'https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso' \ - --virtualbox-hostonly-cidr '192.168.56.1/24' \ - default && \ - eval "$(docker-machine env default)" && \ - env | grep DOCKER >> $GITHUB_ENV + run: brew install docker + - name: Start Colima + run: colima start - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index d40fc7a..026b27d 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -632,7 +632,16 @@ fn install_docker(os: Os) -> Vec { // Docker isn't installed on the Mac runners due to licensing issues: // see . match os { - // This takes about 2 minutes to get through the Docker "Hello world". + // This used to work but doesn't seem reliable as of 2024-02-01. + // When it does work, it takes about 2 minutes to get through the Docker + // "Hello world". + // + // For some bizarre reason, the debian:12 (currently 12.4) Docker image + // can't verify the GPG signatures during `apt-update`: "The following + // signatures couldn't be verified because the public key is not + // available". The same image works on Linux and Mac OS 13 with Colima, + // and the debian:11 image works on Mac OS 12 with boot2docker. + /* Os::Mac12 => vec![ Step { name: s("Install Docker"), @@ -682,7 +691,7 @@ fn install_docker(os: Os) -> Vec { env: dict! {}, }, ], - + */ // This works, but it takes about 7 minutes to get through the Docker // "Hello world". // @@ -691,31 +700,16 @@ fn install_docker(os: Os) -> Vec { // install virtualbox`) on the Mac OS 13 runners. // - boot2docker is deprecated. // - docker-machine is deprecated. - Os::Mac13 => vec![ - Step { + Os::Mac12 | Os::Mac13 => { + let install_docker = Step { name: s("Install Docker"), details: Run { run: s("brew install docker"), }, env: dict! {}, - }, - // Colima isn't installed in the Mac OS 13 runners. - Step { - name: s("Install Colima"), - details: Run { - // Currently, installing colima upgrades openssl from 3.2.0_1 - // to 3.2.1. Somehow, this conflicts with version 1.1, - // fighting over the symlink `/usr/local/bin/openssl`. To work - // around this, install openssl explicitly with the - // `--overwrite` flag. - run: s(indoc! {" - brew install --overwrite openssl@3 - brew install colima - "}), - }, - env: dict! {}, - }, - Step { + }; + + let start_colima = Step { name: s("Start Colima"), details: Run { // Unfortunately, VZ seems to hang forever as of 2024-01-31. @@ -735,8 +729,35 @@ fn install_docker(os: Os) -> Vec { run: s("colima start"), // using QEMU by default, not VZ }, env: dict! {}, - }, - ], + }; + + match os { + Os::Mac12 => vec![install_docker, start_colima], + + // Colima isn't installed in the Mac OS 13 runners. + Os::Mac13 => vec![ + install_docker, + Step { + name: s("Install Colima"), + details: Run { + // Currently, installing colima upgrades openssl from 3.2.0_1 + // to 3.2.1. Somehow, this conflicts with version 1.1, + // fighting over the symlink `/usr/local/bin/openssl`. To work + // around this, install openssl explicitly with the + // `--overwrite` flag. + run: s(indoc! {" + brew install --overwrite openssl@3 + brew install colima + "}), + }, + env: dict! {}, + }, + start_colima, + ], + + Os::Ubuntu => unreachable!(), + } + } Os::Ubuntu => vec![/* works out of the box */], } From ed26285e7d958320b290da2d6c6d95879566ef3c Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 12:53:08 -0800 Subject: [PATCH 40/45] CI: Update comments --- src/bin/gen_github_yaml.rs | 74 +++++--------------------------------- 1 file changed, 9 insertions(+), 65 deletions(-) diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 026b27d..a149e7c 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -188,9 +188,10 @@ use StepDetails::*; #[derive(Clone, Copy, Debug, Eq, PartialEq)] enum Os { Ubuntu, + + // Use both Mac OS 12 and 13 for now. Both are slow at Docker. Race them + // for a while to find out which one is faster or more reliable. Mac12, - // The Docker setup on Mac OS 13 is currently very slooooow. - #[allow(unused)] Mac13, } @@ -632,74 +633,17 @@ fn install_docker(os: Os) -> Vec { // Docker isn't installed on the Mac runners due to licensing issues: // see . match os { - // This used to work but doesn't seem reliable as of 2024-02-01. - // When it does work, it takes about 2 minutes to get through the Docker - // "Hello world". - // - // For some bizarre reason, the debian:12 (currently 12.4) Docker image - // can't verify the GPG signatures during `apt-update`: "The following - // signatures couldn't be verified because the public key is not - // available". The same image works on Linux and Mac OS 13 with Colima, - // and the debian:11 image works on Mac OS 12 with boot2docker. - /* - Os::Mac12 => vec![ - Step { - name: s("Install Docker"), - details: Run { - run: s("brew install docker docker-machine"), - }, - env: dict! {}, - }, - Step { - name: s("Create VirtualBox VM for Docker"), - // Normally docker-machine would check for the latest - // boot2docker URL, but it gives the error: `Error with - // pre-create check: "failure getting a version tag from the - // Github API response (are you getting rate limited by - // Github?)"`. Its README says to pass `--github-api-token`, - // but that doesn't work due to - // and - // . This just - // sets a static URL. Because boot2docker is no longer - // maintained, there's no risk of a newer ISO being released. - - // Then, set a different IPv4 range to work around this error: - // - // ``` - // Error creating machine: Error in driver during machine creation: - // Error setting up host only network on machine start: - // /usr/local/bin/VBoxManage hostonlyif ipconfig vboxnet0 --ip - // 192.168.99.1 --netmask 255.255.255.0 failed: - // VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied - // (extended info not available) - // VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), - // Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp - // ``` - // - // See . - details: Run { - run: s(indoc! {r#" - docker-machine create \ - --driver virtualbox \ - --virtualbox-boot2docker-url 'https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso' \ - --virtualbox-hostonly-cidr '192.168.56.1/24' \ - default && \ - eval "$(docker-machine env default)" && \ - env | grep DOCKER >> $GITHUB_ENV - "#}), - }, - env: dict! {}, - }, - ], - */ - // This works, but it takes about 7 minutes to get through the Docker - // "Hello world". + // Using Colima works for Mac OS 12 and 13, but it takes about 7 + // minutes to get through the Docker "Hello world". // - // It doesn't seem like we can continue using the Mac OS 12 approach: + // It doesn't seem like we can continue using the prior + // docker-machine/boot2docker/Virtualbox approach: // - Virtualbox isn't installed and doesn't seem to work (with `brew // install virtualbox`) on the Mac OS 13 runners. // - boot2docker is deprecated. // - docker-machine is deprecated. + // - Even on Mac OS 12, there were odd gpg issues with debian:12 when + // running apt-update (that don't happen with Colima or elsewhere). Os::Mac12 | Os::Mac13 => { let install_docker = Step { name: s("Install Docker"), From 01f1c039e02a4ca00d9494741df7bb614638b0fd Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 13:00:12 -0800 Subject: [PATCH 41/45] CI: Switch to zstd for build artifact --- .github/workflows/main.yaml | 40 +++++++++++++++++-------------------- src/bin/gen_github_yaml.rs | 15 ++++---------- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 48013c6..34009d6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -45,18 +45,17 @@ jobs: RUST_BACKTRACE: '1' - name: Save build artifact run: | - tar -C .. --create \ + tar -C .. --create --file debug-dist.tar.zst \ cubicle/packages/ \ cubicle/src/bin/system_test/github/ \ cubicle/target/debug/cub \ - cubicle/target/debug/system_test | \ - gzip -1 > debug-dist.tar.gz + cubicle/target/debug/system_test - name: Upload build artifact uses: actions/upload-artifact@v3 with: if-no-files-found: error name: debug-dist-macos-12-stable - path: debug-dist.tar.gz + path: debug-dist.tar.zst build-macos-13-stable: name: Build & check (macos-13, Rust stable) runs-on: macos-13 @@ -91,18 +90,17 @@ jobs: RUST_BACKTRACE: '1' - name: Save build artifact run: | - tar -C .. --create \ + tar -C .. --create --file debug-dist.tar.zst \ cubicle/packages/ \ cubicle/src/bin/system_test/github/ \ cubicle/target/debug/cub \ - cubicle/target/debug/system_test | \ - gzip -1 > debug-dist.tar.gz + cubicle/target/debug/system_test - name: Upload build artifact uses: actions/upload-artifact@v3 with: if-no-files-found: error name: debug-dist-macos-13-stable - path: debug-dist.tar.gz + path: debug-dist.tar.zst build-ubuntu-22-04-nightly: name: Build & check (ubuntu-22.04, Rust nightly) runs-on: ubuntu-22.04 @@ -137,18 +135,17 @@ jobs: RUST_BACKTRACE: '1' - name: Save build artifact run: | - tar -C .. --create \ + tar -C .. --create --file debug-dist.tar.zst \ cubicle/packages/ \ cubicle/src/bin/system_test/github/ \ cubicle/target/debug/cub \ - cubicle/target/debug/system_test | \ - gzip -1 > debug-dist.tar.gz + cubicle/target/debug/system_test - name: Upload build artifact uses: actions/upload-artifact@v3 with: if-no-files-found: error name: debug-dist-ubuntu-22.04-nightly - path: debug-dist.tar.gz + path: debug-dist.tar.zst build-ubuntu-22-04-stable: name: Build & check (ubuntu-22.04, Rust stable) runs-on: ubuntu-22.04 @@ -206,18 +203,17 @@ jobs: command: audit - name: Save build artifact run: | - tar -C .. --create \ + tar -C .. --create --file debug-dist.tar.zst \ cubicle/packages/ \ cubicle/src/bin/system_test/github/ \ cubicle/target/debug/cub \ - cubicle/target/debug/system_test | \ - gzip -1 > debug-dist.tar.gz + cubicle/target/debug/system_test - name: Upload build artifact uses: actions/upload-artifact@v3 with: if-no-files-found: error name: debug-dist-ubuntu-22.04-stable - path: debug-dist.tar.gz + path: debug-dist.tar.zst system_test-macos-12-docker: name: System tests (macos-12, docker) needs: @@ -235,7 +231,7 @@ jobs: with: name: debug-dist-macos-12-stable - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + run: tar --directory .. --extract --verbose --file debug-dist.tar.zst - name: Run cub list run: ./target/debug/cub --config 'src/bin/system_test/github/docker.toml' list env: @@ -266,7 +262,7 @@ jobs: with: name: debug-dist-macos-13-stable - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + run: tar --directory .. --extract --verbose --file debug-dist.tar.zst - name: Run cub list run: ./target/debug/cub --config 'src/bin/system_test/github/docker.toml' list env: @@ -289,7 +285,7 @@ jobs: with: name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + run: tar --directory .. --extract --verbose --file debug-dist.tar.zst - name: Run cub list run: ./target/debug/cub --config 'src/bin/system_test/github/bubblewrap.toml' list env: @@ -312,7 +308,7 @@ jobs: with: name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + run: tar --directory .. --extract --verbose --file debug-dist.tar.zst - name: Run cub list run: ./target/debug/cub --config 'src/bin/system_test/github/docker.toml' list env: @@ -335,7 +331,7 @@ jobs: with: name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + run: tar --directory .. --extract --verbose --file debug-dist.tar.zst - name: Run cub list run: ./target/debug/cub --config 'src/bin/system_test/github/docker-bind.toml' list env: @@ -358,7 +354,7 @@ jobs: with: name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.gz + run: tar --directory .. --extract --verbose --file debug-dist.tar.zst - name: Run cub list run: ./target/debug/cub --config 'src/bin/system_test/github/user.toml' list env: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index a149e7c..9f89ab7 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -493,22 +493,15 @@ fn build_job(os: Os, rust: Rust, run_once_checks: RunOnceChecks) -> (JobKey, Job }); } - // The uploader currently uses gzip internally and will aggressively and - // slowly gzip anything it doesn't think is already compressed. It has an - // exception for a very small number of file extensions, including `.gz`. - // This uses `gzip -1` first, which saves a second or two. We can switch to - // Zstd (which would save another couple of seconds) once this PR is - // merged: . steps.push(Step { name: s("Save build artifact"), details: Run { run: s(indoc! {" - tar -C .. --create \\ + tar -C .. --create --file debug-dist.tar.zst \\ cubicle/packages/ \\ cubicle/src/bin/system_test/github/ \\ cubicle/target/debug/cub \\ - cubicle/target/debug/system_test | \\ - gzip -1 > debug-dist.tar.gz + cubicle/target/debug/system_test "}), }, env: dict! {}, @@ -520,7 +513,7 @@ fn build_job(os: Os, rust: Rust, run_once_checks: RunOnceChecks) -> (JobKey, Job uses: Action::UploadArtifact, with: dict! { "name" => format!("debug-dist-{os}-{rust}"), - "path" => "debug-dist.tar.gz", + "path" => "debug-dist.tar.zst", "if-no-files-found" => "error", }, }, @@ -591,7 +584,7 @@ fn system_test_job(os: Os, runner: Runner, needs: Vec) -> (JobKey, Job) steps.push(Step { name: s("Unpack build artifact"), details: Run { - run: s("tar --directory .. --extract --verbose --file debug-dist.tar.gz"), + run: s("tar --directory .. --extract --verbose --file debug-dist.tar.zst"), }, env: dict! {}, }); From fddc77f9ffa2d1a9452b18fbac97b80d4a60c1a6 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 13:09:41 -0800 Subject: [PATCH 42/45] CI: Update GitHub core actions --- .github/workflows/main.yaml | 36 ++++++++++++++++++------------------ src/bin/gen_github_yaml.rs | 12 ++++++------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 34009d6..1afbd5d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -16,7 +16,7 @@ jobs: runs-on: macos-12 steps: - name: Check out sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust stable toolchain uses: actions-rs/toolchain@v1 with: @@ -25,7 +25,7 @@ jobs: profile: minimal toolchain: stable - name: Use Rust/Cargo cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: cargo-macos-12-stable-${{ hashFiles('Cargo.lock') }} path: | @@ -51,7 +51,7 @@ jobs: cubicle/target/debug/cub \ cubicle/target/debug/system_test - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: debug-dist-macos-12-stable @@ -61,7 +61,7 @@ jobs: runs-on: macos-13 steps: - name: Check out sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust stable toolchain uses: actions-rs/toolchain@v1 with: @@ -70,7 +70,7 @@ jobs: profile: minimal toolchain: stable - name: Use Rust/Cargo cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: cargo-macos-13-stable-${{ hashFiles('Cargo.lock') }} path: | @@ -96,7 +96,7 @@ jobs: cubicle/target/debug/cub \ cubicle/target/debug/system_test - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: debug-dist-macos-13-stable @@ -106,7 +106,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust nightly toolchain uses: actions-rs/toolchain@v1 with: @@ -115,7 +115,7 @@ jobs: profile: minimal toolchain: nightly - name: Use Rust/Cargo cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: cargo-ubuntu-22.04-nightly-${{ hashFiles('Cargo.lock') }} path: | @@ -141,7 +141,7 @@ jobs: cubicle/target/debug/cub \ cubicle/target/debug/system_test - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: debug-dist-ubuntu-22.04-nightly @@ -151,7 +151,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust stable toolchain uses: actions-rs/toolchain@v1 with: @@ -160,7 +160,7 @@ jobs: profile: minimal toolchain: stable - name: Use Rust/Cargo cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: cargo-ubuntu-22.04-stable-${{ hashFiles('Cargo.lock') }} path: | @@ -209,7 +209,7 @@ jobs: cubicle/target/debug/cub \ cubicle/target/debug/system_test - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: debug-dist-ubuntu-22.04-stable @@ -227,7 +227,7 @@ jobs: - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: debug-dist-macos-12-stable - name: Unpack build artifact @@ -258,7 +258,7 @@ jobs: - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: debug-dist-macos-13-stable - name: Unpack build artifact @@ -281,7 +281,7 @@ jobs: - name: Install Bubblewrap and minor dependencies run: sudo apt-get install -y bubblewrap pv - name: Download build artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact @@ -304,7 +304,7 @@ jobs: - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact @@ -327,7 +327,7 @@ jobs: - name: Docker hello world run: docker run --rm debian:12 echo 'Hello world' - name: Download build artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact @@ -350,7 +350,7 @@ jobs: - name: Install minor dependencies run: sudo apt-get install -y pv - name: Download build artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: debug-dist-ubuntu-22.04-stable - name: Unpack build artifact diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 9f89ab7..27cdc0b 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -242,14 +242,14 @@ impl Action { fn as_str(&self) -> &'static str { use Action::*; match self { - Checkout => "actions/checkout@v2", - Cache => "actions/cache@v3", - CacheRestore => "actions/cache/restore@v3", - CacheSave => "actions/cache/save@v3", + Checkout => "actions/checkout@v4", + Cache => "actions/cache@v4", + CacheRestore => "actions/cache/restore@v4", + CacheSave => "actions/cache/save@v4", Cargo => "actions-rs/cargo@v1", - DownloadArtifact => "actions/download-artifact@v3", + DownloadArtifact => "actions/download-artifact@v4", RustToolchain => "actions-rs/toolchain@v1", - UploadArtifact => "actions/upload-artifact@v3", + UploadArtifact => "actions/upload-artifact@v4", } } } From cb4c32be0abcf4397f573b2e6a314995f8a51259 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 13:26:46 -0800 Subject: [PATCH 43/45] CI: Drop actions-rs/toolchain (unmaintained) --- .github/workflows/main.yaml | 36 ++++++++++++------------------------ src/bin/gen_github_yaml.rs | 17 ++++++----------- 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1afbd5d..77fc5e2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,12 +18,9 @@ jobs: - name: Check out sources uses: actions/checkout@v4 - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - components: rustfmt, clippy - override: 'true' - profile: minimal - toolchain: stable + run: | + rustup toolchain install stable --profile minimal --component clippy,rustfmt + rustup default stable - name: Use Rust/Cargo cache uses: actions/cache@v4 with: @@ -63,12 +60,9 @@ jobs: - name: Check out sources uses: actions/checkout@v4 - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - components: rustfmt, clippy - override: 'true' - profile: minimal - toolchain: stable + run: | + rustup toolchain install stable --profile minimal --component clippy,rustfmt + rustup default stable - name: Use Rust/Cargo cache uses: actions/cache@v4 with: @@ -108,12 +102,9 @@ jobs: - name: Check out sources uses: actions/checkout@v4 - name: Install Rust nightly toolchain - uses: actions-rs/toolchain@v1 - with: - components: rustfmt, clippy - override: 'true' - profile: minimal - toolchain: nightly + run: | + rustup toolchain install nightly --profile minimal --component clippy,rustfmt + rustup default nightly - name: Use Rust/Cargo cache uses: actions/cache@v4 with: @@ -153,12 +144,9 @@ jobs: - name: Check out sources uses: actions/checkout@v4 - name: Install Rust stable toolchain - uses: actions-rs/toolchain@v1 - with: - components: rustfmt, clippy - override: 'true' - profile: minimal - toolchain: stable + run: | + rustup toolchain install stable --profile minimal --component clippy,rustfmt + rustup default stable - name: Use Rust/Cargo cache uses: actions/cache@v4 with: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 27cdc0b..33abf38 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -46,7 +46,7 @@ //! The types in this file do not aim to model all the functionality of GitHub //! workflows. They are tailored specifically to the needs of Cubicle. -use indoc::indoc; +use indoc::{formatdoc, indoc}; use serde::{Serialize, Serializer}; use serde_json::json; use serde_yaml::{Mapping, Value}; @@ -234,7 +234,6 @@ enum Action { CacheSave, Cargo, DownloadArtifact, - RustToolchain, UploadArtifact, } @@ -248,7 +247,6 @@ impl Action { CacheSave => "actions/cache/save@v4", Cargo => "actions-rs/cargo@v1", DownloadArtifact => "actions/download-artifact@v4", - RustToolchain => "actions-rs/toolchain@v1", UploadArtifact => "actions/upload-artifact@v4", } } @@ -385,14 +383,11 @@ fn build_job(os: Os, rust: Rust, run_once_checks: RunOnceChecks) -> (JobKey, Job steps.push(Step { name: format!("Install Rust {rust} toolchain"), - details: Uses { - uses: Action::RustToolchain, - with: dict! { - "profile" => "minimal", - "toolchain" => rust, - "override" => true, - "components" => "rustfmt, clippy", - }, + details: Run { + run: formatdoc! {" + rustup toolchain install {rust} --profile minimal --component clippy,rustfmt + rustup default {rust} + "}, }, env: dict! {}, }); From ba29628b4f10ea4056122c90a87c43fbce65241c Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 13:31:46 -0800 Subject: [PATCH 44/45] CI: Drop actions-rs/cargo (unmaintained) --- .github/workflows/main.yaml | 51 +++++++++---------------------------- src/bin/gen_github_yaml.rs | 41 +++++++++-------------------- 2 files changed, 24 insertions(+), 68 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 77fc5e2..9621583 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -31,13 +31,9 @@ jobs: target/ restore-keys: cargo-macos-12-stable- - name: Run cargo build - uses: actions-rs/cargo@v1 - with: - command: build + run: cargo build - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo test env: RUST_BACKTRACE: '1' - name: Save build artifact @@ -73,13 +69,9 @@ jobs: target/ restore-keys: cargo-macos-13-stable- - name: Run cargo build - uses: actions-rs/cargo@v1 - with: - command: build + run: cargo build - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo test env: RUST_BACKTRACE: '1' - name: Save build artifact @@ -115,13 +107,9 @@ jobs: target/ restore-keys: cargo-ubuntu-22.04-nightly- - name: Run cargo build - uses: actions-rs/cargo@v1 - with: - command: build + run: cargo build - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo test env: RUST_BACKTRACE: '1' - name: Save build artifact @@ -157,38 +145,23 @@ jobs: target/ restore-keys: cargo-ubuntu-22.04-stable- - name: Run cargo build - uses: actions-rs/cargo@v1 - with: - command: build + run: cargo build - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo test env: RUST_BACKTRACE: '1' - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - args: --all -- --check - command: fmt + run: cargo fmt --all -- --check - name: Run clippy - uses: actions-rs/cargo@v1 - with: - args: -- -D warnings - command: clippy + run: cargo clippy -- -D warnings - name: Check GitHub YAML run: | cargo run --bin gen_github_yaml > .github/workflows/main.gen.yaml diff .github/workflows/main.yaml .github/workflows/main.gen.yaml - name: Install cargo audit - uses: actions-rs/cargo@v1 - with: - args: cargo-audit - command: install + run: cargo install cargo-audit - name: Run cargo audit - uses: actions-rs/cargo@v1 - with: - command: audit + run: cargo audit - name: Save build artifact run: | tar -C .. --create --file debug-dist.tar.zst \ diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index 33abf38..f2cb112 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -232,7 +232,6 @@ enum Action { Cache, CacheRestore, CacheSave, - Cargo, DownloadArtifact, UploadArtifact, } @@ -245,7 +244,6 @@ impl Action { Cache => "actions/cache@v4", CacheRestore => "actions/cache/restore@v4", CacheSave => "actions/cache/save@v4", - Cargo => "actions-rs/cargo@v1", DownloadArtifact => "actions/download-artifact@v4", UploadArtifact => "actions/upload-artifact@v4", } @@ -412,18 +410,16 @@ fn build_job(os: Os, rust: Rust, run_once_checks: RunOnceChecks) -> (JobKey, Job steps.push(Step { name: s("Run cargo build"), - details: Uses { - uses: Action::Cargo, - with: dict! { "command" => "build" }, + details: Run { + run: s("cargo build"), }, env: dict! {}, }); steps.push(Step { name: s("Run cargo test"), - details: Uses { - uses: Action::Cargo, - with: dict! { "command" => "test" }, + details: Run { + run: s("cargo test"), }, env: dict! { "RUST_BACKTRACE" => "1" }, }); @@ -433,24 +429,16 @@ fn build_job(os: Os, rust: Rust, run_once_checks: RunOnceChecks) -> (JobKey, Job if run_once_checks.0 { steps.push(Step { name: s("Run cargo fmt"), - details: Uses { - uses: Action::Cargo, - with: dict! { - "command" => "fmt", - "args" => "--all -- --check", - }, + details: Run { + run: s("cargo fmt --all -- --check"), }, env: dict! {}, }); steps.push(Step { name: s("Run clippy"), - details: Uses { - uses: Action::Cargo, - with: dict! { - "command" => "clippy", - "args" => "-- -D warnings", - }, + details: Run { + run: s("cargo clippy -- -D warnings"), }, env: dict! {}, }); @@ -468,21 +456,16 @@ fn build_job(os: Os, rust: Rust, run_once_checks: RunOnceChecks) -> (JobKey, Job steps.push(Step { name: s("Install cargo audit"), - details: Uses { - uses: Action::Cargo, - with: dict! { - "command" => "install", - "args" => "cargo-audit", - }, + details: Run { + run: s("cargo install cargo-audit"), }, env: dict! {}, }); steps.push(Step { name: s("Run cargo audit"), - details: Uses { - uses: Action::Cargo, - with: dict! { "command" => "audit" }, + details: Run { + run: s("cargo audit"), }, env: dict! {}, }); From 27972ce325e13e0741de87540fac9962bfde9c92 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2024 13:46:14 -0800 Subject: [PATCH 45/45] CI: Switch to Mac OS 13 only --- .github/workflows/main.yaml | 65 ------------------------------------- src/bin/gen_github_yaml.rs | 17 ++++------ 2 files changed, 6 insertions(+), 76 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9621583..0c1a2f6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,44 +11,6 @@ on: - cron: 0 16 * * * workflow_dispatch: {} jobs: - build-macos-12-stable: - name: Build & check (macos-12, Rust stable) - runs-on: macos-12 - steps: - - name: Check out sources - uses: actions/checkout@v4 - - name: Install Rust stable toolchain - run: | - rustup toolchain install stable --profile minimal --component clippy,rustfmt - rustup default stable - - name: Use Rust/Cargo cache - uses: actions/cache@v4 - with: - key: cargo-macos-12-stable-${{ hashFiles('Cargo.lock') }} - path: | - ~/.cargo/registry - ~/.cargo/git/ - target/ - restore-keys: cargo-macos-12-stable- - - name: Run cargo build - run: cargo build - - name: Run cargo test - run: cargo test - env: - RUST_BACKTRACE: '1' - - name: Save build artifact - run: | - tar -C .. --create --file debug-dist.tar.zst \ - cubicle/packages/ \ - cubicle/src/bin/system_test/github/ \ - cubicle/target/debug/cub \ - cubicle/target/debug/system_test - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - if-no-files-found: error - name: debug-dist-macos-12-stable - path: debug-dist.tar.zst build-macos-13-stable: name: Build & check (macos-13, Rust stable) runs-on: macos-13 @@ -175,33 +137,6 @@ jobs: if-no-files-found: error name: debug-dist-ubuntu-22.04-stable path: debug-dist.tar.zst - system_test-macos-12-docker: - name: System tests (macos-12, docker) - needs: - - build-macos-12-stable - runs-on: macos-12 - steps: - - name: Install Docker - run: brew install docker - - name: Start Colima - run: colima start - - name: Docker hello world - run: docker run --rm debian:12 echo 'Hello world' - - name: Download build artifact - uses: actions/download-artifact@v4 - with: - name: debug-dist-macos-12-stable - - name: Unpack build artifact - run: tar --directory .. --extract --verbose --file debug-dist.tar.zst - - name: Run cub list - run: ./target/debug/cub --config 'src/bin/system_test/github/docker.toml' list - env: - RUST_BACKTRACE: '1' - - name: Run system test - run: ./target/debug/system_test --config 'src/bin/system_test/github/docker.toml' - env: - INSTA_WORKSPACE_ROOT: . - RUST_BACKTRACE: '1' system_test-macos-13-docker: name: System tests (macos-13, docker) needs: diff --git a/src/bin/gen_github_yaml.rs b/src/bin/gen_github_yaml.rs index f2cb112..ffffc8a 100644 --- a/src/bin/gen_github_yaml.rs +++ b/src/bin/gen_github_yaml.rs @@ -188,9 +188,10 @@ use StepDetails::*; #[derive(Clone, Copy, Debug, Eq, PartialEq)] enum Os { Ubuntu, - - // Use both Mac OS 12 and 13 for now. Both are slow at Docker. Race them - // for a while to find out which one is faster or more reliable. + // Both Mac versions are slow to run Docker. Despite having to install + // Colima, Mac OS 13 is more current and not much slower (relatively), so + // prefer it. + #[allow(unused)] Mac12, Mac13, } @@ -333,12 +334,7 @@ fn ci_jobs() -> BTreeMap { jobs.extend([build_job(Os::Ubuntu, Rust::Nightly, RunOnceChecks(false))]); - let mac12_stable_key = { - let (key, job) = build_job(Os::Mac12, Rust::Stable, RunOnceChecks(false)); - jobs.insert(key.clone(), job); - key - }; - let mac13_stable_key = { + let mac_stable_key = { let (key, job) = build_job(Os::Mac13, Rust::Stable, RunOnceChecks(false)); jobs.insert(key.clone(), job); key @@ -357,8 +353,7 @@ fn ci_jobs() -> BTreeMap { vec![ubuntu_stable_key.clone()], ), system_test_job(Os::Ubuntu, Runner::User, vec![ubuntu_stable_key]), - system_test_job(Os::Mac12, Runner::Docker, vec![mac12_stable_key]), - system_test_job(Os::Mac13, Runner::Docker, vec![mac13_stable_key]), + system_test_job(Os::Mac13, Runner::Docker, vec![mac_stable_key]), ]); jobs