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

use stub for anything not unix and not windows #593

Merged
merged 4 commits into from Apr 9, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -121,6 +121,34 @@ jobs:
RUST_VERSION: stable
WASM: wasm_simple

wasm_emscripten:
strategy:
matrix:
os: [macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-emscripten
override: true

- name: Install node
uses: actions/setup-node@v1
with:
node-version: '12'

- name: Build and Test
run: bash ci/github.sh
env:
RUST_VERSION: stable
WASM: wasm_emscripten

cross-targets:
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -24,6 +24,7 @@ Versions with only mechanical changes will be omitted from the following list.
* Add optional rkyv support.
* Add support for microseconds timestamps serde serialization for `NaiveDateTime`.
* Add support for optional timestamps serde serialization for `NaiveDateTime`.
* Fix build for wasm32-unknown-emscripten (@yu-re-ka #593)

## 0.4.19

Expand Down
6 changes: 6 additions & 0 deletions ci/github.sh
Expand Up @@ -34,6 +34,8 @@ meaningful in the github actions feature matrix UI.
test_wasm
elif [[ ${WASM:-} == wasm_simple ]]; then
test_wasm_simple
elif [[ ${WASM:-} == wasm_emscripten ]]; then
test_wasm_emscripten
elif [[ ${CORE:-} == no_std ]]; then
test_core
elif [[ ${EXHAUSTIVE_TZ:-} == all_tzs ]]; then
Expand Down Expand Up @@ -112,4 +114,8 @@ test_wasm_simple() {
fi
}

test_wasm_emscripten() {
runt cargo build --target wasm32-unknown-emscripten
}

main "$@"
6 changes: 3 additions & 3 deletions src/sys/mod.rs
Expand Up @@ -16,15 +16,15 @@

use std::time::{SystemTime, UNIX_EPOCH};

#[cfg(any(target_arch = "wasm32", target_env = "sgx"))]
#[cfg(all(not(unix), not(windows)))]
#[path = "stub.rs"]
mod inner;

#[cfg(all(unix, not(target_arch = "wasm32"), not(target_env = "sgx")))]
#[cfg(unix)]
#[path = "unix.rs"]
mod inner;

#[cfg(all(windows, not(target_arch = "wasm32"), not(target_env = "sgx")))]
#[cfg(windows)]
#[path = "windows.rs"]
mod inner;

Expand Down