-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Make pest no_std compatible. #498
Conversation
In order to avoid breaking changes, please do put the std error impl behind a (default enabled) Technically doing so is still breaking for anyone using Since we currently do not have any default features, there's no reason for someone to be using (Basic argument for "hard breaking:" the idea of "soft breaking" is that the fully elaborated form wouldn't break, and works both before and after the change. For features, the fully elaborated form would be to use no-default-features and enable every feature automatically.) (As that's the case, I'm basically for every crate that thinks they might support no_std in the future to add a default-on This will also allow you to reënable the std-requiring tests. |
Thanks for your suggestion, @CAD97. To test |
Soft breaking with a |
Just to let you know: I have now also ported |
@CAD97 & @dragostis, what is the status on this? Is there anything I can do to help my pull request getting merged? |
Ah sorry, I meant to r+ this earlier. I don't think derive / generator need to be no_std, since they only run on the host machine? (With the new cargo feature resolver that properly isolates features, anyway.) If you have a use case for it, feel free to open a new PR with an explanation of what it unlocks. bors: r=@CAD97, @dragostis |
498: Make pest no_std compatible. r=CAD97,dragostis a=01mf02 This is another attempt to fix #240 and make pest `no_std` compatible, allowing it to be used for example in web applications via WASM. I started slowly by converting the core `pest` crate only. All tests pass. There is however one breaking change: In my new version, pest's `Error` type does not implement `std::error::Error`, because this trait is part of `std`. If implementing this trait is important, it could be implemented behind a feature flag. Co-authored-by: Michael Färber <[email protected]>
Build failed: |
Oh right, new clippy warnings. The quickest way to get this merged is a new PR to fix those @01mf02 , otherwise I might get around to doing those eventually. (The clippy warning should just be an |
I just checked these clippy warnings.
in
However, I think that this alone will not solve the clippy warning, because the
I think that someone with more privileges and experience than me should check these steps. :) |
Regarding the other clippy warning: The change required would be: diff --git a/meta/src/lib.rs b/meta/src/lib.rs
index 1f9c5bc..f049e0b 100644
--- a/meta/src/lib.rs
+++ b/meta/src/lib.rs
@@ -30,11 +30,11 @@ where
{
result.unwrap_or_else(|e| {
panic!(
- "grammar error\n\n".to_owned()
- + &e.into_iter()
- .map(|error| format!("{}", error))
- .collect::<Vec<_>>()
- .join("\n\n")
+ "grammar error\n\n{}",
+ e.into_iter()
+ .map(|error| error.to_string())
+ .collect::<Vec<_>>()
+ .join("\n\n")
)
})
} Sorry, I'm reluctant to open a new PR because of the current state of my working tree. |
Let's try this again now bors: r+ |
Looks like bors crashed. bors: retry |
bors crashed twice with the same error, I've reported it upstream. |
I'm going to run this again. It won't work, but it will get me a request ID that I can send to github support. bors r+ |
Opened support ticket |
@CAD97 @notriddle, do we have any update on this? Is this an issue with Bors or Github? The link to the issue provided by @CAD97 is broken for me. |
Nothing. 12 days ago, they said "it should be working", and haven't added anything new to the issue since. |
I wonder what's the issue. We use bors on a daily basis at Meilisearch, with no issue, there must be a workaround. testing if bors test |
You want |
bors: ping bors: try |
pong |
Immediate crash again. Immediate 403 after asking bors to try. The only information I have on what failed is |
It's the actual merge operation that's failing. I manually reproduced it with |
#468 merged fine so it must be something about this PR... I know there's some weird permission things about inline notes from actions, and as such I was surprised to see them pop up in this PR (but maybe my remembrance is outdated). I don't see any other possible reason merging this PR specifically could fail with a permissions issue. bors: r+ (Yep it crashed with the same error) |
I've merged master into this PR to test a theory on why bors is failing: permissions requiring the branch to be up to date? bors: r+ |
Build succeeded: |
Confirmed that this was the issue. @notriddle: it'd be nice if bors-ng could catch this error and report a nice "failed to merge; check your permissions" message. Unfortunately I don't have access to this repo's protection settings currently, so I don't know which one broke bors, but I have a suspicion that it's "Require branches to be up to date before merging" as previously suggested. @dragostis: we definitely need to fix whatever permissions setting is causing bors to not work. Either you need to fix it or give me the permissions to do so. |
513: Make pest_generator / pest_derive no_std compatible. r=CAD97 a=01mf02 This is the follow-up pull request to #498. It adds "std" feature flags for both pest_generator and pest_derive. Currently, the correct function of this can only be tested by running `cargo test --no-default-features` *in the `derive` directory*. Running `cargo test --no-default-features` in the root directory unfortunately does not run the tests in no_std mode. Co-authored-by: Michael Färber <[email protected]> Co-authored-by: Michael Färber <[email protected]>
This is another attempt to fix #240 and make pest
no_std
compatible, allowing it to be used for example in web applications via WASM. I started slowly by converting the corepest
crate only.All tests pass.
There is however one breaking change: In my new version, pest's
Error
type does not implementstd::error::Error
, because this trait is part ofstd
. If implementing this trait is important, it could be implemented behind a feature flag.