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

Remove timezone interface from wasi-clocks #7515

Merged
merged 4 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 0 additions & 1 deletion crates/wasi-http/wit/deps/cli/reactor.wit
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package wasi:[email protected];
world reactor {
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:filesystem/[email protected];
import wasi:filesystem/[email protected];
import wasi:sockets/[email protected];
Expand Down
48 changes: 0 additions & 48 deletions crates/wasi-http/wit/deps/clocks/timezone.wit

This file was deleted.

1 change: 0 additions & 1 deletion crates/wasi-http/wit/deps/clocks/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ package wasi:[email protected];
world imports {
import monotonic-clock;
import wall-clock;
import timezone;
}
1 change: 0 additions & 1 deletion crates/wasi-http/wit/deps/http/proxy.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ world proxy {
/// HTTP proxies have access to time and randomness.
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:random/[email protected];

/// Proxies have standard output and error streams which are expected to
Expand Down
1 change: 0 additions & 1 deletion crates/wasi-http/wit/main.wit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package wasmtime:wasi;
world preview1-adapter-reactor {
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:filesystem/[email protected];
import wasi:filesystem/[email protected];
import wasi:sockets/[email protected];
Expand Down
4 changes: 0 additions & 4 deletions crates/wasi/src/preview2/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ wasmtime::component::bindgen!({
"wasi:clocks/monotonic_clock": crate::preview2::bindings::clocks::monotonic_clock,
"wasi:io/poll": crate::preview2::bindings::io::poll,
"wasi:io/streams": crate::preview2::bindings::io::streams,
"wasi:clocks/timezone": crate::preview2::bindings::clocks::timezone,
"wasi:clocks/wall_clock": crate::preview2::bindings::clocks::wall_clock,
"wasi:random/random": crate::preview2::bindings::random::random,
"wasi:cli/environment": crate::preview2::bindings::cli::environment,
Expand All @@ -30,7 +29,6 @@ wasmtime::component::bindgen!({
pub fn add_to_linker<T: WasiView>(l: &mut wasmtime::component::Linker<T>) -> anyhow::Result<()> {
crate::preview2::bindings::clocks::wall_clock::add_to_linker(l, |t| t)?;
crate::preview2::bindings::clocks::monotonic_clock::add_to_linker(l, |t| t)?;
crate::preview2::bindings::clocks::timezone::add_to_linker(l, |t| t)?;
crate::preview2::bindings::filesystem::types::add_to_linker(l, |t| t)?;
crate::preview2::bindings::filesystem::preopens::add_to_linker(l, |t| t)?;
crate::preview2::bindings::io::poll::add_to_linker(l, |t| t)?;
Expand Down Expand Up @@ -71,7 +69,6 @@ pub mod sync {
"wasi:clocks/monotonic_clock": crate::preview2::bindings::clocks::monotonic_clock,
"wasi:io/poll": crate::preview2::bindings::sync_io::io::poll,
"wasi:io/streams": crate::preview2::bindings::sync_io::io::streams,
"wasi:clocks/timezone": crate::preview2::bindings::clocks::timezone,
"wasi:clocks/wall_clock": crate::preview2::bindings::clocks::wall_clock,
"wasi:random/random": crate::preview2::bindings::random::random,
"wasi:cli/environment": crate::preview2::bindings::cli::environment,
Expand All @@ -92,7 +89,6 @@ pub mod sync {
) -> anyhow::Result<()> {
crate::preview2::bindings::clocks::wall_clock::add_to_linker(l, |t| t)?;
crate::preview2::bindings::clocks::monotonic_clock::add_to_linker(l, |t| t)?;
crate::preview2::bindings::clocks::timezone::add_to_linker(l, |t| t)?;
crate::preview2::bindings::sync_io::filesystem::types::add_to_linker(l, |t| t)?;
crate::preview2::bindings::filesystem::preopens::add_to_linker(l, |t| t)?;
crate::preview2::bindings::sync_io::io::poll::add_to_linker(l, |t| t)?;
Expand Down
11 changes: 0 additions & 11 deletions crates/wasi/src/preview2/host/clocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use crate::preview2::bindings::{
clocks::monotonic_clock::{self, Duration as WasiDuration, Instant},
clocks::timezone::{self, TimezoneDisplay},
clocks::wall_clock::{self, Datetime},
};
use crate::preview2::poll::{subscribe, Subscribe};
Expand Down Expand Up @@ -102,13 +101,3 @@ impl Subscribe for Deadline {
}
}
}

impl<T: WasiView> timezone::Host for T {
fn display(&mut self, when: Datetime) -> anyhow::Result<TimezoneDisplay> {
todo!("timezone display is not implemented")
}

fn utc_offset(&mut self, when: Datetime) -> anyhow::Result<i32> {
todo!("timezone utc_offset is not implemented")
}
}
1 change: 0 additions & 1 deletion crates/wasi/wit/deps/cli/reactor.wit
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package wasi:[email protected];
world reactor {
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:filesystem/[email protected];
import wasi:filesystem/[email protected];
import wasi:sockets/[email protected];
Expand Down
48 changes: 0 additions & 48 deletions crates/wasi/wit/deps/clocks/timezone.wit

This file was deleted.

1 change: 0 additions & 1 deletion crates/wasi/wit/deps/clocks/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ package wasi:[email protected];
world imports {
import monotonic-clock;
import wall-clock;
import timezone;
}
1 change: 0 additions & 1 deletion crates/wasi/wit/deps/http/proxy.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ world proxy {
/// HTTP proxies have access to time and randomness.
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:random/[email protected];

/// Proxies have standard output and error streams which are expected to
Expand Down
1 change: 0 additions & 1 deletion crates/wasi/wit/main.wit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package wasmtime:wasi;
world preview1-adapter-reactor {
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:filesystem/[email protected];
import wasi:filesystem/[email protected];
import wasi:sockets/[email protected];
Expand Down