You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "ngg (via GitHub)" <gi...@apache.org> on 2026/04/05 06:52:28 UTC

[I] bug: web-time should only target wasm32-unknown-unknown [opendal]

ngg opened a new issue, #7359:
URL: https://github.com/apache/opendal/issues/7359

   ### Describe the bug
   
   The `web-time` cfg gates use `cfg(target_arch = "wasm32")`, matching all wasm32 targets. `web-time` pulls in `wasm-bindgen` which only works in browsers, breaking builds for other targets like `wasm32-wasip1`.
   
   As https://docs.rs/web-time/latest/web_time/ states:
   
   > This library specifically targets browsers, that support [Performance.now()](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now), with the `wasm32-unknown-unknown` target. Emscripten is not supported. WASI doesn’t require support as it has it’s own native API to deal with [std::time](https://doc.rust-lang.org/stable/std/time/).
   
   The crate itself already gates on `cfg(all(target_family = "wasm", target_os = "unknown"))` internally.
   
   Fixing this unblocks building opendal with no default features for non-browser wasm targets.
   
   
   ### Steps to Reproduce
   
   Run `cargo build --target wasm32-wasip1 --no-default-features`, it fails with an error about this
   
   ### Expected Behavior
   
   It should compile. (I know WASI target is not officially supported or tested, but as this is the only error, it is easy to fix)
   
   ### Additional Context
   
   _No response_
   
   ### Are you willing to submit a PR to fix this bug?
   
   - [x] Yes, I would like to submit a PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: web-time should only target wasm32-unknown-unknown [opendal]

Posted by "ngg (via GitHub)" <gi...@apache.org>.
ngg commented on issue #7359:
URL: https://github.com/apache/opendal/issues/7359#issuecomment-4188461916

   Fixing just this single cfg-gate unblocks building for `wasm32-wasip1` target. I agree that checking all other wasm cfg gates would be useful too, but this smaller PR could be merged earlier as it is useful on its own.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: web-time should only target wasm32-unknown-unknown [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #7359: bug: web-time should only target wasm32-unknown-unknown
URL: https://github.com/apache/opendal/issues/7359


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: web-time should only target wasm32-unknown-unknown [opendal]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #7359:
URL: https://github.com/apache/opendal/issues/7359#issuecomment-4188419442

   <!-- Greeting -->
   Hi @ngg! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the opendal team.
   
   <!-- Answer -->
   This was actually partially addressed in a previous PR [[1]](https://github.com/apache/opendal/pull/7156) which fixed the `web_time` cfg in `core/src/raw/time.rs` from `#[cfg(target_arch = "wasm32")]` to `#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]`.
   
   However, the issue is broader than just `web-time` itself. There are **~13 cfg gates** across the codebase still using `target_arch = "wasm32"` that pull in browser-specific dependencies or behavior, which would also break non-browser wasm targets:
   
   - **`core/Cargo.toml`** — wasm-specific deps like `gloo-timers-sleep`, `getrandom` with `js` feature, `uuid` with `js` feature [[2]](https://github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/Cargo.toml#L408-L412)
   - **`core/src/types/futures.rs`** — 4 cfg gates for `BoxedFuture`/`MaybeSend` trait bounds [[3]](https://github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/raw/futures_util.rs#L30-L58)
   - **`core/src/raw/http_util/`** — 4 cfg gates for reqwest wasm workarounds [[4]](https://github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/raw/http_util/client.rs#L173-L218)
   - **`core/src/raw/oio/list/page_list.rs`** — future trait bounds [[5]](https://github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/raw/oio/list/page_list.rs#L36-L39)
   - **`core/src/services/mod.rs`** — OPFS (browser-only) module inclusion [[6]](https://github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/services/mod.rs#L205-L206)
   - **S3/GCS backends** — disabling env/filesystem credential loading [[7]](https://github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/services/s3/backend.rs#L800-L803) [[8]](https://github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/services/gcs/backend.rs#L272-L275)
   
   For a PR, you'd likely want to change the `Cargo.toml` target gate and the browser-specific ones (OPFS, JS features) to `cfg(all(target_family = "wasm", target_os = "unknown"))`. Some of the others (like the `Send` bound removal) might legitimately apply to all wasm32 targets, so those may need case-by-case consideration.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response#message_id=fbef94ba-b96b-4bf5-ac2c-90fef2e4e876&feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer#message_id=fbef94ba-b96b-4bf5-ac2c-90fef2e4e876&feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources#message_id=fbef94ba-b96b-4bf5-ac2c-90fef2e4e876&feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose#message_id=fbef94ba-b96b-4bf5-ac2c-90fef2e4e876&feedback_type=too_verbose) | [Hallucination](https://
 app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination#message_id=fbef94ba-b96b-4bf5-ac2c-90fef2e4e876&feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report#message_id=fbef94ba-b96b-4bf5-ac2c-90fef2e4e876&feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other#message_id=fbef94ba-b96b-4bf5-ac2c-90fef2e4e876&feedback_type=other)</sup>
   [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/997a2c5a-0c54-497b-989d-44651635dd36/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20was%20actually%20partially%20addressed%20in%20a%20previous%20PR%20%5B%5B1%5D%5D%28https%3A//github.com/apache/opendal/pull/7156%29%20which%20fixed%20the%20%60web_time%60%20cfg%20in%20%60core/src/raw/time.rs%60%20from%20%60%23%5Bcfg%28target_arch%20%3D%20%22wasm32%22%29%5D%60%20to%20%60%23%5Bcfg%28all%28target_arch%20%3D%20%22wasm32%22%2C%20target_os%20%3D%20%22unknown%22%29%29%5D%60.%0A%0AHowever%2C%20the%20issue%20is%20broader%20than%20just%20%60web-time%60%20itself.%20There%20are%20%2A%2A~13%20cfg%20gates%2A%2A%20across%20the%20codebase%20still%20using%20%60target_arch%20%3D%20%22wasm32%22%60%20that%20pull%20in%20browser-specific%20dependencies%20or%20behavior%2C%2
 0which%20would%20also%20break%20non-browser%20wasm%20targets%3A%0A%0A-%20%2A%2A%60core/Cargo.toml%60%2A%2A%20%E2%80%94%20wasm-specific%20deps%20like%20%60gloo-timers-sleep%60%2C%20%60getrandom%60%20with%20%60js%60%20feature%2C%20%60uuid%60%20with%20%60js%60%20feature%20%5B%5B2%5D%5D%28https%3A//github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/Cargo.toml%23L408-L412%29%0A-%20%2A%2A%60core/src/types/futures.rs%60%2A%2A%20%E2%80%94%204%20cfg%20gates%20for%20%60BoxedFuture%60/%60MaybeSend%60%20trait%20bounds%20%5B%5B3%5D%5D%28https%3A//github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/raw/futures_util.rs%23L30-L58%29%0A-%20%2A%2A%60core/src/raw/http_util/%60%2A%2A%20%E2%80%94%204%20cfg%20gates%20for%20reqwest%20wasm%20workarounds%20%5B%5B4%5D%5D%28https%3A//github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/raw/http_util/client.rs%23L173-L218%29%0A-%20%2A%2A%60core/src/raw/oio/list/page_list.rs%60%2
 A%2A%20%E2%80%94%20future%20trait%20bounds%20%5B%5B5%5D%5D%28https%3A//github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/raw/oio/list/page_list.rs%23L36-L39%29%0A-%20%2A%2A%60core/src/services/mod.rs%60%2A%2A%20%E2%80%94%20OPFS%20%28browser-only%29%20module%20inclusion%20%5B%5B6%5D%5D%28https%3A//github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/services/mod.rs%23L205-L206%29%0A-%20%2A%2AS3/GCS%20backends%2A%2A%20%E2%80%94%20disabling%20env/filesystem%20credential%20loading%20%5B%5B7%5D%5D%28https%3A//github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/services/s3/backend.rs%23L800-L803%29%20%5B%5B8%5D%5D%28https%3A//github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/services/gcs/backend.rs%23L272-L275%29%0A%0AFor%20a%20PR%2C%20you%27d%20likely%20want%20to%20change%20the%20%60Cargo.toml%60%20target%20gate%20and%20the%20browser-specific%20ones%20%28OPFS%2C%20JS%20f
 eatures%29%20to%20%60cfg%28all%28target_family%20%3D%20%22wasm%22%2C%20target_os%20%3D%20%22unknown%22%29%29%60.%20Some%20of%20the%20others%20%28like%20the%20%60Send%60%20bound%20removal%29%20might%20legitimately%20apply%20to%20all%20wasm32%20targets%2C%20so%20those%20may%20need%20case-by-case%20consideration.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/opendal/issues/7359)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: web-time should only target wasm32-unknown-unknown [opendal]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #7359:
URL: https://github.com/apache/opendal/issues/7359#issuecomment-4188478577

   <!-- Answer -->
   That's a fair point — your [PR #7360](https://github.com/apache/opendal/pull/7360) is a focused, minimal fix that narrows the `web-time` cfg gate to `wasm32-unknown-unknown` only, which is the right thing to do for that dependency. It's a clean, self-contained change that unblocks `wasm32-wasip1` builds without touching anything else. The broader audit of the other cfg gates (like the `gloo-timers-sleep`, `getrandom` js, and `uuid` js features in `Cargo.toml` [[1]](https://github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/Cargo.toml#L408-L412)) can definitely be tackled separately as a follow-up.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response#message_id=a9e2ff16-7175-48a5-9126-248a10902334&feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer#message_id=a9e2ff16-7175-48a5-9126-248a10902334&feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources#message_id=a9e2ff16-7175-48a5-9126-248a10902334&feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose#message_id=a9e2ff16-7175-48a5-9126-248a10902334&feedback_type=too_verbose) | [Hallucination](https://
 app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination#message_id=a9e2ff16-7175-48a5-9126-248a10902334&feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report#message_id=a9e2ff16-7175-48a5-9126-248a10902334&feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other#message_id=a9e2ff16-7175-48a5-9126-248a10902334&feedback_type=other)</sup>
   [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/997a2c5a-0c54-497b-989d-44651635dd36/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=That%27s%20a%20fair%20point%20%E2%80%94%20your%20%5BPR%20%237360%5D%28https%3A//github.com/apache/opendal/pull/7360%29%20is%20a%20focused%2C%20minimal%20fix%20that%20narrows%20the%20%60web-time%60%20cfg%20gate%20to%20%60wasm32-unknown-unknown%60%20only%2C%20which%20is%20the%20right%20thing%20to%20do%20for%20that%20dependency.%20It%27s%20a%20clean%2C%20self-contained%20change%20that%20unblocks%20%60wasm32-wasip1%60%20builds%20without%20touching%20anything%20else.%20The%20broader%20audit%20of%20the%20other%20cfg%20gates%20%28like%20the%20%60gloo-timers-sleep%60%2C%20%60getrandom%60%20js%2C%20and%20%60uuid%60%20js%20features%20in%20%60Cargo.toml%60%20%5B%5B1%5D%5D%28https%3A//
 github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/Cargo.toml%23L408-L412%29%29%20can%20definitely%20be%20tackled%20separately%20as%20a%20follow-up.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/opendal/issues/7359)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org