diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 091893e528e9..6bd9a3b84d2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -293,7 +293,7 @@ jobs: ) cargo build --features "${FEATURES[*]}" - # We only support s3 services for now, but we will extend wasm support for other services. + # We only support some services(see `available_services` below) for now, but we will extend wasm support for other services. build_under_wasm: runs-on: ubuntu-latest steps: @@ -306,6 +306,7 @@ jobs: run: | available_services=( services-azblob + services-gdrive services-s3 ) IFS="," diff --git a/core/src/services/gdrive/backend.rs b/core/src/services/gdrive/backend.rs index fd83d96fa24d..3e88e912ca6e 100644 --- a/core/src/services/gdrive/backend.rs +++ b/core/src/services/gdrive/backend.rs @@ -39,7 +39,8 @@ pub struct GdriveBackend { pub core: Arc, } -#[async_trait] +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] impl Accessor for GdriveBackend { type Reader = IncomingAsyncBody; type BlockingReader = (); diff --git a/core/src/services/gdrive/lister.rs b/core/src/services/gdrive/lister.rs index b8cf78a8eaf9..9da239035d68 100644 --- a/core/src/services/gdrive/lister.rs +++ b/core/src/services/gdrive/lister.rs @@ -37,7 +37,8 @@ impl GdriveLister { } } -#[async_trait] +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] impl oio::PageList for GdriveLister { async fn next_page(&self, ctx: &mut oio::PageContext) -> Result<()> { let file_id = self.core.get_file_id_by_path(&self.path).await?; diff --git a/core/src/services/gdrive/writer.rs b/core/src/services/gdrive/writer.rs index 445ecb36f7c9..f902ed2559c3 100644 --- a/core/src/services/gdrive/writer.rs +++ b/core/src/services/gdrive/writer.rs @@ -87,7 +87,8 @@ impl GdriveWriter { } } -#[async_trait] +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] impl oio::OneShotWrite for GdriveWriter { async fn write_once(&self, bs: &dyn WriteBuf) -> Result<()> { let bs = bs.bytes(bs.remaining());