Compare commits

..

3 Commits

Author SHA1 Message Date
15fa157419 feat: add windows support 2023-03-19 13:18:21 +01:00
b094ae4f53 feat: add musl ci (#51)
This pr adds musl ci support for #50
2023-03-19 12:16:36 +00:00
2faabb0e50 feat: with multi platform ci (#46)
This adds the first iteration of multi platform ci. This is the lowest level of testing added: pinned all the way to nightly. Next up will be macos, then musl and arm. And lastly windows. Each will probably require special handling, especially because of how cross and qemu interacts with the dagger-engine and docker.
2023-03-19 00:20:53 +00:00
8 changed files with 87 additions and 249 deletions

View File

@@ -27,7 +27,7 @@ jobs:
- stable - stable
- beta - beta
- nightly - nightly
#- nightly-musl - nightly-musl
#- nightly-32 #- nightly-32
#- nightly-mips #- nightly-mips
#- nightly-arm #- nightly-arm
@@ -47,10 +47,10 @@ jobs:
- build: nightly - build: nightly
os: ubuntu-22.04 os: ubuntu-22.04
rust: nightly rust: nightly
#- build: nightly-musl - build: nightly-musl
# os: ubuntu-22.04 os: ubuntu-22.04
# rust: nightly rust: nightly
# target: x86_64-unknown-linux-musl target: x86_64-unknown-linux-musl
#- build: nightly-32 #- build: nightly-32
# os: ubuntu-22.04 # os: ubuntu-22.04
# rust: nightly # rust: nightly
@@ -87,35 +87,66 @@ jobs:
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0 uses: docker/setup-buildx-action@v2.0.0
- uses: actions-rs/toolchain@v1 - name: Install Rust
if: matrix.target == '' uses: dtolnay/rust-toolchain@master
with: with:
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.rust }}
- uses: actions-rs/toolchain@v1 - name: Use Cross
if: matrix.target != '' if: matrix.target != ''
with: run: |
toolchain: ${{ matrix.rust }} cargo install cross
target: ${{ matrix.target }} echo "CARGO=cross" >> $GITHUB_ENV
use-cross: true echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
- uses: actions-rs/cargo@v1 echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
if: matrix.target != '' - name: Show command used for Cargo
with: run: |
use-cross: true echo "cargo command is: ${{ env.CARGO }}"
command: build echo "target flag is: ${{ env.TARGET_FLAGS }}"
args: --workspace --verbose --target ${{ matrix.target }} - name: Build
- uses: actions-rs/cargo@v1 run: ${{ env.CARGO }} build --verbose --workspace ${{ env.TARGET_FLAGS }}
- name: Run tests (without cross)
if: matrix.target == '' if: matrix.target == ''
run: ${{ env.CARGO }} test --verbose --workspace ${{ env.TARGET_FLAGS }}
#- name: Run tests (with cross)
# if: matrix.target != ''
# run: ${{ env.CARGO }} test --verbose --workspace ${{ env.TARGET_FLAGS }}
test_multi_platform:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v3
- name: Install packages (macOS)
if: matrix.os == 'macos-latest'
run: |
ci/scripts/macos-install-packages
- name: Set up QEMU
if: matrix.os != 'windows-latest'
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: matrix.os != 'windows-latest'
uses: docker/setup-buildx-action@v2.0.0
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with: with:
command: build toolchain: nightly
args: --workspace --verbose - name: Run unit tests
- uses: actions-rs/cargo@v1 run: cargo test --locked --all-targets --workspace --all-features
if: matrix.target != '' timeout-minutes: 10
rustfmt:
name: rustfmt
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with: with:
use-cross: true toolchain: stable
command: test components: rustfmt
args: --all --verbose --target ${{ matrix.target }} - name: Check formatting
- uses: actions-rs/cargo@v1 run: cargo fmt --all --check
if: matrix.target == ''
with:
command: test
args: --all --verbose

View File

