diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45f3bb5..921e489 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,23 @@ jobs: name: Build strategy: matrix: - os: [ubuntu-22.04, windows-2022, macos-13, macos-14] + include: + - os: ubuntu-22.04 + arch: amd64 + - os: ubuntu-22.04 + arch: arm64 + - os: ubuntu-24.04 + arch: amd64 + - os: ubuntu-24.04 + arch: arm64 + - os: windows-2022 + arch: x64 + - os: macos-13 + arch: x64 + - os: macos-14 + arch: arm64 - runs-on: ${{ matrix.os }} + runs-on: ${{ (matrix.arch == 'arm64' && matrix.os == 'macos-14') && 'macos-14' || matrix.os }} steps: - name: checkout @@ -23,5 +37,24 @@ jobs: uses: extractions/setup-just@v1 with: just-version: 1.14.0 - - name: Build and Test + - name: Setup cross-compilation for ARM64 Linux + if: ${{ startsWith(matrix.os, 'ubuntu-') && matrix.arch == 'arm64' }} + run: | + rustup target add aarch64-unknown-linux-gnu + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu pkg-config + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV + + - name: Build and Test (ARM64 Linux Cross-Compilation) + if: ${{ startsWith(matrix.os, 'ubuntu-') && matrix.arch == 'arm64' }} + run: | + just fmt + git diff --exit-code + just check + cargo build --locked --target aarch64-unknown-linux-gnu + just test + + - name: Build and Test (Standard) + if: ${{ !(startsWith(matrix.os, 'ubuntu-') && matrix.arch == 'arm64') }} run: just ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b74d105..e852846 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,12 @@ jobs: include: - os: ubuntu-22.04 arch: amd64 + - os: ubuntu-22.04 + arch: arm64 + - os: ubuntu-24.04 + arch: amd64 + - os: ubuntu-24.04 + arch: arm64 - os: windows-2022 arch: x64 - os: macos-13 @@ -20,7 +26,7 @@ jobs: - os: macos-14 arch: arm64 - runs-on: ${{ matrix.os }} + runs-on: ${{ (matrix.arch == 'arm64' && matrix.os == 'macos-14') && 'macos-14' || matrix.os }} steps: - uses: actions/checkout@v2 diff --git a/Cargo.lock b/Cargo.lock index cf9bac4..3707660 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "esc" -version = "1.24.3" +version = "1.27.0" dependencies = [ "chrono", "cidr", @@ -412,15 +412,6 @@ dependencies = [ "validator", ] -[[package]] -name = "fastrand" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" -dependencies = [ - "instant", -] - [[package]] name = "fd-lock" version = "2.0.0" @@ -437,21 +428,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.0.1" @@ -717,19 +693,6 @@ dependencies = [ "tokio-rustls", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes 1.2.0", - "hyper 0.14.20", - "native-tls", - "tokio 1.20.0", - "tokio-native-tls", -] - [[package]] name = "idna" version = "0.2.3" @@ -751,15 +714,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if 1.0.0", -] - [[package]] name = "iovec" version = "0.1.4" @@ -925,24 +879,6 @@ dependencies = [ "ws2_32-sys", ] -[[package]] -name = "native-tls" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "net2" version = "0.2.37" @@ -1054,51 +990,12 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" -[[package]] -name = "openssl" -version = "0.10.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "os_str_bytes" version = "6.2.0" @@ -1169,12 +1066,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1270,15 +1161,6 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "reqwest" version = "0.11.11" @@ -1295,13 +1177,11 @@ dependencies = [ "http-body 0.4.5", "hyper 0.14.20", "hyper-rustls", - "hyper-tls", "ipnet", "js-sys", "lazy_static", "log", "mime", - "native-tls", "percent-encoding", "pin-project-lite 0.2.9", "rustls", @@ -1311,7 +1191,6 @@ dependencies = [ "serde_json", "serde_urlencoded", "tokio 1.20.0", - "tokio-native-tls", "tokio-rustls", "tower-service", "url", @@ -1642,20 +1521,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if 1.0.0", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.9", -] - [[package]] name = "termcolor" version = "1.1.3" @@ -1791,16 +1656,6 @@ dependencies = [ "syn", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" -dependencies = [ - "native-tls", - "tokio 1.20.0", -] - [[package]] name = "tokio-rustls" version = "0.23.4" @@ -1970,12 +1825,6 @@ dependencies = [ "url", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "vec_map" version = "0.8.2" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 50150a6..ecbb86d 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,9 +1,10 @@ [package] name = "esc" -version = "1.24.3" +version = "1.27.0" authors = [ "Yorick Laupa ", "Tim Simpson ", + "Brock Shelton ", ] edition = "2018" @@ -33,5 +34,5 @@ rustyline = "6.2" cidr = "0.1" clap = "*" clap_complete = "*" -reqwest = { version = "0.11", features = ["json", "rustls-tls-native-roots"] } +reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls-native-roots"] } validator = "0.10" diff --git a/generated/Cargo.toml b/generated/Cargo.toml index ac3b823..b7d3f4f 100644 --- a/generated/Cargo.toml +++ b/generated/Cargo.toml @@ -17,7 +17,7 @@ log = "0.4" validator = "0.10" chrono = { version = "0.4", features = ["serde"] } bytes = "0.5" -reqwest = { version = "0.11", features = ["json", "rustls-tls-native-roots"] } +reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls-native-roots"] } urlencoding = "1.3.3" [dev-dependencies] diff --git a/release.ps1 b/release.ps1 index bcd7110..0dc39a5 100644 --- a/release.ps1 +++ b/release.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] Param( [Parameter(Mandatory=$true)] - [ValidateSet("windows-2022", "ubuntu-22.04", "macos-13", "macos-14")] + [ValidateSet("windows-2022", "ubuntu-22.04", "ubuntu-24.04", "macos-13", "macos-14")] [string]$Runner, [Parameter(Mandatory=$true)] @@ -48,10 +48,29 @@ New-Item -Path . -Name "output" -ItemType "directory" -Force switch($Runner) { - ubuntu-22.04 + { $_ -in @("ubuntu-22.04", "ubuntu-24.04") } { cargo install cargo-deb - cargo deb --manifest-path=cli/Cargo.toml --output=output + + if ($Arch -eq "arm64") { + # Cross-compilation setup for ARM64 + rustup target add aarch64-unknown-linux-gnu + + # Install cross-compilation toolchain dependencies + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu pkg-config + + # Set environment variables required for cross-linking + $env:CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = "aarch64-linux-gnu-gcc" + $env:PKG_CONFIG_ALLOW_CROSS = "1" + + # Cross-compile for ARM64 + cargo deb --manifest-path=cli/Cargo.toml --target=aarch64-unknown-linux-gnu --output=output + } else { + # Native compilation for AMD64 + cargo deb --manifest-path=cli/Cargo.toml --output=output + } + $artifactName = ls output $finalName = "EventStoreDB.Cloud.CLI-$Version-1.${Runner}_${Arch}.deb" Push-Location "output" diff --git a/store/Cargo.toml b/store/Cargo.toml index 47d1d96..e6ce7bf 100644 --- a/store/Cargo.toml +++ b/store/Cargo.toml @@ -20,7 +20,7 @@ log = "0.4.14" validator = "0.10" chrono = { version = "0.4", features = ["serde"] } bytes = "0.5" -reqwest = { version = "0.11", features = ["json", "rustls-tls-native-roots"] } +reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls-native-roots"] } tokio = { version = "1.18", features = ["macros", "fs"] } toml = "0.5" lazy_static = "1.4" @@ -34,4 +34,3 @@ env_logger = "0.9.0" [dev-dependencies] regex = "1.5.4" -