Skip to content

Commit

Permalink
fix: Attempt to fix the chumsky break on MacOS (#1978)
Browse files Browse the repository at this point in the history
* fix: Attempt to fix the chumsky break on MacOS

* Re-enable workflows

* Excluding features from macos vs. wasm
  • Loading branch information
max-sixty authored Feb 28, 2023
1 parent 9e6306c commit 3da40be
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
target_option: ["", --target=wasm32-unknown-unknown]

# Combination of macos and wasm32 has a problem with crate psm, a dependency of chumsky
exclude:
- os: macos-latest
target_option: --target=wasm32-unknown-unknown
uses: ./.github/workflows/test-rust.yaml
with:
os: ${{ matrix.os }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

# Combination of macos and wasm32 has a problem with crate psm, a dependency of chumsky
exclude:
- os: macos-latest
steps:
- name: 📂 Checkout code
uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
# Note we don't have a `default-members = ["prql-compiler"]`, since that causes
# commands like `cargo test` to only run tests from the default package. And
# `cargo insta test` doesn't have a `--workspace` flag.
resolver = "2"

[workspace.package]
edition = "2021"
Expand Down
9 changes: 7 additions & 2 deletions prql-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ metadata.msrv = "1.65.0"
[dependencies]
anyhow = {version = "1.0.57", features = ["backtrace"]}
ariadne = "0.1.5"
chumsky = "0.9.0"
csv = "1.2.0"
enum-as-inner = "0.5.0"
itertools = "0.10.3"
Expand All @@ -31,13 +30,19 @@ sqlparser = {version = "0.30.0", features = ["serde"]}
strum = {version = "0.24.0", features = ["std", "derive"]}# for converting enum variants to string
strum_macros = "0.24.0"

# Chumsky issues in wasm (though we only see it when compiling on MacOS)
[target.'cfg(not(target_family="wasm"))'.dependencies]
chumsky = "0.9.0"
[target.'cfg(target_family="wasm")'.dependencies]
chumsky = {version = "0.9.0", features = ["ahash", "std"], default-features = false}

[dev-dependencies]
cfg-if = "1.0"
insta = {version = "1.28", features = ["colors", "glob", "yaml"]}

# For integration tests
[target.'cfg(not(target_family="wasm"))'.dev-dependencies]
chrono = {version = "0.4", features = [], default-features = false }
chrono = {version = "0.4", features = [], default-features = false}
criterion = "0.4.0"
postgres = "0.19.3"
pretty_assertions = "1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion prql-js/tests/test_all.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("prql-js", () => {

it("should throw an error on invalid prql", () => {
expect(() =>
prql.compile("Mississippi has four S’s and four I’s.")
prql.compile("Mississippi has four Ss and four Is.")
).to.throw("Error");
});

Expand Down

0 comments on commit 3da40be

Please sign in to comment.