@@ -1,7 +1,7 @@
# Architecture # Architecture
- `.` Root project mainly used for generating the CLI, which in turn is used to - `crates/dagger-bootstrap` Root project mainly used for generating the CLI,
bootstrap the code generation from `dagger` which in turn is used to bootstrap the code generation from `dagger`
- `crates/dagger-core` Contains all base types used during actual usage. This is - `crates/dagger-core` Contains all base types used during actual usage. This is
where the primary logic lives in which the user interacts (\*disclaimer: most where the primary logic lives in which the user interacts (\*disclaimer: most
stuff haven't moved in here yet.) stuff haven't moved in here yet.)

212
Cargo.lock generated
View File

@@ -31,7 +31,7 @@ checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.0", "syn 2.0.2",
] ]
[[package]] [[package]]
@@ -67,6 +67,12 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5dd14596c0e5b954530d0e6f1fd99b89c03e313aa2086e8da4303701a09e1cf"
[[package]] [[package]]
name = "block-buffer" name = "block-buffer"
version = "0.10.4" version = "0.10.4"
@@ -119,11 +125,11 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.1.10" version = "4.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce38afc168d8665cfc75c7b1dd9672e50716a137f433f070991619744a67342a" checksum = "42dfd32784433290c51d92c438bb72ea5063797fc3cc9a21a8c4346bebbb2098"
dependencies = [ dependencies = [
"bitflags", "bitflags 2.0.1",
"clap_lex", "clap_lex",
"is-terminal", "is-terminal",
"strsim", "strsim",
@@ -188,22 +194,6 @@ dependencies = [
"unicode-segmentation", "unicode-segmentation",
] ]
[[package]]
name = "core-foundation"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
[[package]] [[package]]
name = "cpufeatures" name = "cpufeatures"
version = "0.2.5" version = "0.2.5"
@@ -250,18 +240,9 @@ dependencies = [
"color-eyre", "color-eyre",
"dagger-codegen", "dagger-codegen",
"dagger-core", "dagger-core",
"dirs",
"eyre", "eyre",
"graphql_client",
"hex",
"hex-literal",
"platform-info",
"reqwest",
"serde", "serde",
"serde_json", "serde_json",
"sha2",
"tar",
"tempfile",
"tokio", "tokio",
] ]
@@ -288,7 +269,6 @@ dependencies = [
"dirs", "dirs",
"eyre", "eyre",
"flate2", "flate2",
"gql_client",
"graphql_client", "graphql_client",
"hex", "hex",
"hex-literal", "hex-literal",
@@ -508,21 +488,6 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 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]] [[package]]
name = "form_urlencoded" name = "form_urlencoded"
version = "1.1.0" version = "1.1.0"
@@ -670,18 +635,6 @@ version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4"
[[package]]
name = "gql_client"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e57f4862d3e5cd4ffe8df03fa2137e620e33578bbc1895e6f8f569630e17b1db"
dependencies = [
"log",
"reqwest",
"serde",
"serde_json",
]
[[package]] [[package]]
name = "graphql-introspection-query" name = "graphql-introspection-query"
version = "0.2.0" version = "0.2.0"
@@ -870,19 +823,6 @@ dependencies = [
"tokio-rustls", "tokio-rustls",
] ]
[[package]]
name = "hyper-tls"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
"bytes",
"hyper",
"native-tls",
"tokio",
"tokio-native-tls",
]
[[package]] [[package]]
name = "ident_case" name = "ident_case"
version = "1.0.1" version = "1.0.1"
@@ -1056,24 +996,6 @@ dependencies = [
"windows-sys 0.45.0", "windows-sys 0.45.0",
] ]
[[package]]
name = "native-tls"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e"
dependencies = [
"lazy_static",
"libc",
"log",
"openssl",
"openssl-probe",
"openssl-sys",
"schannel",
"security-framework",
"security-framework-sys",
"tempfile",
]
[[package]] [[package]]
name = "nu-ansi-term" name = "nu-ansi-term"
version = "0.46.0" version = "0.46.0"
@@ -1109,51 +1031,6 @@ version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "openssl"
version = "0.10.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd2523381e46256e40930512c7fd25562b9eae4812cb52078f155e87217c9d1e"
dependencies = [
"bitflags",
"cfg-if",
"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 1.0.109",
]
[[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.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "176be2629957c157240f68f61f2d0053ad3a4ecfdd9ebf1e6521d18d9635cf67"
dependencies = [
"autocfg",
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]] [[package]]
name = "os_str_bytes" name = "os_str_bytes"
version = "6.4.1" version = "6.4.1"
@@ -1222,12 +1099,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pkg-config"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
[[package]] [[package]]
name = "platform-info" name = "platform-info"
version = "1.0.2" version = "1.0.2"
@@ -1310,7 +1181,7 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [ dependencies = [
"bitflags", "bitflags 1.3.2",
] ]
[[package]] [[package]]
@@ -1370,12 +1241,10 @@ dependencies = [
"http-body", "http-body",
"hyper", "hyper",
"hyper-rustls", "hyper-rustls",
"hyper-tls",
"ipnet", "ipnet",
"js-sys", "js-sys",
"log", "log",
"mime", "mime",
"native-tls",
"once_cell", "once_cell",
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",
@@ -1385,7 +1254,6 @@ dependencies = [
"serde_json", "serde_json",
"serde_urlencoded", "serde_urlencoded",
"tokio", "tokio",
"tokio-native-tls",
"tokio-rustls", "tokio-rustls",
"tokio-util", "tokio-util",
"tower-service", "tower-service",
@@ -1425,7 +1293,7 @@ version = "0.36.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fe885c3a125aa45213b68cc1472a49880cb5923dc23f522ad2791b882228778" checksum = "2fe885c3a125aa45213b68cc1472a49880cb5923dc23f522ad2791b882228778"
dependencies = [ dependencies = [
"bitflags", "bitflags 1.3.2",
"errno", "errno",
"io-lifetimes", "io-lifetimes",
"libc", "libc",
@@ -1460,15 +1328,6 @@ version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
[[package]]
name = "schannel"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
dependencies = [
"windows-sys 0.42.0",
]
[[package]] [[package]]
name = "scopeguard" name = "scopeguard"
version = "1.1.0" version = "1.1.0"
@@ -1485,29 +1344,6 @@ dependencies = [
"untrusted", "untrusted",
] ]
[[package]]
name = "security-framework"
version = "2.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254"
dependencies = [
"bitflags",
"core-foundation",
"core-foundation-sys",
"libc",
"security-framework-sys",
]
[[package]]
name = "security-framework-sys"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.157" version = "1.0.157"
@@ -1525,7 +1361,7 @@ checksum = "78997f4555c22a7971214540c4a661291970619afd56de19f77e0de86296e1e5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.0", "syn 2.0.2",
] ]
[[package]] [[package]]
@@ -1630,9 +1466,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.0" version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cff13bb1732bccfe3b246f3fdb09edfd51c01d6f5299b7ccd9457c2e4e37774" checksum = "59d3276aee1fa0c33612917969b5172b5be2db051232a6e4826f1a1a9191b045"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -1689,7 +1525,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.0", "syn 2.0.2",
] ]
[[package]] [[package]]
@@ -1748,16 +1584,6 @@ dependencies = [
"syn 1.0.109", "syn 1.0.109",
] ]
[[package]]
name = "tokio-native-tls"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
dependencies = [
"native-tls",
"tokio",
]
[[package]] [[package]]
name = "tokio-rustls" name = "tokio-rustls"
version = "0.23.4" version = "0.23.4"
@@ -1956,12 +1782,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]] [[package]]
name = "version_check" name = "version_check"
version = "0.9.4" version = "0.9.4"

