Skip to content

Commit

Permalink
Remove timezone interface from wasi-clocks (bytecodealliance#7515)
Browse files Browse the repository at this point in the history
* delete wasi-clocks timezone interface: import wit changes from WebAssembly/wasi-clocks#55

* remove other references to wasi:clocks/timezone in wits

* remove todo! implementation of clocks/timezone and add_to_linker funcs
  • Loading branch information
Pat Hickey authored and alexcrichton committed Nov 12, 2023
1 parent aff8d97 commit 974d88a
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 117 deletions.
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/wall-clock@0.2.0-rc-2023-11-05;
import wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-05;
import wasi:clocks/timezone@0.2.0-rc-2023-11-05;
import wasi:filesystem/types@0.2.0-rc-2023-11-05;
import wasi:filesystem/preopens@0.2.0-rc-2023-11-05;
import wasi:sockets/instance-network@0.2.0-rc-2023-11-05;
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/wall-clock@0.2.0-rc-2023-11-05;
import wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-05;
import wasi:clocks/timezone@0.2.0-rc-2023-11-05;
import wasi:random/random@0.2.0-rc-2023-11-05;

/// Proxies have standard output and error streams which are expected to
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/wall-clock@0.2.0-rc-2023-11-05;
import wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-05;
import wasi:clocks/timezone@0.2.0-rc-2023-11-05;
import wasi:filesystem/types@0.2.0-rc-2023-11-05;
import wasi:filesystem/preopens@0.2.0-rc-2023-11-05;
import wasi:sockets/instance-network@0.2.0-rc-2023-11-05;
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/wall-clock@0.2.0-rc-2023-11-05;
import wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-05;
import wasi:clocks/timezone@0.2.0-rc-2023-11-05;
import wasi:random/random@0.2.0-rc-2023-11-05;

/// Proxies have standard output and error streams which are expected to
Expand Down

0 comments on commit 974d88a

Please sign in to comment.