Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make services-gdrive compile for wasm target #3808

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -306,6 +306,7 @@ jobs:
run: |
available_services=(
services-azblob
services-gdrive
services-s3
)
IFS=","
Expand Down
3 changes: 2 additions & 1 deletion core/src/services/gdrive/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ pub struct GdriveBackend {
pub core: Arc<GdriveCore>,
}

#[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 = ();
Expand Down
3 changes: 2 additions & 1 deletion core/src/services/gdrive/lister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down
3 changes: 2 additions & 1 deletion core/src/services/gdrive/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Loading