2
Cross.toml Normal file
View File

@@ -0,0 +1,2 @@
[target.x86_64-unknown-linux-musl]
image = "messense/rust-musl-cross:x86_64-musl"

View File

@@ -20,20 +20,4 @@ serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }
reqwest = { version = "0.11.14", features = [
"stream",
"rustls",
"hyper-rustls",
"rustls-tls",
] }
clap = "4.1.6" clap = "4.1.6"
dirs = "4.0.0"
graphql_client = { version = "0.12.0", features = [
"reqwest-rustls",
], default_features = false }
hex = "0.4.3"
hex-literal = "0.3.4"
platform-info = "1.0.2"
sha2 = "0.10.6"
tar = "0.4.38"
tempfile = "3.3.0"

View File

@@ -18,7 +18,6 @@ tracing = { workspace = true }
tracing-subscriber = { workspace = true } tracing-subscriber = { workspace = true }
base64 = "0.21.0" base64 = "0.21.0"
gql_client = "1.0.7"
dirs = "4.0.0" dirs = "4.0.0"
flate2 = { version = "1.0.25", features = ["rust_backend"] } flate2 = { version = "1.0.25", features = ["rust_backend"] }
graphql_client = { version = "0.12.0", features = [ graphql_client = { version = "0.12.0", features = [
@@ -32,6 +31,7 @@ reqwest = { version = "0.11.14", features = [
"stream", "stream",
"rustls-tls", "rustls-tls",
], default-features = false } ], default-features = false }
sha2 = "0.10.6" sha2 = "0.10.6"
tar = "0.4.38" tar = "0.4.38"
tempfile = "3.3.0" tempfile = "3.3.0"

View File

@@ -4,9 +4,9 @@ use std::sync::Arc;
use async_trait::async_trait; use async_trait::async_trait;
use base64::engine::general_purpose; use base64::engine::general_purpose;
use base64::Engine; use base64::Engine;
use gql_client::ClientConfig;
use crate::connect_params::ConnectParams; use crate::connect_params::ConnectParams;
use crate::gql_client::{ClientConfig, GQLClient};
#[async_trait] #[async_trait]
pub trait GraphQLClient { pub trait GraphQLClient {
@@ -17,7 +17,7 @@ pub type DynGraphQLClient = Arc<dyn GraphQLClient + Send + Sync>;
#[derive(Debug)] #[derive(Debug)]
pub struct DefaultGraphQLClient { pub struct DefaultGraphQLClient {
client: gql_client::Client, client: GQLClient,
} }
impl DefaultGraphQLClient { impl DefaultGraphQLClient {
@@ -28,7 +28,7 @@ impl DefaultGraphQLClient {
headers.insert("Authorization".to_string(), format!("Basic {}", token)); headers.insert("Authorization".to_string(), format!("Basic {}", token));
Self { Self {
client: gql_client::Client::new_with_config(ClientConfig { client: GQLClient::new_with_config(ClientConfig {
endpoint: conn.url(), endpoint: conn.url(),
timeout: Some(1000), timeout: Some(1000),
headers: Some(headers), headers: Some(headers),

View File

@@ -7,6 +7,7 @@ pub mod config;
pub mod connect_params; pub mod connect_params;
pub mod downloader; pub mod downloader;
pub mod engine; pub mod engine;
pub mod gql_client;
pub mod graphql_client; pub mod graphql_client;
pub mod introspection; pub mod introspection;
pub mod logger; pub mod logger;